OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.app; | 5 package org.chromium.content.app; |
6 | 6 |
7 import android.app.Service; | 7 import android.app.Service; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.graphics.SurfaceTexture; | 10 import android.graphics.SurfaceTexture; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 @Override | 87 @Override |
88 public void onCreate() { | 88 public void onCreate() { |
89 sContext = this; | 89 sContext = this; |
90 super.onCreate(); | 90 super.onCreate(); |
91 | 91 |
92 mSandboxMainThread = new Thread(new Runnable() { | 92 mSandboxMainThread = new Thread(new Runnable() { |
93 @Override | 93 @Override |
94 public void run() { | 94 public void run() { |
95 try { | 95 try { |
96 // TODO(michaelbai): Upstream LibraryLoader.java | 96 if (!LibraryLoader.loadNow()) return; |
97 // if (!LibraryLoader.loadNow()) return; | |
98 synchronized (mSandboxMainThread) { | 97 synchronized (mSandboxMainThread) { |
99 while (mCommandLineParams == null) { | 98 while (mCommandLineParams == null) { |
100 mSandboxMainThread.wait(); | 99 mSandboxMainThread.wait(); |
101 } | 100 } |
102 } | 101 } |
103 // LibraryLoader.initializeOnMainThread(mCommandLineParams); | 102 LibraryLoader.initializeOnMainThread(mCommandLineParams); |
104 synchronized (mSandboxMainThread) { | 103 synchronized (mSandboxMainThread) { |
105 mLibraryInitialized = true; | 104 mLibraryInitialized = true; |
106 mSandboxMainThread.notifyAll(); | 105 mSandboxMainThread.notifyAll(); |
107 while (mIPCFd == null) { | 106 while (mIPCFd == null) { |
108 mSandboxMainThread.wait(); | 107 mSandboxMainThread.wait(); |
109 } | 108 } |
110 } | 109 } |
111 int crashFd = (mCrashFd == null) ? -1 : mCrashFd.detachFd(); | 110 int crashFd = (mCrashFd == null) ? -1 : mCrashFd.detachFd(); |
112 ContentMain.initApplicationContext(sContext.getApplicationCo
ntext()); | 111 ContentMain.initApplicationContext(sContext.getApplicationCo
ntext()); |
113 nativeInitSandboxedProcess(sContext.getApplicationContext(), | 112 nativeInitSandboxedProcess(sContext.getApplicationContext(), |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 * @param crashFd File descriptor for signaling crashes. | 217 * @param crashFd File descriptor for signaling crashes. |
219 */ | 218 */ |
220 private static native void nativeInitSandboxedProcess(Context applicationCon
text, | 219 private static native void nativeInitSandboxedProcess(Context applicationCon
text, |
221 SandboxedProcessService service, int ipcFd, int crashFd); | 220 SandboxedProcessService service, int ipcFd, int crashFd); |
222 | 221 |
223 /** | 222 /** |
224 * Force the sandboxed process to exit. | 223 * Force the sandboxed process to exit. |
225 */ | 224 */ |
226 private static native void nativeExitSandboxedProcess(); | 225 private static native void nativeExitSandboxedProcess(); |
227 } | 226 } |
OLD | NEW |