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

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

Issue 907723004: Revert of [WebView] Add unique visual state request ids. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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,
1041 bool result) { 1040 bool result) {
1042 JNIEnv* env = AttachCurrentThread(); 1041 JNIEnv* env = AttachCurrentThread();
1043 ScopedJavaLocalRef<jobject> obj = java_ref.get(env); 1042 ScopedJavaLocalRef<jobject> obj = java_ref.get(env);
1044 if (obj.is_null()) 1043 if (obj.is_null())
1045 return; 1044 return;
1046 Java_AwContents_flushVisualStateCallback(env, obj.obj(), callback->obj(), 1045 Java_AwContents_flushVisualStateCallback(
1047 request_id, result); 1046 env, obj.obj(), callback->obj(), result);
1048 } 1047 }
1049 } // namespace 1048 } // namespace
1050 1049
1051 void AwContents::FlushVisualState(JNIEnv* env, 1050 void AwContents::FlushVisualState(JNIEnv* env, jobject obj, jobject callback) {
1052 jobject obj,
1053 jobject callback,
1054 int64 request_id) {
1055 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1051 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1056 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); 1052 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>();
1057 j_callback->Reset(env, callback); 1053 j_callback->Reset(env, callback);
1058 web_contents_->GetMainFrame()->FlushVisualState( 1054 web_contents_->GetMainFrame()->FlushVisualState(base::Bind(
1059 base::Bind(&FlushVisualStateCallback, java_ref_, base::Owned(j_callback), 1055 &FlushVisualStateCallback, java_ref_, base::Owned(j_callback)));
1060 request_id));
1061 } 1056 }
1062 1057
1063 void AwContents::ClearView(JNIEnv* env, jobject obj) { 1058 void AwContents::ClearView(JNIEnv* env, jobject obj) {
1064 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1059 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1065 browser_view_renderer_.ClearView(); 1060 browser_view_renderer_.ClearView();
1066 } 1061 }
1067 1062
1068 void AwContents::SetExtraHeadersForUrl(JNIEnv* env, jobject obj, 1063 void AwContents::SetExtraHeadersForUrl(JNIEnv* env, jobject obj,
1069 jstring url, jstring jextra_headers) { 1064 jstring url, jstring jextra_headers) {
1070 std::string extra_headers; 1065 std::string extra_headers;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 1133
1139 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, callback, 1134 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, callback,
1140 GetMessagePortMessageFilter()); 1135 GetMessagePortMessageFilter());
1141 } 1136 }
1142 1137
1143 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 1138 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
1144 g_should_download_favicons = true; 1139 g_should_download_favicons = true;
1145 } 1140 }
1146 1141
1147 } // namespace android_webview 1142 } // 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