From 2bf604e91ac204971a97a4a44830b6cf8321b4c9 Mon Sep 17 00:00:00 2001 From: igsolla Date: Tue, 10 Feb 2015 10:58:01 -0800 Subject: [WebView] Add a request id param to the flushVisualState API. The request id will allow callers to match requests with callbacks. BUG=457184 Review URL: https://codereview.chromium.org/911893002 Cr-Commit-Position: refs/heads/master@{#315603} --- android_webview/native/aw_contents.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'android_webview/native/aw_contents.cc') diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc index 6c468f6..7d55111 100644 --- a/android_webview/native/aw_contents.cc +++ b/android_webview/native/aw_contents.cc @@ -1036,6 +1036,7 @@ void AwContents::EnableOnNewPicture(JNIEnv* env, namespace { void FlushVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref, + long request_id, ScopedJavaGlobalRef* callback, bool result) { JNIEnv* env = AttachCurrentThread(); @@ -1043,16 +1044,18 @@ void FlushVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref, if (obj.is_null()) return; Java_AwContents_flushVisualStateCallback( - env, obj.obj(), callback->obj(), result); + env, obj.obj(), callback->obj(), request_id, result); } } // namespace -void AwContents::FlushVisualState(JNIEnv* env, jobject obj, jobject callback) { +void AwContents::FlushVisualState( + JNIEnv* env, jobject obj, long request_id, jobject callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); ScopedJavaGlobalRef* j_callback = new ScopedJavaGlobalRef(); j_callback->Reset(env, callback); - web_contents_->GetMainFrame()->FlushVisualState(base::Bind( - &FlushVisualStateCallback, java_ref_, base::Owned(j_callback))); + web_contents_->GetMainFrame()->FlushVisualState( + base::Bind(&FlushVisualStateCallback, java_ref_, request_id, + base::Owned(j_callback))); } void AwContents::ClearView(JNIEnv* env, jobject obj) { -- cgit v1.1