Bug 1639435: Remove GeckoProcessManager.buildLogMsg and change its callsite to just use a literal string; r=geckoview-reviewers,droeh
authorAaron Klotz <aklotz@mozilla.com>
Wed, 20 May 2020 05:02:56 +0000
changeset 530953 399e60cb2d0bd8b77757525738d8cbb169902b8e
parent 530952 005ef1c2599217538ed001683d210bd4f2776311
child 530954 0b8d520d2aa6ca00f0028426728ac9b5b5d6ed5a
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, droeh
bugs1639435
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1639435: Remove GeckoProcessManager.buildLogMsg and change its callsite to just use a literal string; r=geckoview-reviewers,droeh `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
@@ -128,30 +128,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");
             }
 
@@ -172,17 +158,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;
         }