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

Side by Side Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java

Issue 2247143004: Remove app context init from LibraryLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix per review. Created 4 years, 2 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
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 com.android.webview.chromium; 5 package com.android.webview.chromium;
6 6
7 import android.Manifest; 7 import android.Manifest;
8 import android.app.ActivityManager; 8 import android.app.ActivityManager;
9 import android.content.ComponentCallbacks2; 9 import android.content.ComponentCallbacks2;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread(); 373 assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread();
374 374
375 // The post-condition of this method is everything is ready, so notify n ow to cover all 375 // The post-condition of this method is everything is ready, so notify n ow to cover all
376 // return paths. (Other threads will not wake-up until we release |mLock |, whatever). 376 // return paths. (Other threads will not wake-up until we release |mLock |, whatever).
377 mLock.notifyAll(); 377 mLock.notifyAll();
378 378
379 if (mStarted) { 379 if (mStarted) {
380 return; 380 return;
381 } 381 }
382 382
383 Context context = ContextUtils.getApplicationContext();
384 try { 383 try {
385 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali zed(context); 384 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali zed();
386 } catch (ProcessInitException e) { 385 } catch (ProcessInitException e) {
387 throw new RuntimeException("Error initializing WebView library", e); 386 throw new RuntimeException("Error initializing WebView library", e);
388 } 387 }
389 388
390 PathService.override(PathService.DIR_MODULE, "/system/lib/"); 389 PathService.override(PathService.DIR_MODULE, "/system/lib/");
391 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi ew/paks"); 390 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi ew/paks");
392 391
393 // Make sure that ResourceProvider is initialized before starting the br owser process. 392 // Make sure that ResourceProvider is initialized before starting the br owser process.
394 final String webViewPackageName = WebViewFactory.getLoadedPackageInfo(). packageName; 393 final String webViewPackageName = WebViewFactory.getLoadedPackageInfo(). packageName;
394 Context context = ContextUtils.getApplicationContext();
395 setUpResources(webViewPackageName, context); 395 setUpResources(webViewPackageName, context);
396 ResourceBundle.initializeLocalePaks(context, R.array.locale_paks); 396 ResourceBundle.initializeLocalePaks(context, R.array.locale_paks);
397 initPlatSupportLibrary(); 397 initPlatSupportLibrary();
398 initNetworkChangeNotifier(context); 398 initNetworkChangeNotifier(context);
399 final int extraBindFlags = Context.BIND_EXTERNAL_SERVICE; 399 final int extraBindFlags = Context.BIND_EXTERNAL_SERVICE;
400 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, extra BindFlags); 400 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, extra BindFlags);
401 AwBrowserProcess.start(); 401 AwBrowserProcess.start();
402 402
403 if (isBuildDebuggable()) { 403 if (isBuildDebuggable()) {
404 setWebContentsDebuggingEnabled(true); 404 setWebContentsDebuggingEnabled(true);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase); 654 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase);
655 } 655 }
656 } 656 }
657 return mWebViewDatabase; 657 return mWebViewDatabase;
658 } 658 }
659 659
660 WebViewDelegate getWebViewDelegate() { 660 WebViewDelegate getWebViewDelegate() {
661 return mWebViewDelegate; 661 return mWebViewDelegate;
662 } 662 }
663 } 663 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698