Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / breakpad / src / client / ios / BreakpadController.mm
index a85dd68..dd71cff 100644 (file)
@@ -155,6 +155,18 @@ NSString* GetPlatform() {
   });
 }
 
+// This method must be called from the breakpad queue.
+- (void)threadUnsafeSendReportWithConfiguration:(NSDictionary*)configuration
+                                withBreakpadRef:(BreakpadRef)ref {
+  NSAssert(started_, @"The controller must be started before "
+                     "threadUnsafeSendReportWithConfiguration is called");
+  if (breakpadRef_) {
+    BreakpadUploadReportWithParametersAndConfiguration(breakpadRef_,
+                                                       uploadTimeParameters_,
+                                                       configuration);
+  }
+}
+
 - (void)setUploadingEnabled:(BOOL)enabled {
   NSAssert(started_,
       @"The controller must be started before setUploadingEnabled is called");
@@ -260,6 +272,25 @@ NSString* GetPlatform() {
   });
 }
 
+- (void)getNextReportConfigurationOrSendDelay:
+    (void(^)(NSDictionary*, int))callback {
+  NSAssert(started_, @"The controller must be started before "
+                     "getNextReportConfigurationOrSendDelay is called");
+  dispatch_async(queue_, ^{
+      if (!breakpadRef_) {
+        callback(nil, -1);
+        return;
+      }
+      int delay = [self sendDelay];
+      if (delay != 0) {
+        callback(nil, delay);
+        return;
+      }
+      [self reportWillBeSent];
+      callback(BreakpadGetNextReportConfiguration(breakpadRef_), 0);
+  });
+}
+
 #pragma mark -
 
 - (int)sendDelay {