Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java

Issue 19957002: Run the later parts of startup as UI thread tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run the later parts of startup as UI thread tasks - patch for Joth's comments Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/lib/main/aw_main_delegate.cc » ('j') | chrome/app/android/chrome_main_delegate_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698