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

Side by Side Diff: Source/bindings/core/v8/V8TestingScope.cpp

Issue 997003004: [bindings] Migrate V8TestingScope out of V8Binding.h/cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « Source/bindings/core/v8/V8TestingScope.h ('k') | Source/bindings/core/v8/v8.gypi » ('j') | 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 (c) 2015 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 "config.h"
6 #include "bindings/core/v8/V8TestingScope.h"
7
8 #include "bindings/core/v8/DOMWrapperWorld.h"
9
10 namespace blink {
11
12 V8TestingScope::V8TestingScope(v8::Isolate* isolate)
13 : m_handleScope(isolate)
14 , m_contextScope(v8::Context::New(isolate))
15 // We reuse the main world since the main world is guaranteed to be register ed to ScriptController.
16 , m_scriptState(ScriptStateForTesting::create(isolate->GetCurrentContext(), &DOMWrapperWorld::mainWorld()))
17 {
18 }
19
20 V8TestingScope::~V8TestingScope()
21 {
22 m_scriptState->disposePerContextData();
23 }
24
25 ScriptState* V8TestingScope::scriptState() const
26 {
27 return m_scriptState.get();
28 }
29
30 v8::Isolate* V8TestingScope::isolate() const
31 {
32 return m_scriptState->isolate();
33 }
34
35 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8TestingScope.h ('k') | Source/bindings/core/v8/v8.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698