Bug 1639435: Remove GeckoProcessManager.buildLogMsg and change its callsite to just use a literal string; r=geckoview-reviewers,droeh a=pascalc
authorAaron Klotz <aklotz@mozilla.com>
Wed, 20 May 2020 05:02:56 +0000
changeset 591535 9104b1bada33ce7264df61d3cfc3023b21dd0a8e
parent 591534 2b18bbf2bf80b6e41e8dc3a24bb3b742e222801c
child 591536 bb2ce87358c110671f4832a82c619a2fbf9138f3
push id13170
push userarchaeopteryx@coole-files.de
push dateWed, 20 May 2020 16:30:31 +0000
treeherdermozilla-beta@bb2ce87358c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, droeh, pascalc
bugs1639435
milestone77.0
Bug 1639435: Remove GeckoProcessManager.buildLogMsg and change its callsite to just use a literal string; r=geckoview-reviewers,droeh a=pascalc `GeckoProcessManager.buildLogMsg` requires a successful bind to construct its message, but its only remaining callsite is only invoked when a bind fails, so it blows up. This patch eliminates `buildLogMsg` and just changes the callsite to use a string literal. Differential Revision: https://phabricator.services.mozilla.com/D76086
mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
@@ -118,30 +118,16 @@ public final class GeckoProcessManager e
             XPCOMEventTarget.assertOnLauncherThread();
             if (mChild == null) {
                 throw new IllegalStateException("Calling ChildConnection.getPid() on an unbound connection");
             }
 
             return mPid;
         }
 
-        private String buildLogMsg(@NonNull final String msgStart) {
-            final StringBuilder builder = new StringBuilder(msgStart);
-            builder.append(" ");
-            builder.append(getType().toString());
-
-            int pid = getPid();
-            if (pid != INVALID_PID) {
-                builder.append(" with pid ");
-                builder.append(pid);
-            }
-
-            return builder.toString();
-        }
-
         private GeckoResult<IChildProcess> completeFailedBind(@NonNull final ServiceAllocator.BindException e) {
             XPCOMEventTarget.assertOnLauncherThread();
             Log.e(LOGTAG, "Failed bind", e);
 
             if (mPendingBind == null) {
                 throw new IllegalStateException("Bind failed with null mPendingBind");
             }
 
@@ -162,17 +148,17 @@ public final class GeckoProcessManager e
             if (mPendingBind != null) {
                 // Bind in progress
                 return mPendingBind;
             }
 
             mPendingBind = new GeckoResult<>();
             try {
                 if (!bindService()) {
-                    throw new ServiceAllocator.BindException(buildLogMsg("Cannot connect to process"));
+                    throw new ServiceAllocator.BindException("Cannot connect to process");
                 }
             } catch (final ServiceAllocator.BindException e) {
                 return completeFailedBind(e);
             }
 
             return mPendingBind;
         }