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

Unified Diff: android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java

Issue 1943963003: WIP Handle AwContents needing multiple live functors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java b/android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java
index da0009eb9f184705d73b28f68d93883c2ebcad35..fc0513cf3074f8a07121c518612e4aaab9e09757 100644
--- a/android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java
+++ b/android_webview/test/shell/src/org/chromium/android_webview/test/AwTestContainerView.java
@@ -146,7 +146,6 @@ public class AwTestContainerView extends FrameLayout {
public void requestRender(long viewContext, Canvas canvas, boolean waitForCompletion) {
synchronized (mSyncLock) {
assert viewContext != 0;
- assert mViewContext == 0 || mViewContext == viewContext;
mViewContext = viewContext;
super.requestRender();
mFunctorAttached = true;
@@ -183,6 +182,7 @@ public class AwTestContainerView extends FrameLayout {
final boolean draw;
final boolean process;
final boolean waitForCompletion;
+ long viewContext = 0;
boliu 2016/05/05 14:09:35 you can follow the same pattern as above, final wi
Tobias Sargeant 2016/05/05 19:06:46 Done.
synchronized (mSyncLock) {
if (!mFunctorAttached) {
@@ -193,9 +193,9 @@ public class AwTestContainerView extends FrameLayout {
draw = mNeedsDrawGL;
process = mNeedsProcessGL;
waitForCompletion = mWaitForCompletion;
-
+ viewContext = mViewContext;
if (draw) {
- DrawGL.drawGL(mDrawGL, mViewContext, width, height, 0, 0, MODE_SYNC);
+ DrawGL.drawGL(mDrawGL, viewContext, width, height, 0, 0, MODE_SYNC);
mCommittedScrollX = mLastScrollX;
mCommittedScrollY = mLastScrollY;
}
@@ -206,11 +206,11 @@ public class AwTestContainerView extends FrameLayout {
}
}
if (process) {
- DrawGL.drawGL(mDrawGL, mViewContext, width, height, 0, 0, MODE_PROCESS);
+ DrawGL.drawGL(mDrawGL, viewContext, width, height, 0, 0, MODE_PROCESS);
}
if (process || draw) {
- DrawGL.drawGL(mDrawGL, mViewContext, width, height,
- mCommittedScrollX, mCommittedScrollY, MODE_DRAW);
+ DrawGL.drawGL(mDrawGL, viewContext, width, height, mCommittedScrollX,
boliu 2016/05/05 14:09:34 so mViewContext wasn't thread safe is mCommittedS
Tobias Sargeant 2016/05/05 19:06:46 The move to two functors/view contexts made it uns
boliu 2016/05/05 21:40:32 Oh good point. And mCommittedScrollX/Y are save b
+ mCommittedScrollY, MODE_DRAW);
}
if (waitForCompletion) {
« android_webview/browser/compositor_frame_consumer.h ('K') | « android_webview/native/aw_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698