Chromium Code Reviews| Index: android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java |
| diff --git a/android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java b/android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java |
| index eaf350f0e27be369a85266dae06368fb5e1fdcfc..dd3272ce2896a2a4605ebe3803c55388fd8865bc 100644 |
| --- a/android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java |
| +++ b/android_webview/test/shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java |
| @@ -5,6 +5,7 @@ |
| package org.chromium.android_webview.test; |
| import android.app.Service; |
| +import android.content.Context; |
| import android.content.Intent; |
| import android.os.Binder; |
| import android.os.IBinder; |
| @@ -31,7 +32,7 @@ public class SecondBrowserProcess extends Service { |
| case CODE_START: |
| reply.writeNoException(); |
| try { |
| - startBrowserProcess(); |
| + startBrowserProcess(SecondBrowserProcess.this); |
| reply.writeInt(Process.myPid()); |
| } catch (Exception e) { |
| reply.writeInt(0); |
| @@ -53,11 +54,11 @@ public class SecondBrowserProcess extends Service { |
| } |
| @SuppressFBWarnings("DMI_HARDCODED_ABSOLUTE_FILENAME") |
| - private void startBrowserProcess() throws Exception { |
| + static void startBrowserProcess(Context context) throws Exception { |
|
boliu
2016/08/02 20:15:59
uhh, move this somewhere that appears more "shared
gsennton
2016/08/02 20:33:57
Sure, will do :)
gsennton
2016/09/06 15:26:08
Actually, IMO we shouldn't merge these services be
boliu
2016/09/07 18:32:40
Always optimize for code that's easy to understand
gsennton
2016/09/14 13:51:51
Yes, this - having a general-purpose Service as ba
|
| CommandLine.initFromFile("/data/local/tmp/android-webview-command-line"); |
| - AwResource.setResources(this.getResources()); |
| + AwResource.setResources(context.getResources()); |
| AwResource.setConfigKeySystemUuidMapping(R.array.config_key_system_uuid_mapping); |
| - ContextUtils.initApplicationContext(getApplicationContext()); |
| + ContextUtils.initApplicationContext(context.getApplicationContext()); |
| AwBrowserProcess.loadLibrary(); |
| AwBrowserProcess.start(); |
| } |