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

Unified Diff: extensions/renderer/object_backed_native_handler.cc

Issue 239253003: Stop using v8::Persistent in ObjectBackedNativeHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/object_backed_native_handler.cc
diff --git a/extensions/renderer/object_backed_native_handler.cc b/extensions/renderer/object_backed_native_handler.cc
index 9b699bcbba7c63aec52ab246fcfbd3815d875bcb..0c75ea0e82160d0224bb78de6363d2fc14e7fa04 100644
--- a/extensions/renderer/object_backed_native_handler.cc
+++ b/extensions/renderer/object_backed_native_handler.cc
@@ -57,16 +57,15 @@ void ObjectBackedNativeHandler::RouteFunction(
v8::HandleScope handle_scope(isolate);
v8::Context::Scope context_scope(context_->v8_context());
- v8::Persistent<v8::Object> data(isolate, v8::Object::New(isolate));
- v8::Local<v8::Object> local_data = v8::Local<v8::Object>::New(isolate, data);
- local_data->Set(
+ v8::Local<v8::Object> data = v8::Object::New(isolate);
+ data->Set(
v8::String::NewFromUtf8(isolate, kHandlerFunction),
v8::External::New(isolate, new HandlerFunction(handler_function)));
v8::Handle<v8::FunctionTemplate> function_template =
- v8::FunctionTemplate::New(isolate, Router, local_data);
+ v8::FunctionTemplate::New(isolate, Router, data);
object_template_.NewHandle(isolate)
->Set(isolate, name.c_str(), function_template);
- router_data_.Append(local_data);
+ router_data_.Append(data);
}
v8::Isolate* ObjectBackedNativeHandler::GetIsolate() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698