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

Side by Side Diff: gin/modules/module_registry.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gin/modules/module_registry.h" 5 #include "gin/modules/module_registry.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include "gin/arguments.h" 10 #include "gin/arguments.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 ModuleRegistry* ModuleRegistry::From(Handle<v8::Context> context) { 112 ModuleRegistry* ModuleRegistry::From(Handle<v8::Context> context) {
113 v8::Isolate* isolate = context->GetIsolate(); 113 v8::Isolate* isolate = context->GetIsolate();
114 Handle<v8::String> key = GetHiddenValueKey(isolate); 114 Handle<v8::String> key = GetHiddenValueKey(isolate);
115 Handle<v8::Value> value = context->Global()->GetHiddenValue(key); 115 Handle<v8::Value> value = context->Global()->GetHiddenValue(key);
116 Handle<v8::External> external; 116 Handle<v8::External> external;
117 if (value.IsEmpty() || !ConvertFromV8(value, &external)) { 117 if (value.IsEmpty() || !ConvertFromV8(value, &external)) {
118 PerContextData* data = PerContextData::From(context); 118 PerContextData* data = PerContextData::From(context);
119 if (!data) 119 if (!data)
120 return NULL; 120 return NULL;
121 ModuleRegistry* registry = new ModuleRegistry(isolate); 121 ModuleRegistry* registry = new ModuleRegistry(isolate);
122 context->Global()->SetHiddenValue(key, v8::External::New(registry)); 122 context->Global()->SetHiddenValue(key,
123 v8::External::New(isolate, registry));
123 data->AddSupplement(registry); 124 data->AddSupplement(registry);
124 return registry; 125 return registry;
125 } 126 }
126 return static_cast<ModuleRegistry*>(external->Value()); 127 return static_cast<ModuleRegistry*>(external->Value());
127 } 128 }
128 129
129 void ModuleRegistry::AddPendingModule(v8::Isolate* isolate, 130 void ModuleRegistry::AddPendingModule(v8::Isolate* isolate,
130 PendingModule* pending) { 131 PendingModule* pending) {
131 if (AttemptToLoad(isolate, pending)) 132 if (AttemptToLoad(isolate, pending))
132 AttemptToLoadPendingModules(isolate); 133 AttemptToLoadPendingModules(isolate);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void ModuleRegistry::AttemptToLoadPendingModules(v8::Isolate* isolate) { 180 void ModuleRegistry::AttemptToLoadPendingModules(v8::Isolate* isolate) {
180 PendingModuleList pending_modules; 181 PendingModuleList pending_modules;
181 pending_modules.swap(pending_modules_); 182 pending_modules.swap(pending_modules_);
182 for (PendingModuleList::iterator it = pending_modules.begin(); 183 for (PendingModuleList::iterator it = pending_modules.begin();
183 it != pending_modules.end(); ++it) { 184 it != pending_modules.end(); ++it) {
184 AttemptToLoad(isolate, *it); 185 AttemptToLoad(isolate, *it);
185 } 186 }
186 } 187 }
187 188
188 } // namespace gin 189 } // namespace gin
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/object_backed_native_handler.cc ('k') | net/proxy/proxy_resolver_v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698