Bug 1440034 - fixed reporting of annotations at the time of crashes on GeckoView; r?rbarker draft
authorAlex Gaynor <agaynor@mozilla.com>
Wed, 21 Feb 2018 14:37:22 -0500
changeset 758596 ce78c7c62d77c563e24e5a41c4e7a135acdefb0a
parent 758396 ea3da643422c58d65335f1778dd6c89c09911585
push id100114
push userbmo:agaynor@mozilla.com
push dateThu, 22 Feb 2018 18:26:27 +0000
reviewersrbarker
bugs1440034
milestone60.0a1
Bug 1440034 - fixed reporting of annotations at the time of crashes on GeckoView; r?rbarker MozReview-Commit-ID: 8thtJe0QmcE
ipc/glue/GeckoChildProcessHost.cpp
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -1188,17 +1188,25 @@ GeckoChildProcessHost::LaunchAndroidServ
   jni::ObjectArray::LocalRef jargs = jni::ObjectArray::New<jni::String>(argvSize);
   for (int ix = 0; ix < argvSize; ix++) {
     jargs->SetElement(ix, jni::StringParam(argv[ix].c_str(), env));
   }
   base::file_handle_mapping_vector::const_iterator it = fds_to_remap.begin();
   int32_t ipcFd = it->first;
   it++;
   // If the Crash Reporter is disabled, there will not be a second file descriptor.
-  int32_t crashFd = (it != fds_to_remap.end()) ? it->first : -1;
-  int32_t crashAnnotationFd = (it != fds_to_remap.end()) ? it->first : -1;
+  int32_t crashFd = -1;
+  int32_t crashAnnotationFd = -1;
+  if (it != fds_to_remap.end() && !CrashReporter::IsDummy()) {
+    crashFd = it->first;
+    it++;
+  }
+  if (it != fds_to_remap.end()) {
+    crashAnnotationFd = it->first;
+    it++;
+  }
   int32_t handle = java::GeckoProcessManager::Start(type, jargs, crashFd, ipcFd, crashAnnotationFd);
 
   if (process_handle) {
     *process_handle = handle;
   }
 }
 #endif