From 1335417f9feefd20e5b0e4b1e18e9010edb87043 Mon Sep 17 00:00:00 2001 From: "blundell@chromium.org" Date: Mon, 1 Sep 2014 11:02:57 +0000 Subject: Adding possibility for client to upload the file This CL adds three features that will allow the client to upload the report file. Three main modifications are made : - Allow upload url to have a file:// scheme, and write the HTTP request to file in that case - Split the request in two parts in case of a file:// scheme, the request time and the response time. A new API [handleNetworkResponse] is added. - Give the opportunity to the client to get the configuration NSDictionary to be able to recreate the breakpad context at response time. Patch by Olivier Robin Review URL: https://breakpad.appspot.com/2764002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1368 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/ios/Breakpad.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/client/ios/Breakpad.h') diff --git a/src/client/ios/Breakpad.h b/src/client/ios/Breakpad.h index 9d212f70..c099ad07 100644 --- a/src/client/ios/Breakpad.h +++ b/src/client/ios/Breakpad.h @@ -199,6 +199,9 @@ void BreakpadRemoveUploadParameter(BreakpadRef ref, NSString *key); // Returns the number of crash reports waiting to send to the server. int BreakpadGetCrashReportCount(BreakpadRef ref); +// Returns the next upload configuration. The report file is deleted. +NSDictionary *BreakpadGetNextReportConfiguration(BreakpadRef ref); + // Upload next report to the server. void BreakpadUploadNextReport(BreakpadRef ref); @@ -207,6 +210,25 @@ void BreakpadUploadNextReport(BreakpadRef ref); void BreakpadUploadNextReportWithParameters(BreakpadRef ref, NSDictionary *server_parameters); +// Upload a report to the server. +// |server_parameters| is additional server parameters to send. +// |configuration| is the configuration of the breakpad report to send. +void BreakpadUploadReportWithParametersAndConfiguration( + BreakpadRef ref, + NSDictionary *server_parameters, + NSDictionary *configuration); + +// Handles the network response of a breakpad upload. This function is needed if +// the actual upload is done by the Breakpad client. +// |configuration| is the configuration of the upload. It must contain the same +// fields as the configuration passed to +// BreakpadUploadReportWithParametersAndConfiguration. +// |data| and |error| contain the network response. +void BreakpadHandleNetworkResponse(BreakpadRef ref, + NSDictionary *configuration, + NSData *data, + NSError *error); + // Upload a file to the server. |data| is the content of the file to sent. // |server_parameters| is additional server parameters to send. void BreakpadUploadData(BreakpadRef ref, NSData *data, NSString *name, -- cgit v1.2.1