OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.content.ComponentName; | 7 import android.content.ComponentName; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.content.ServiceConnection; | 10 import android.content.ServiceConnection; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 throw new RuntimeException("Cannot load WebView", e); | 68 throw new RuntimeException("Cannot load WebView", e); |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 /** | 72 /** |
73 * Configures child process launcher. This is required only if child service
s are used in | 73 * Configures child process launcher. This is required only if child service
s are used in |
74 * WebView. | 74 * WebView. |
75 */ | 75 */ |
76 public static void configureChildProcessLauncher(String packageName, | 76 public static void configureChildProcessLauncher(String packageName, |
77 boolean isExternalService) { | 77 boolean isExternalService) { |
78 ChildProcessCreationParams.registerDefault(new ChildProcessCreationParam
s( | 78 final boolean bindToCaller = true; |
79 packageName, isExternalService, LibraryProcessType.PROCESS_WEBVI
EW_CHILD)); | 79 ChildProcessCreationParams.registerDefault(new ChildProcessCreationParam
s(packageName, |
| 80 isExternalService, LibraryProcessType.PROCESS_WEBVIEW_CHILD, bin
dToCaller)); |
80 } | 81 } |
81 | 82 |
82 /** | 83 /** |
83 * Starts the chromium browser process running within this process. Creates
threads | 84 * Starts the chromium browser process running within this process. Creates
threads |
84 * and performs other per-app resource allocations; must not be called from
zygote. | 85 * and performs other per-app resource allocations; must not be called from
zygote. |
85 * Note: it is up to the caller to ensure this is only called once. | 86 * Note: it is up to the caller to ensure this is only called once. |
86 */ | 87 */ |
87 public static void start() { | 88 public static void start() { |
88 final Context appContext = ContextUtils.getApplicationContext(); | 89 final Context appContext = ContextUtils.getApplicationContext(); |
89 tryObtainingDataDirLock(appContext); | 90 tryObtainingDataDirLock(appContext); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 public void onServiceDisconnected(ComponentName className) {
} | 237 public void onServiceDisconnected(ComponentName className) {
} |
237 }; | 238 }; |
238 if (!appContext.bindService(intent, connection, Context.BIND_AUT
O_CREATE)) { | 239 if (!appContext.bindService(intent, connection, Context.BIND_AUT
O_CREATE)) { |
239 Log.w(TAG, "Could not bind to Minidump-copying Service " + i
ntent); | 240 Log.w(TAG, "Could not bind to Minidump-copying Service " + i
ntent); |
240 } | 241 } |
241 return null; | 242 return null; |
242 } | 243 } |
243 }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); | 244 }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); |
244 } | 245 } |
245 } | 246 } |
OLD | NEW |