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

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

Issue 2815403002: WebView: Refactor PlatformServiceBridge.getInstance() (Closed)
Patch Set: Created 3 years, 8 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/PlatformServiceBridge.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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 394
395 try { 395 try {
396 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali zed(); 396 LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitiali zed();
397 } catch (ProcessInitException e) { 397 } catch (ProcessInitException e) {
398 throw new RuntimeException("Error initializing WebView library", e); 398 throw new RuntimeException("Error initializing WebView library", e);
399 } 399 }
400 400
401 PathService.override(PathService.DIR_MODULE, "/system/lib/"); 401 PathService.override(PathService.DIR_MODULE, "/system/lib/");
402 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi ew/paks"); 402 PathService.override(DIR_RESOURCE_PAKS_ANDROID, "/system/framework/webvi ew/paks");
403 403
404 final Context context = ContextUtils.getApplicationContext();
405 // Future calls to PlatformServiceBridge.getInstance() rely on it having been created here.
406 PlatformServiceBridge.getOrCreateInstance();
407
408 // Make sure that ResourceProvider is initialized before starting the br owser process. 404 // Make sure that ResourceProvider is initialized before starting the br owser process.
409 final PackageInfo webViewPackageInfo = WebViewFactory.getLoadedPackageIn fo(); 405 final PackageInfo webViewPackageInfo = WebViewFactory.getLoadedPackageIn fo();
410 final String webViewPackageName = webViewPackageInfo.packageName; 406 final String webViewPackageName = webViewPackageInfo.packageName;
407 final Context context = ContextUtils.getApplicationContext();
411 setUpResources(webViewPackageInfo, context); 408 setUpResources(webViewPackageInfo, context);
412 initPlatSupportLibrary(); 409 initPlatSupportLibrary();
413 doNetworkInitializations(context); 410 doNetworkInitializations(context);
414 final boolean isExternalService = true; 411 final boolean isExternalService = true;
415 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, isExt ernalService); 412 AwBrowserProcess.configureChildProcessLauncher(webViewPackageName, isExt ernalService);
416 AwBrowserProcess.start(); 413 AwBrowserProcess.start();
417 414
418 final boolean enableMinidumpUploadingForTesting = CommandLine.getInstanc e().hasSwitch( 415 final boolean enableMinidumpUploadingForTesting = CommandLine.getInstanc e().hasSwitch(
419 CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH); 416 CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH);
420 if (enableMinidumpUploadingForTesting) { 417 if (enableMinidumpUploadingForTesting) {
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 WebViewDelegate getWebViewDelegate() { 689 WebViewDelegate getWebViewDelegate() {
693 return mWebViewDelegate; 690 return mWebViewDelegate;
694 } 691 }
695 692
696 // The method to support unreleased Android. 693 // The method to support unreleased Android.
697 WebViewContentsClientAdapter createWebViewContentsClientAdapter(WebView webV iew, 694 WebViewContentsClientAdapter createWebViewContentsClientAdapter(WebView webV iew,
698 Context context) { 695 Context context) {
699 return new WebViewContentsClientAdapter(webView, context, mWebViewDelega te); 696 return new WebViewContentsClientAdapter(webView, context, mWebViewDelega te);
700 } 697 }
701 } 698 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698