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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't use metadata to stash IPC messages Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 4f142196134dec46b971edc1b5ebaaa9435115eb..ab22880d6fc122943e4e2eceedaa2b4b75500c1c 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -51,6 +51,7 @@ import org.chromium.content.browser.ContentViewStatics;
import org.chromium.content.browser.LoadUrlParams;
import org.chromium.content.browser.NavigationHistory;
import org.chromium.content.browser.PageTransitionTypes;
+import org.chromium.content.browser.WebContentsObserverAndroid;
import org.chromium.content.common.CleanupReference;
import org.chromium.content_public.Referrer;
import org.chromium.content_public.browser.GestureStateListener;
@@ -202,6 +203,7 @@ public class AwContents {
// Bound method for suppling Picture instances to the AwContentsClient. Will be null if the
// picture listener API has not yet been enabled, or if it is using invalidation-only mode.
private Callable<Picture> mPictureListenerContentProvider;
+ private boolean mDoDraw;
private boolean mContainerViewFocused;
private boolean mWindowFocused;
@@ -545,6 +547,8 @@ public class AwContents {
return contentViewCore;
}
+ private WebContentsObserverAndroid mWebContentsObserver;
+
/**
* Common initialization routine for adopting a native AwContents instance into this
* java instance.
@@ -575,6 +579,13 @@ public class AwContents {
new AwGestureStateListener(), mContentViewClient, mZoomControls);
nativeSetJavaPeers(mNativeAwContents, this, mWebContentsDelegate, mContentsClientBridge,
mIoThreadClient, mInterceptNavigationDelegate);
+ mWebContentsObserver = new WebContentsObserverAndroid(mContentViewCore) {
+ @Override
+ public void didFirstVisuallyNonEmptyPaint() {
+ mDoDraw = true;
+ mContainerView.invalidate();
+ }
+ };
mContentsClient.installWebContentsObserver(mContentViewCore);
mSettings.setWebContents(nativeWebContents);
nativeSetDipScale(mNativeAwContents, (float) mDIPScale);
@@ -769,6 +780,9 @@ public class AwContents {
canvas.drawColor(getEffectiveBackgroundColor());
}
+ if (!mDoDraw)
+ canvas.drawColor(0x88aaaaaa, android.graphics.PorterDuff.Mode.XOR);
+
if (mOverScrollGlow != null && mOverScrollGlow.drawEdgeGlows(canvas,
mScrollOffsetManager.computeMaximumHorizontalScrollOffset(),
mScrollOffsetManager.computeMaximumVerticalScrollOffset())) {
@@ -871,6 +885,8 @@ public class AwContents {
* @param params Parameters for this load.
*/
public void loadUrl(LoadUrlParams params) {
+ mDoDraw = false;
+
if (params.getLoadUrlType() == LoadUrlParams.LOAD_TYPE_DATA &&
!params.isBaseUrlDataScheme()) {
// This allows data URLs with a non-data base URL access to file:///android_asset/ and

Powered by Google App Engine
This is Rietveld 408576698