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

Unified Diff: extensions/renderer/v8_schema_registry.cc

Issue 359413004: Add support for using AMD modules from extensions modules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: extensions_renderer should depend on gin Created 6 years, 5 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/v8_schema_registry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/v8_schema_registry.cc
diff --git a/extensions/renderer/v8_schema_registry.cc b/extensions/renderer/v8_schema_registry.cc
index 77a91f698514d1db4bc668b967b950c9547e3fb7..33163138cc335ac2a74e4ab1abb96aa592764241 100644
--- a/extensions/renderer/v8_schema_registry.cc
+++ b/extensions/renderer/v8_schema_registry.cc
@@ -105,13 +105,13 @@ v8::Handle<v8::Context> V8SchemaRegistry::GetOrCreateContext(
v8::Isolate* isolate) {
// It's ok to create local handles in this function, since this is only called
// when we have a HandleScope.
- if (context_.IsEmpty()) {
- v8::Handle<v8::Context> context = v8::Context::New(isolate);
- context_.reset(context);
+ if (!context_holder_) {
+ context_holder_.reset(new gin::ContextHolder(isolate));
+ context_holder_->SetContext(v8::Context::New(isolate));
schema_cache_.reset(new SchemaCache(isolate));
- return context;
+ return context_holder_->context();
}
- return context_.NewHandle(isolate);
+ return context_holder_->context();
}
} // namespace extensions
« no previous file with comments | « extensions/renderer/v8_schema_registry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698