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

Unified Diff: extensions/renderer/render_view_observer_natives.cc

Issue 983793003: Replace extensions::ScopedPersistent with v8::UniquePersistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « extensions/renderer/object_backed_native_handler.cc ('k') | extensions/renderer/scoped_persistent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/render_view_observer_natives.cc
diff --git a/extensions/renderer/render_view_observer_natives.cc b/extensions/renderer/render_view_observer_natives.cc
index 19a3974c1b8ad1743f77bbfd4061dd5fe139b5e9..c618eeff2ccf4532e216fdb9b34ae66047610cb5 100644
--- a/extensions/renderer/render_view_observer_natives.cc
+++ b/extensions/renderer/render_view_observer_natives.cc
@@ -21,7 +21,9 @@ class LoadWatcher : public content::RenderViewObserver {
LoadWatcher(ScriptContext* context,
content::RenderView* view,
v8::Handle<v8::Function> cb)
- : content::RenderViewObserver(view), context_(context), callback_(cb) {}
+ : content::RenderViewObserver(view),
+ context_(context),
+ callback_(context->isolate(), cb) {}
void DidCreateDocumentElement(blink::WebLocalFrame* frame) override {
CallbackAndDie(true);
@@ -37,12 +39,13 @@ class LoadWatcher : public content::RenderViewObserver {
v8::Isolate* isolate = context_->isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> args[] = {v8::Boolean::New(isolate, succeeded)};
- context_->CallFunction(callback_.NewHandle(isolate), 1, args);
+ context_->CallFunction(v8::Local<v8::Function>::New(isolate, callback_),
+ arraysize(args), args);
delete this;
}
ScriptContext* context_;
- ScopedPersistent<v8::Function> callback_;
+ v8::UniquePersistent<v8::Function> callback_;
DISALLOW_COPY_AND_ASSIGN(LoadWatcher);
};
} // namespace
« no previous file with comments | « extensions/renderer/object_backed_native_handler.cc ('k') | extensions/renderer/scoped_persistent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698