0

Do not cast Visual State Callback request_id argument to long.

The request id is a Java long, and casting to C++ long loses
precision.

BUG=534864

Review URL: https://codereview.chromium.org/1348473003

Cr-Commit-Position: refs/heads/master@{#350210}
This commit is contained in:
tobiasjs
2015-09-22 12:19:57 -07:00
committed by Commit bot
parent b7a9927873
commit 63b8ddb9d1
3 changed files with 4 additions and 4 deletions
android_webview
javatests
src
org
chromium
android_webview
native

@ -121,7 +121,7 @@ public class VisualStateTest extends AwTestBase {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
final long requestId = 20;
final long requestId = 0x123456789abcdef0L; // ensure requestId is not truncated.
awContents.insertVisualStateCallback(requestId,
new AwContents.VisualStateCallback() {
@Override

@ -1107,7 +1107,7 @@ void AwContents::EnableOnNewPicture(JNIEnv* env,
namespace {
void InvokeVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref,
long request_id,
jlong request_id,
ScopedJavaGlobalRef<jobject>* callback,
bool result) {
JNIEnv* env = AttachCurrentThread();
@ -1120,7 +1120,7 @@ void InvokeVisualStateCallback(const JavaObjectWeakGlobalRef& java_ref,
} // namespace
void AwContents::InsertVisualStateCallback(
JNIEnv* env, jobject obj, long request_id, jobject callback) {
JNIEnv* env, jobject obj, jlong request_id, jobject callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>();
j_callback->Reset(env, callback);

@ -136,7 +136,7 @@ class AwContents : public FindHelper::Listener,
void EnableOnNewPicture(JNIEnv* env, jobject obj, jboolean enabled);
void InsertVisualStateCallback(JNIEnv* env,
jobject obj,
long request_id,
jlong request_id,
jobject callback);
void ClearView(JNIEnv* env, jobject obj);
void SetExtraHeadersForUrl(JNIEnv* env, jobject obj,