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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 11971007: Pass ScopedJavaGlobalRef to bind() by value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 | « android_webview/native/aw_contents.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index e8a0b3a2101e373d36443c8bc89f226ec387ca5e..a8e73b138c67e4190a999a162baaa7826b78c133 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1236,7 +1236,7 @@ void ContentViewCoreImpl::UndoScrollFocusedEditableNodeIntoView(
}
namespace {
-void JavaScriptResultCallback(ScopedJavaGlobalRef<jobject>* callback,
+void JavaScriptResultCallback(const ScopedJavaGlobalRef<jobject>& callback,
const base::Value* result) {
// |callback| is passed as base::Owned, so it will automatically be deleted
// when this base::Callback goes out of scope.
Avi (use Gerrit) 2013/01/22 02:21:41 You deleted this comment in the other file, and it
joth 2013/02/05 00:30:30 Done.
@@ -1246,7 +1246,7 @@ void JavaScriptResultCallback(ScopedJavaGlobalRef<jobject>* callback,
ScopedJavaLocalRef<jstring> j_json = ConvertUTF8ToJavaString(env, json);
Java_ContentViewCore_onEvaluateJavaScriptResult(env,
j_json.obj(),
- callback->obj());
+ callback.obj());
}
} // namespace
@@ -1266,10 +1266,10 @@ void ContentViewCoreImpl::EvaluateJavaScript(JNIEnv* env,
// Secure the Java callback in a scoped object and give ownership of it to the
// base::Callback.
- ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>();
- j_callback->Reset(env, callback);
+ ScopedJavaGlobalRef<jobject> j_callback;
+ j_callback.Reset(env, callback);
content::RenderViewHost::JavascriptResultCallback c_callback =
- base::Bind(&JavaScriptResultCallback, base::Owned(j_callback));
+ base::Bind(&JavaScriptResultCallback, j_callback);
host->ExecuteJavascriptInWebFrameCallbackResult(
string16(), // frame_xpath
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698