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

Side by Side Diff: ui/android/java/src/org/chromium/ui/base/WindowAndroid.java

Issue 457913002: Android WebView: flush input events during onVSync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert to PS3 Created 6 years, 4 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 org.chromium.ui.base; 5 package org.chromium.ui.base;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.app.PendingIntent; 9 import android.app.PendingIntent;
10 import android.content.ContentResolver; 10 import android.content.ContentResolver;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 private final VSyncMonitor.Listener mVSyncListener = new VSyncMonitor.Listen er() { 50 private final VSyncMonitor.Listener mVSyncListener = new VSyncMonitor.Listen er() {
51 @Override 51 @Override
52 public void onVSync(VSyncMonitor monitor, long vsyncTimeMicros) { 52 public void onVSync(VSyncMonitor monitor, long vsyncTimeMicros) {
53 if (mNativeWindowAndroid != 0) { 53 if (mNativeWindowAndroid != 0) {
54 nativeOnVSync(mNativeWindowAndroid, vsyncTimeMicros); 54 nativeOnVSync(mNativeWindowAndroid, vsyncTimeMicros);
55 } 55 }
56 } 56 }
57 }; 57 };
58 58
59 /** 59 /**
60 * @return true if onVSync handler is executing.
61 * @see org.chromium.ui.VSyncMonitor#isInsideVSync().
62 */
63 public boolean isInsideVSync() {
64 return mVSyncMonitor.isInsideVSync();
65 }
66
67 /**
60 * @param context The application context. 68 * @param context The application context.
61 */ 69 */
62 @SuppressLint("UseSparseArrays") 70 @SuppressLint("UseSparseArrays")
63 public WindowAndroid(Context context) { 71 public WindowAndroid(Context context) {
64 assert context == context.getApplicationContext(); 72 assert context == context.getApplicationContext();
65 mApplicationContext = context; 73 mApplicationContext = context;
66 mOutstandingIntents = new SparseArray<IntentCallback>(); 74 mOutstandingIntents = new SparseArray<IntentCallback>();
67 mIntentErrors = new HashMap<Integer, String>(); 75 mIntentErrors = new HashMap<Integer, String>();
68 mVSyncMonitor = new VSyncMonitor(context, mVSyncListener); 76 mVSyncMonitor = new VSyncMonitor(context, mVSyncListener);
69 } 77 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 mNativeWindowAndroid = nativeInit(mVSyncMonitor.getVSyncPeriodInMicr oseconds()); 285 mNativeWindowAndroid = nativeInit(mVSyncMonitor.getVSyncPeriodInMicr oseconds());
278 } 286 }
279 return mNativeWindowAndroid; 287 return mNativeWindowAndroid;
280 } 288 }
281 289
282 private native long nativeInit(long vsyncPeriod); 290 private native long nativeInit(long vsyncPeriod);
283 private native void nativeOnVSync(long nativeWindowAndroid, long vsyncTimeMi cros); 291 private native void nativeOnVSync(long nativeWindowAndroid, long vsyncTimeMi cros);
284 private native void nativeDestroy(long nativeWindowAndroid); 292 private native void nativeDestroy(long nativeWindowAndroid);
285 293
286 } 294 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698