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

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

Issue 1348473003: Do not cast Visual State Callback request_id argument to long. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 1100
1101 void AwContents::EnableOnNewPicture(JNIEnv* env, 1101 void AwContents::EnableOnNewPicture(JNIEnv* env,
1102 jobject obj, 1102 jobject obj,
1103 jboolean enabled) { 1103 jboolean enabled) {
1104 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1104 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1105 browser_view_renderer_.EnableOnNewPicture(enabled); 1105 browser_view_renderer_.EnableOnNewPicture(enabled);
1106 } 1106 }
1107 1107
1108 namespace { 1108 namespace {
1109 void InvokeVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref, 1109 void InvokeVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref,
1110 long request_id, 1110 jlong request_id,
1111 ScopedJavaGlobalRef<jobject>* callback, 1111 ScopedJavaGlobalRef<jobject>* callback,
1112 bool result) { 1112 bool result) {
1113 JNIEnv* env = AttachCurrentThread(); 1113 JNIEnv* env = AttachCurrentThread();
1114 ScopedJavaLocalRef<jobject> obj = java_ref.get(env); 1114 ScopedJavaLocalRef<jobject> obj = java_ref.get(env);
1115 if (obj.is_null()) 1115 if (obj.is_null())
1116 return; 1116 return;
1117 Java_AwContents_invokeVisualStateCallback( 1117 Java_AwContents_invokeVisualStateCallback(
1118 env, obj.obj(), callback->obj(), request_id); 1118 env, obj.obj(), callback->obj(), request_id);
1119 } 1119 }
1120 } // namespace 1120 } // namespace
1121 1121
1122 void AwContents::InsertVisualStateCallback( 1122 void AwContents::InsertVisualStateCallback(
1123 JNIEnv* env, jobject obj, long request_id, jobject callback) { 1123 JNIEnv* env, jobject obj, jlong request_id, jobject callback) {
1124 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1124 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1125 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>(); 1125 ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>();
1126 j_callback->Reset(env, callback); 1126 j_callback->Reset(env, callback);
1127 web_contents_->GetMainFrame()->InsertVisualStateCallback( 1127 web_contents_->GetMainFrame()->InsertVisualStateCallback(
1128 base::Bind(&InvokeVisualStateCallback, java_ref_, request_id, 1128 base::Bind(&InvokeVisualStateCallback, java_ref_, request_id,
1129 base::Owned(j_callback))); 1129 base::Owned(j_callback)));
1130 } 1130 }
1131 1131
1132 void AwContents::ClearView(JNIEnv* env, jobject obj) { 1132 void AwContents::ClearView(JNIEnv* env, jobject obj) {
1133 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1133 DCHECK_CURRENTLY_ON(BrowserThread::UI);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 1216 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
1217 web_contents_->GetRenderProcessHost()->GetID(), url::kFileScheme); 1217 web_contents_->GetRenderProcessHost()->GetID(), url::kFileScheme);
1218 } 1218 }
1219 1219
1220 void SetShouldDownloadFavicons(JNIEnv* env, 1220 void SetShouldDownloadFavicons(JNIEnv* env,
1221 const JavaParamRef<jclass>& jclazz) { 1221 const JavaParamRef<jclass>& jclazz) {
1222 g_should_download_favicons = true; 1222 g_should_download_favicons = true;
1223 } 1223 }
1224 1224
1225 } // namespace android_webview 1225 } // 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