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

Unified Diff: chrome/renderer/extensions/messaging_bindings.cc

Issue 23636015: Remove unsafe access hacks from ScopedPersistent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: code review (jyasskin)' Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/messaging_bindings.cc
diff --git a/chrome/renderer/extensions/messaging_bindings.cc b/chrome/renderer/extensions/messaging_bindings.cc
index c7660dd3aadf6a6b5e5c07cb5822b33169e3c7fb..153593cef71f34e99fba55ebca36d0e6180e4745 100644
--- a/chrome/renderer/extensions/messaging_bindings.cc
+++ b/chrome/renderer/extensions/messaging_bindings.cc
@@ -192,12 +192,13 @@ class ExtensionImpl : public extensions::ChromeV8Extension {
void RunCallback() {
v8::HandleScope handle_scope(isolate_);
- v8::Handle<v8::Context> context = callback_->CreationContext();
+ v8::Handle<v8::Function> callback = callback_.NewHandle(isolate_);
+ v8::Handle<v8::Context> context = callback->CreationContext();
if (context.IsEmpty())
return;
v8::Context::Scope context_scope(context);
WebKit::WebScopedMicrotaskSuppression suppression;
- callback_->Call(context->Global(), 0, NULL);
+ callback->Call(context->Global(), 0, NULL);
}
extensions::ScopedPersistent<v8::Object> object_;
« no previous file with comments | « chrome/renderer/extensions/chrome_v8_context.cc ('k') | chrome/renderer/extensions/object_backed_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698