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

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: Better formatting. Created 4 years, 3 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 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread(); 365 assert Thread.holdsLock(mLock) && ThreadUtils.runningOnUiThread();
366 366
367 // The post-condition of this method is everything is ready, so notify n ow to cover all 367 // The post-condition of this method is everything is ready, so notify n ow to cover all
368 // return paths. (Other threads will not wake-up until we release |mLock |, whatever). 368 // return paths. (Other threads will not wake-up until we release |mLock |, whatever).
369 mLock.notifyAll(); 369 mLock.notifyAll();
370 370
371 if (mStarted) { 371 if (mStarted) {
372 return; 372 return;
373 } 373 }
374 374
375 Context context = ContextUtils.getApplicationContext();
376 try { 375 try {
377 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali zed(context); 376 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali zed();
378 } catch (ProcessInitException e) { 377 } catch (ProcessInitException e) {
379 throw new RuntimeException("Error initializing WebView library", e); 378 throw new RuntimeException("Error initializing WebView library", e);
380 } 379 }
381 380
382 PathService.override(PathService.DIR_MODULE, "/system/lib/"); 381 PathService.override(PathService.DIR_MODULE, "/system/lib/");
383 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi ew/paks"); 382 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi ew/paks");
384 383
385 // Make sure that ResourceProvider is initialized before starting the br owser process. 384 // Make sure that ResourceProvider is initialized before starting the br owser process.
386 final String webViewPackageName = WebViewFactory.getLoadedPackageInfo(). packageName; 385 final String webViewPackageName = WebViewFactory.getLoadedPackageInfo(). packageName;
386 Context context = ContextUtils.getApplicationContext();
387 setUpResources(webViewPackageName, context); 387 setUpResources(webViewPackageName, context);
388 ResourceBundle.initializeLocalePaks(context, R.array.locale_paks); 388 ResourceBundle.initializeLocalePaks(context, R.array.locale_paks);
389 initPlatSupportLibrary(); 389 initPlatSupportLibrary();
390 initNetworkChangeNotifier(context); 390 initNetworkChangeNotifier(context);
391 final int extraBindFlags = Context.BIND_EXTERNAL_SERVICE; 391 final int extraBindFlags = Context.BIND_EXTERNAL_SERVICE;
392 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, extra BindFlags); 392 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, extra BindFlags);
393 AwBrowserProcess.start(); 393 AwBrowserProcess.start();
394 394
395 if (isBuildDebuggable()) { 395 if (isBuildDebuggable()) {
396 setWebContentsDebuggingEnabled(true); 396 setWebContentsDebuggingEnabled(true);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase); 646 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase);
647 } 647 }
648 } 648 }
649 return mWebViewDatabase; 649 return mWebViewDatabase;
650 } 650 }
651 651
652 WebViewDelegate getWebViewDelegate() { 652 WebViewDelegate getWebViewDelegate() {
653 return mWebViewDelegate; 653 return mWebViewDelegate;
654 } 654 }
655 } 655 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698