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

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

Issue 74783006: Remove deprecated v8::External::New calls (chromium side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | chrome/renderer/extensions/module_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/console.cc
diff --git a/chrome/renderer/extensions/console.cc b/chrome/renderer/extensions/console.cc
index d0b29279d6c1f38f3caf1ab8264fec55ee68f68b..e3c820981dd93568746bf9c6306659ab524467ad 100644
--- a/chrome/renderer/extensions/console.cc
+++ b/chrome/renderer/extensions/console.cc
@@ -77,12 +77,13 @@ void BoundLogMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
(*log_method)(v8::Context::GetCalling(), message);
}
-void BindLogMethod(v8::Local<v8::Object> target,
+void BindLogMethod(v8::Isolate* isolate,
+ v8::Local<v8::Object> target,
const std::string& name,
LogMethod log_method) {
v8::Local<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(
&BoundLogMethodCallback,
- v8::External::New(reinterpret_cast<void*>(log_method)));
+ v8::External::New(isolate, reinterpret_cast<void*>(log_method)));
target->Set(v8::String::New(name.c_str()), tmpl->GetFunction());
}
@@ -172,12 +173,13 @@ void AddMessage(v8::Handle<v8::Context> context,
}
v8::Local<v8::Object> AsV8Object() {
- v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope handle_scope(isolate);
v8::Local<v8::Object> console_object = v8::Object::New();
- BindLogMethod(console_object, "debug", &Debug);
- BindLogMethod(console_object, "log", &Log);
- BindLogMethod(console_object, "warn", &Warn);
- BindLogMethod(console_object, "error", &Error);
+ BindLogMethod(isolate, console_object, "debug", &Debug);
+ BindLogMethod(isolate, console_object, "log", &Log);
+ BindLogMethod(isolate, console_object, "warn", &Warn);
+ BindLogMethod(isolate, console_object, "error", &Error);
return handle_scope.Close(console_object);
}
« no previous file with comments | « no previous file | chrome/renderer/extensions/module_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698