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

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 900303002: [WebView] Add unique visual state request ids. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix weird ident Created 5 years, 10 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
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 void AwContents::EnableOnNewPicture(JNIEnv* env, 1030 void AwContents::EnableOnNewPicture(JNIEnv* env,
1031 jobject obj, 1031 jobject obj,
1032 jboolean enabled) { 1032 jboolean enabled) {
1033 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1033 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1034 browser_view_renderer_.EnableOnNewPicture(enabled); 1034 browser_view_renderer_.EnableOnNewPicture(enabled);
1035 } 1035 }
1036 1036
1037 namespace { 1037 namespace {
1038 void FlushVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref, 1038 void FlushVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref,
1039 ScopedJavaGlobalRef<jobject>* callback, 1039 ScopedJavaGlobalRef<jobject>* callback,
1040 int64 request_id,
1040 bool result) { 1041 bool result) {
1041 JNIEnv* env = AttachCurrentThread(); 1042 JNIEnv* env = AttachCurrentThread();
1042 ScopedJavaLocalRef<jobject> obj = java_ref.get(env); 1043 ScopedJavaLocalRef<jobject> obj = java_ref.get(env);
1043 if (obj.is_null()) 1044 if (obj.is_null())
1044 return; 1045 return;
1045 Java_AwContents_flushVisualStateCallback( 1046 Java_AwContents_flushVisualStateCallback(
1046 env, obj.obj(), callback->obj(), result); 1047 env, obj.obj(), callback->obj(), request_id, result);
1047 } 1048 }
1048 } // namespace 1049 } // namespace
1049 1050
1050 void AwContents::FlushVisualState(JNIEnv* env, jobject obj, jobject callback) { 1051 void AwContents::FlushVisualState(
1052 JNIEnv* env, jobject obj, jobject callback, int64 request_id) {
1051 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1053 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1052 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); 1054 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>();
1053 j_callback->Reset(env, callback); 1055 j_callback->Reset(env, callback);
1054 web_contents_->GetMainFrame()->FlushVisualState(base::Bind( 1056 web_contents_->GetMainFrame()->FlushVisualState(base::Bind(
1055 &FlushVisualStateCallback, java_ref_, base::Owned(j_callback))); 1057 &FlushVisualStateCallback, java_ref_, base::Owned(j_callback),
1058 request_id));
boliu 2015/02/06 02:05:13 uber-nit: clang-format this? somehow doesn't look
Ignacio Solla 2015/02/09 11:35:26 Done.
1056 } 1059 }
1057 1060
1058 void AwContents::ClearView(JNIEnv* env, jobject obj) { 1061 void AwContents::ClearView(JNIEnv* env, jobject obj) {
1059 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1062 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1060 browser_view_renderer_.ClearView(); 1063 browser_view_renderer_.ClearView();
1061 } 1064 }
1062 1065
1063 void AwContents::SetExtraHeadersForUrl(JNIEnv* env, jobject obj, 1066 void AwContents::SetExtraHeadersForUrl(JNIEnv* env, jobject obj,
1064 jstring url, jstring jextra_headers) { 1067 jstring url, jstring jextra_headers) {
1065 std::string extra_headers; 1068 std::string extra_headers;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 1136
1134 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, callback, 1137 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, callback,
1135 GetMessagePortMessageFilter()); 1138 GetMessagePortMessageFilter());
1136 } 1139 }
1137 1140
1138 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 1141 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
1139 g_should_download_favicons = true; 1142 g_should_download_favicons = true;
1140 } 1143 }
1141 1144
1142 } // namespace android_webview 1145 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698