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

Unified Diff: android_webview/native/aw_contents.cc

Issue 11971007: Pass ScopedJavaGlobalRef to bind() by value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avi comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 479c70d11db53419de891dd6ded8524820fcbf08..28f6f18f60a53e9b2830449f39eee84aeee3c10a 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -551,21 +551,19 @@ jint GetAwDrawGLFunction(JNIEnv* env, jclass) {
}
namespace {
-// |message| is passed as base::Owned, so it will automatically be deleted
-// when the callback goes out of scope.
-void DocumentHasImagesCallback(ScopedJavaGlobalRef<jobject>* message,
+void DocumentHasImagesCallback(const ScopedJavaGlobalRef<jobject>& message,
bool has_images) {
Java_AwContents_onDocumentHasImagesResponse(AttachCurrentThread(),
has_images,
- message->obj());
+ message.obj());
}
} // namespace
void AwContents::DocumentHasImages(JNIEnv* env, jobject obj, jobject message) {
- ScopedJavaGlobalRef<jobject>* j_message = new ScopedJavaGlobalRef<jobject>();
- j_message->Reset(env, message);
+ ScopedJavaGlobalRef<jobject> j_message;
+ j_message.Reset(env, message);
render_view_host_ext_->DocumentHasImages(
- base::Bind(&DocumentHasImagesCallback, base::Owned(j_message)));
+ base::Bind(&DocumentHasImagesCallback, j_message));
}
namespace {
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698