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

Side by Side Diff: third_party/WebKit/Source/platform/bindings/ScriptState.cpp

Issue 2843603002: Move ScriptWrappable and dependencies to platform/bindings (Closed)
Patch Set: Rebase and try again Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "bindings/core/v8/ScriptState.h" 5 #include "platform/bindings/ScriptState.h"
6 6
7 #include "bindings/core/v8/V8Binding.h" 7 #include "platform/bindings/V8Binding.h"
8 #include "core/dom/ExecutionContext.h"
9 8
10 namespace blink { 9 namespace blink {
11 10
12 PassRefPtr<ScriptState> ScriptState::Create(v8::Local<v8::Context> context, 11 PassRefPtr<ScriptState> ScriptState::Create(v8::Local<v8::Context> context,
13 PassRefPtr<DOMWrapperWorld> world) { 12 PassRefPtr<DOMWrapperWorld> world) {
14 RefPtr<ScriptState> script_state = 13 RefPtr<ScriptState> script_state =
15 AdoptRef(new ScriptState(context, std::move(world))); 14 AdoptRef(new ScriptState(context, std::move(world)));
16 // This ref() is for keeping this ScriptState alive as long as the v8::Context 15 // This ref() is for keeping this ScriptState alive as long as the v8::Context
17 // is alive. This is deref()ed in the weak callback of the v8::Context. 16 // is alive. This is deref()ed in the weak callback of the v8::Context.
18 script_state->Ref(); 17 script_state->Ref();
(...skipping 29 matching lines...) Expand all
48 void ScriptState::DetachGlobalObject() { 47 void ScriptState::DetachGlobalObject() {
49 DCHECK(!context_.IsEmpty()); 48 DCHECK(!context_.IsEmpty());
50 GetContext()->DetachGlobal(); 49 GetContext()->DetachGlobal();
51 } 50 }
52 51
53 void ScriptState::DisposePerContextData() { 52 void ScriptState::DisposePerContextData() {
54 per_context_data_ = nullptr; 53 per_context_data_ = nullptr;
55 } 54 }
56 55
57 } // namespace blink 56 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698