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

Unified Diff: extensions/renderer/test_v8_extension_configuration.cc

Issue 2586303002: [Extensions Bindings] Pull out test resources (Closed)
Patch Set: comment Created 4 years 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/test_v8_extension_configuration.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/test_v8_extension_configuration.cc
diff --git a/extensions/renderer/test_v8_extension_configuration.cc b/extensions/renderer/test_v8_extension_configuration.cc
new file mode 100644
index 0000000000000000000000000000000000000000..20b96cf60f33d805887577a1c6cc33442c520677
--- /dev/null
+++ b/extensions/renderer/test_v8_extension_configuration.cc
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "extensions/renderer/test_v8_extension_configuration.h"
+
+#include "base/lazy_instance.h"
+#include "extensions/renderer/safe_builtins.h"
+#include "v8/include/v8.h"
+
+namespace extensions {
+
+namespace {
+
+base::LazyInstance<TestV8ExtensionConfiguration>::Leaky
+ g_v8_extension_configuration = LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
+
+TestV8ExtensionConfiguration::TestV8ExtensionConfiguration()
+ : safe_builtins_(SafeBuiltins::CreateV8Extension()),
+ v8_extension_names_(1, safe_builtins_->name()),
+ v8_extension_configuration_(new v8::ExtensionConfiguration(
+ static_cast<int>(v8_extension_names_.size()),
+ v8_extension_names_.data())) {
+ v8::RegisterExtension(safe_builtins_.get());
+}
+
+TestV8ExtensionConfiguration::~TestV8ExtensionConfiguration() {}
+
+// static
+v8::ExtensionConfiguration* TestV8ExtensionConfiguration::GetConfiguration() {
+ return g_v8_extension_configuration.Get().v8_extension_configuration_.get();
+}
+
+} // namespace extensions
« no previous file with comments | « extensions/renderer/test_v8_extension_configuration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698