From a329f6b47075066d779fe3b020d971cd66a3bf5f Mon Sep 17 00:00:00 2001 From: Primiano Tucci Date: Mon, 27 Oct 2014 18:24:26 +0000 Subject: Enable minimalistic crash handler for WebView. This complements crrev.com/678763005. It enables the handler that dumps out the WebView version in logcat in the case of a crash. The previous handlers are chained and reinstalled after the print. Change-Id: I2068d7925bb73c95cf0b5471936aa728280e1588 --- .../webview/chromium/WebViewChromiumFactoryProvider.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'chromium/java/com/android/webview') diff --git a/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java index 1b10971..9f9c3aa 100644 --- a/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java +++ b/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java @@ -16,6 +16,7 @@ package com.android.webview.chromium; +import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.res.Resources; import android.app.ActivityManager; @@ -122,6 +123,13 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "AwBrowserProcess.loadLibrary()"); AwBrowserProcess.loadLibrary(); Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW); + + final PackageInfo packageInfo = WebViewFactory.getLoadedPackageInfo(); + + // Register the handler that will append the WebView version to logcat in case of a crash. + AwContentsStatics.registerCrashHandler( + "Version " + packageInfo.versionName + " (code " + packageInfo.versionCode + ")"); + // Load glue-layer support library. System.loadLibrary("webviewchromium_plat_support"); @@ -129,7 +137,7 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { mWebViewPrefs = ActivityThread.currentApplication().getSharedPreferences( CHROMIUM_PREFS_NAME, Context.MODE_PRIVATE); int lastVersion = mWebViewPrefs.getInt(VERSION_CODE_PREF, 0); - int currentVersion = WebViewFactory.getLoadedPackageInfo().versionCode; + int currentVersion = packageInfo.versionCode; if (lastVersion > currentVersion) { // The WebView package has been downgraded since we last ran in this application. // Delete the WebView data directory's contents. -- cgit v1.2.3 From a77ae8970e35025840112942522e4521716c5422 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 28 Oct 2014 11:41:40 +0000 Subject: Always add the path to the WebView assets. Bug: 18133926 Change-Id: I33ae4101fd6865df057e365b6f33aef0ef9fd272 (cherry picked from commit ddbcc0351201dc71b48252573b37da33deba1a83) --- chromium/java/com/android/webview/chromium/WebViewChromium.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'chromium/java/com/android/webview') diff --git a/chromium/java/com/android/webview/chromium/WebViewChromium.java b/chromium/java/com/android/webview/chromium/WebViewChromium.java index a5b31b3..a8b6fb5 100644 --- a/chromium/java/com/android/webview/chromium/WebViewChromium.java +++ b/chromium/java/com/android/webview/chromium/WebViewChromium.java @@ -58,6 +58,7 @@ import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.webkit.WebViewFactory; import android.webkit.WebViewProvider; import android.webkit.WebChromeClient.CustomViewCallback; import android.widget.TextView; @@ -165,6 +166,8 @@ class WebViewChromium implements WebViewProvider, mAppTargetSdkVersion = mWebView.getContext().getApplicationInfo().targetSdkVersion; mFactory = factory; mRunQueue = new WebViewChromiumRunQueue(); + String webViewAssetPath = WebViewFactory.getLoadedPackageInfo().applicationInfo.sourceDir; + mWebView.getContext().getAssets().addAssetPath(webViewAssetPath); } static void completeWindowCreation(WebView parent, WebView child) { -- cgit v1.2.3 From 0c24beba16b0d27ff66ebbd5d8757a60d87ecd67 Mon Sep 17 00:00:00 2001 From: Ignacio Solla Date: Tue, 28 Oct 2014 16:41:55 +0000 Subject: [WebView] Remove dependency on WEBVIEW_DATA_REDUCTION_PROXY. BUG:18152150 Change-Id: Ie1f09273de1f18bdd587020cd77f914e727af9c9 --- .../com/android/webview/chromium/DataReductionProxyManager.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'chromium/java/com/android/webview') diff --git a/chromium/java/com/android/webview/chromium/DataReductionProxyManager.java b/chromium/java/com/android/webview/chromium/DataReductionProxyManager.java index 32006bf..aafd41e 100644 --- a/chromium/java/com/android/webview/chromium/DataReductionProxyManager.java +++ b/chromium/java/com/android/webview/chromium/DataReductionProxyManager.java @@ -170,14 +170,8 @@ public final class DataReductionProxyManager { } private static boolean isDataReductionProxyEnabled(Context context) { - boolean enabled = getProxySetting(context.getContentResolver(), + return getProxySetting(context.getContentResolver(), WEBVIEW_DATA_REDUCTION_PROXY) != 0; - // intentional fallback. remove before L release. - if (!enabled) { - enabled = Settings.Secure.getInt(context.getContentResolver(), - Settings.Secure.WEBVIEW_DATA_REDUCTION_PROXY, 0) != 0; - } - return enabled; } // Read query setting from GoogleSettings. -- cgit v1.2.3 From 81fb32c83e2964edaae128bf752c03c4bef8cd26 Mon Sep 17 00:00:00 2001 From: Hui Shu Date: Mon, 3 Nov 2014 17:07:17 -0800 Subject: Fix RequestDrawGL logic. We're not supposed to request a blocking DrawGL with a not null canvas. Just throw an exception in this case. Change-Id: I452e781577ab1040d06acfcba1d03646bab00fa4 --- chromium/java/com/android/webview/chromium/DrawGLFunctor.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'chromium/java/com/android/webview') diff --git a/chromium/java/com/android/webview/chromium/DrawGLFunctor.java b/chromium/java/com/android/webview/chromium/DrawGLFunctor.java index 7f7adeb..265bfd0 100644 --- a/chromium/java/com/android/webview/chromium/DrawGLFunctor.java +++ b/chromium/java/com/android/webview/chromium/DrawGLFunctor.java @@ -58,6 +58,11 @@ class DrawGLFunctor { if (mDestroyRunnable.mNativeDrawGLFunctor == 0) { throw new RuntimeException("requested DrawGL on already destroyed DrawGLFunctor"); } + + if (canvas != null && waitForCompletion) { + throw new IllegalArgumentException("requested a blocking DrawGL with a not null canvas."); + } + if (viewRootImpl == null) { // Can happen during teardown when window is leaked. return false; @@ -70,10 +75,6 @@ class DrawGLFunctor { } canvas.callDrawGLFunction(mDestroyRunnable.mNativeDrawGLFunctor); - if (waitForCompletion) { - viewRootImpl.invokeFunctor(mDestroyRunnable.mNativeDrawGLFunctor, - waitForCompletion); - } return true; } -- cgit v1.2.3