diff options
author | igsolla <igsolla@chromium.org> | 2015-02-10 10:58:01 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-10 18:58:36 +0000 |
commit | 2bf604e91ac204971a97a4a44830b6cf8321b4c9 (patch) | |
tree | 71934e06b45b53c0264aea2e570f5e333a620d29 /android_webview/native | |
parent | 7e8633601db481ff07c4722efe09ec46a722cb9b (diff) | |
download | chromium_src-2bf604e91ac204971a97a4a44830b6cf8321b4c9.zip chromium_src-2bf604e91ac204971a97a4a44830b6cf8321b4c9.tar.gz chromium_src-2bf604e91ac204971a97a4a44830b6cf8321b4c9.tar.bz2 |
[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}
Diffstat (limited to 'android_webview/native')
-rw-r--r-- | android_webview/native/aw_contents.cc | 11 | ||||
-rw-r--r-- | android_webview/native/aw_contents.h | 5 |
2 files changed, 11 insertions, 5 deletions
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<jobject>* 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<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); 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) { diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h index 077690f..754eece 100644 --- a/android_webview/native/aw_contents.h +++ b/android_webview/native/aw_contents.h @@ -129,7 +129,10 @@ class AwContents : public FindHelper::Listener, jlong GetAwDrawGLViewContext(JNIEnv* env, jobject obj); jlong CapturePicture(JNIEnv* env, jobject obj, int width, int height); void EnableOnNewPicture(JNIEnv* env, jobject obj, jboolean enabled); - void FlushVisualState(JNIEnv* env, jobject obj, jobject callback); + void FlushVisualState(JNIEnv* env, + jobject obj, + long request_id, + jobject callback); void ClearView(JNIEnv* env, jobject obj); void SetExtraHeadersForUrl(JNIEnv* env, jobject obj, jstring url, jstring extra_headers); |