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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/test_v8_extension_configuration.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "extensions/renderer/test_v8_extension_configuration.h"
6
7 #include "base/lazy_instance.h"
8 #include "extensions/renderer/safe_builtins.h"
9 #include "v8/include/v8.h"
10
11 namespace extensions {
12
13 namespace {
14
15 base::LazyInstance<TestV8ExtensionConfiguration>::Leaky
16 g_v8_extension_configuration = LAZY_INSTANCE_INITIALIZER;
17
18 } // namespace
19
20 TestV8ExtensionConfiguration::TestV8ExtensionConfiguration()
21 : safe_builtins_(SafeBuiltins::CreateV8Extension()),
22 v8_extension_names_(1, safe_builtins_->name()),
23 v8_extension_configuration_(new v8::ExtensionConfiguration(
24 static_cast<int>(v8_extension_names_.size()),
25 v8_extension_names_.data())) {
26 v8::RegisterExtension(safe_builtins_.get());
27 }
28
29 TestV8ExtensionConfiguration::~TestV8ExtensionConfiguration() {}
30
31 // static
32 v8::ExtensionConfiguration* TestV8ExtensionConfiguration::GetConfiguration() {
33 return g_v8_extension_configuration.Get().v8_extension_configuration_.get();
34 }
35
36 } // namespace extensions
OLDNEW
« 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