Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/app/ChildProcessService.java |
| diff --git a/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java b/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java |
| index 2898d423444fad86298329a9fdf2780367cb0972..e551aed667306c3d7ce24e059f0b8ea638d5c35c 100644 |
| --- a/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java |
| +++ b/content/public/android/java/src/org/chromium/content/app/ChildProcessService.java |
| @@ -184,23 +184,13 @@ public class ChildProcessService extends Service { |
| public void onDestroy() { |
| Log.i(TAG, "Destroying ChildProcessService pid=" + Process.myPid()); |
| super.onDestroy(); |
| - if (mCommandLineParams == null) { |
| - // This process was destroyed before it even started. Nothing more to do. |
| - return; |
| - } |
| - synchronized (mMainThread) { |
| - try { |
| - while (!mLibraryInitialized) { |
| - // Avoid a potential race in calling through to native code before the library |
| - // has loaded. |
| - mMainThread.wait(); |
| - } |
| - } catch (InterruptedException e) { |
| - } |
| - } |
| - // Try to shutdown the MainThread gracefully, but it might not |
| - // have chance to exit normally. |
| - nativeShutdownMainThread(); |
| + |
| + // The Android OS may resuse a process to start new service instances, |
| + // but a renderer expects to start in a clean slate. Thus we need to |
| + // reliably and quickly get rid of this process before there's a chance |
| + // it get's recycled. See http://crbug.com/338709 as well as |
| + // https://codereview.chromium.org/12288017 |
| + System.exit(0); |
|
bulach
2014/02/03 21:57:40
I can try to dig further from the android side, bu
ppi
2014/11/07 14:16:35
If System.exit(0) is frowned up... would this work
Fredrik Öhrn
2014/11/07 15:00:43
I'm not sure exactly what supposedly gets messed u
ppi
2014/11/14 10:29:58
Thanks for looking into it! Process.killProcess(Pr
ppi
2014/12/12 19:23:06
We had a discussion with the framework folks. Plea
|
| } |
| @Override |
| @@ -300,6 +290,4 @@ public class ChildProcessService extends Service { |
| * Force the child process to exit. |
| */ |
| private static native void nativeExitChildProcess(); |
| - |
| - private native void nativeShutdownMainThread(); |
| } |