Commit 69c87928 authored by jochen@chromium.org's avatar jochen@chromium.org

Remove deprecated v8::External::New calls (chromium side)

BUG=266838
R=dcarney@chromium.org
TBR=eroman@chromium.org,abarth@chromium.org

Review URL: https://codereview.chromium.org/74783006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235745 0039d316-1c4b-4281-b951-d872f2087c98
parent beb9fca9
...@@ -77,12 +77,13 @@ void BoundLogMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { ...@@ -77,12 +77,13 @@ void BoundLogMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
(*log_method)(v8::Context::GetCalling(), message); (*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, const std::string& name,
LogMethod log_method) { LogMethod log_method) {
v8::Local<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New( v8::Local<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(
&BoundLogMethodCallback, &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()); target->Set(v8::String::New(name.c_str()), tmpl->GetFunction());
} }
...@@ -172,12 +173,13 @@ void AddMessage(v8::Handle<v8::Context> context, ...@@ -172,12 +173,13 @@ void AddMessage(v8::Handle<v8::Context> context,
} }
v8::Local<v8::Object> AsV8Object() { 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(); v8::Local<v8::Object> console_object = v8::Object::New();
BindLogMethod(console_object, "debug", &Debug); BindLogMethod(isolate, console_object, "debug", &Debug);
BindLogMethod(console_object, "log", &Log); BindLogMethod(isolate, console_object, "log", &Log);
BindLogMethod(console_object, "warn", &Warn); BindLogMethod(isolate, console_object, "warn", &Warn);
BindLogMethod(console_object, "error", &Error); BindLogMethod(isolate, console_object, "error", &Error);
return handle_scope.Close(console_object); return handle_scope.Close(console_object);
} }
......
...@@ -132,7 +132,7 @@ ModuleSystem::ModuleSystem(ChromeV8Context* context, SourceMap* source_map) ...@@ -132,7 +132,7 @@ ModuleSystem::ModuleSystem(ChromeV8Context* context, SourceMap* source_map)
v8::Handle<v8::Object> global(context->v8_context()->Global()); v8::Handle<v8::Object> global(context->v8_context()->Global());
global->SetHiddenValue(v8::String::New(kModulesField), v8::Object::New()); global->SetHiddenValue(v8::String::New(kModulesField), v8::Object::New());
global->SetHiddenValue(v8::String::New(kModuleSystem), global->SetHiddenValue(v8::String::New(kModuleSystem),
v8::External::New(this)); v8::External::New(context->isolate(), this));
} }
ModuleSystem::~ModuleSystem() { ModuleSystem::~ModuleSystem() {
......
...@@ -64,8 +64,9 @@ void ObjectBackedNativeHandler::RouteFunction( ...@@ -64,8 +64,9 @@ void ObjectBackedNativeHandler::RouteFunction(
v8::Persistent<v8::Object> data(isolate, v8::Object::New()); v8::Persistent<v8::Object> data(isolate, v8::Object::New());
v8::Local<v8::Object> local_data = v8::Local<v8::Object>::New(isolate, data); v8::Local<v8::Object> local_data = v8::Local<v8::Object>::New(isolate, data);
local_data->Set(v8::String::New(kHandlerFunction), local_data->Set(
v8::External::New(new HandlerFunction(handler_function))); v8::String::New(kHandlerFunction),
v8::External::New(isolate, new HandlerFunction(handler_function)));
v8::Handle<v8::FunctionTemplate> function_template = v8::Handle<v8::FunctionTemplate> function_template =
v8::FunctionTemplate::New(Router, local_data); v8::FunctionTemplate::New(Router, local_data);
object_template_.NewHandle(isolate)->Set(name.c_str(), function_template); object_template_.NewHandle(isolate)->Set(name.c_str(), function_template);
......
...@@ -119,7 +119,8 @@ ModuleRegistry* ModuleRegistry::From(Handle<v8::Context> context) { ...@@ -119,7 +119,8 @@ ModuleRegistry* ModuleRegistry::From(Handle<v8::Context> context) {
if (!data) if (!data)
return NULL; return NULL;
ModuleRegistry* registry = new ModuleRegistry(isolate); ModuleRegistry* registry = new ModuleRegistry(isolate);
context->Global()->SetHiddenValue(key, v8::External::New(registry)); context->Global()->SetHiddenValue(key,
v8::External::New(isolate, registry));
data->AddSupplement(registry); data->AddSupplement(registry);
return registry; return registry;
} }
......
...@@ -411,7 +411,7 @@ class ProxyResolverV8::Context { ...@@ -411,7 +411,7 @@ class ProxyResolverV8::Context {
v8::Isolate::Scope isolate_scope(isolate_); v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope scope(isolate_); v8::HandleScope scope(isolate_);
v8_this_.Reset(isolate_, v8::External::New(this)); v8_this_.Reset(isolate_, v8::External::New(isolate_, this));
v8::Local<v8::External> v8_this = v8::Local<v8::External> v8_this =
v8::Local<v8::External>::New(isolate_, v8_this_); v8::Local<v8::External>::New(isolate_, v8_this_);
v8::Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); v8::Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment