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.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.SharedPreferences; | |
9 | 8 |
10 import org.chromium.base.PathUtils; | 9 import org.chromium.base.PathUtils; |
11 import org.chromium.base.ThreadUtils; | 10 import org.chromium.base.ThreadUtils; |
12 import org.chromium.content.app.LibraryLoader; | 11 import org.chromium.content.app.LibraryLoader; |
13 import org.chromium.content.browser.AndroidBrowserProcess; | 12 import org.chromium.content.browser.AndroidBrowserProcess; |
14 import org.chromium.content.common.ProcessInitException; | 13 import org.chromium.content.common.ProcessInitException; |
15 | 14 |
16 /** | 15 /** |
17 * Wrapper for the steps needed to initialize the java and native sides of webvi
ew chromium. | 16 * Wrapper for the steps needed to initialize the java and native sides of webvi
ew chromium. |
18 */ | 17 */ |
(...skipping 23 matching lines...) Expand all Loading... |
42 public static void start(final Context context) { | 41 public static void start(final Context context) { |
43 // We must post to the UI thread to cover the case that the user | 42 // We must post to the UI thread to cover the case that the user |
44 // has invoked Chromium startup by using the (thread-safe) | 43 // has invoked Chromium startup by using the (thread-safe) |
45 // CookieManager rather than creating a WebView. | 44 // CookieManager rather than creating a WebView. |
46 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 45 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
47 @Override | 46 @Override |
48 public void run() { | 47 public void run() { |
49 try { | 48 try { |
50 LibraryLoader.ensureInitialized(); | 49 LibraryLoader.ensureInitialized(); |
51 AndroidBrowserProcess.init(context, | 50 AndroidBrowserProcess.init(context, |
52 AndroidBrowserProcess.MAX_RENDERERS_SINGLE_PROCESS); | 51 AndroidBrowserProcess.MAX_RENDERERS_SINGLE_PROCESS, |
| 52 true, null); |
53 } catch (ProcessInitException e) { | 53 } catch (ProcessInitException e) { |
54 throw new RuntimeException("Cannot initialize WebView", e); | 54 throw new RuntimeException("Cannot initialize WebView", e); |
55 } | 55 } |
56 } | 56 } |
57 }); | 57 }); |
58 } | 58 } |
59 } | 59 } |
OLD | NEW |