| OLD | NEW |
| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 import org.chromium.base.ContextUtils; | 52 import org.chromium.base.ContextUtils; |
| 53 import org.chromium.base.MemoryPressureListener; | 53 import org.chromium.base.MemoryPressureListener; |
| 54 import org.chromium.base.PackageUtils; | 54 import org.chromium.base.PackageUtils; |
| 55 import org.chromium.base.PathService; | 55 import org.chromium.base.PathService; |
| 56 import org.chromium.base.PathUtils; | 56 import org.chromium.base.PathUtils; |
| 57 import org.chromium.base.ThreadUtils; | 57 import org.chromium.base.ThreadUtils; |
| 58 import org.chromium.base.TraceEvent; | 58 import org.chromium.base.TraceEvent; |
| 59 import org.chromium.base.annotations.SuppressFBWarnings; | 59 import org.chromium.base.annotations.SuppressFBWarnings; |
| 60 import org.chromium.base.library_loader.LibraryLoader; | 60 import org.chromium.base.library_loader.LibraryLoader; |
| 61 import org.chromium.base.library_loader.LibraryProcessType; | 61 import org.chromium.base.library_loader.LibraryProcessType; |
| 62 import org.chromium.base.library_loader.NativeLibraries; |
| 62 import org.chromium.base.library_loader.ProcessInitException; | 63 import org.chromium.base.library_loader.ProcessInitException; |
| 63 import org.chromium.content.browser.ContentViewStatics; | 64 import org.chromium.content.browser.ContentViewStatics; |
| 64 import org.chromium.net.NetworkChangeNotifier; | 65 import org.chromium.net.NetworkChangeNotifier; |
| 65 import org.chromium.ui.base.ResourceBundle; | 66 import org.chromium.ui.base.ResourceBundle; |
| 66 | 67 |
| 67 import java.io.File; | 68 import java.io.File; |
| 68 import java.util.Queue; | 69 import java.util.Queue; |
| 69 import java.util.concurrent.Callable; | 70 import java.util.concurrent.Callable; |
| 70 import java.util.concurrent.ConcurrentLinkedQueue; | 71 import java.util.concurrent.ConcurrentLinkedQueue; |
| 71 import java.util.concurrent.FutureTask; | 72 import java.util.concurrent.FutureTask; |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (file.isDirectory()) { | 303 if (file.isDirectory()) { |
| 303 deleteContents(file); | 304 deleteContents(file); |
| 304 } | 305 } |
| 305 if (!file.delete()) { | 306 if (!file.delete()) { |
| 306 Log.w(TAG, "Failed to delete " + file); | 307 Log.w(TAG, "Failed to delete " + file); |
| 307 } | 308 } |
| 308 } | 309 } |
| 309 } | 310 } |
| 310 } | 311 } |
| 311 | 312 |
| 313 public static boolean preloadInZygote() { |
| 314 for (String library : NativeLibraries.LIBRARIES) { |
| 315 System.loadLibrary(library); |
| 316 } |
| 317 return true; |
| 318 } |
| 319 |
| 312 private void initPlatSupportLibrary() { | 320 private void initPlatSupportLibrary() { |
| 313 DrawGLFunctor.setChromiumAwDrawGLFunction(AwContents.getAwDrawGLFunction
()); | 321 DrawGLFunctor.setChromiumAwDrawGLFunction(AwContents.getAwDrawGLFunction
()); |
| 314 AwContents.setAwDrawSWFunctionTable(GraphicsUtils.getDrawSWFunctionTable
()); | 322 AwContents.setAwDrawSWFunctionTable(GraphicsUtils.getDrawSWFunctionTable
()); |
| 315 AwContents.setAwDrawGLFunctionTable(GraphicsUtils.getDrawGLFunctionTable
()); | 323 AwContents.setAwDrawGLFunctionTable(GraphicsUtils.getDrawGLFunctionTable
()); |
| 316 } | 324 } |
| 317 | 325 |
| 318 private void initNetworkChangeNotifier(Context applicationContext) { | 326 private void initNetworkChangeNotifier(Context applicationContext) { |
| 319 if (applicationContext.checkPermission(Manifest.permission.ACCESS_NETWOR
K_STATE, | 327 if (applicationContext.checkPermission(Manifest.permission.ACCESS_NETWOR
K_STATE, |
| 320 Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_G
RANTED) { | 328 Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_G
RANTED) { |
| 321 NetworkChangeNotifier.init(applicationContext); | 329 NetworkChangeNotifier.init(applicationContext); |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 this, HttpAuthDatabase.newInstance(context, HTTP_AUTH_DA
TABASE_FILE)); | 640 this, HttpAuthDatabase.newInstance(context, HTTP_AUTH_DA
TABASE_FILE)); |
| 633 } | 641 } |
| 634 } | 642 } |
| 635 return mWebViewDatabase; | 643 return mWebViewDatabase; |
| 636 } | 644 } |
| 637 | 645 |
| 638 WebViewDelegate getWebViewDelegate() { | 646 WebViewDelegate getWebViewDelegate() { |
| 639 return mWebViewDelegate; | 647 return mWebViewDelegate; |
| 640 } | 648 } |
| 641 } | 649 } |
| OLD | NEW |