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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp

Issue 2843603002: Move ScriptWrappable and dependencies to platform/bindings (Closed)
Patch Set: Rebase and try again Created 3 years, 8 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
Index: third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
deleted file mode 100644
index 0bf6ebb2ab80c3b996d896bbb638eca7172fb10f..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2014 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 "bindings/core/v8/ScriptState.h"
-
-#include "bindings/core/v8/V8Binding.h"
-#include "core/dom/ExecutionContext.h"
-
-namespace blink {
-
-PassRefPtr<ScriptState> ScriptState::Create(v8::Local<v8::Context> context,
- PassRefPtr<DOMWrapperWorld> world) {
- RefPtr<ScriptState> script_state =
- AdoptRef(new ScriptState(context, std::move(world)));
- // This ref() is for keeping this ScriptState alive as long as the v8::Context
- // is alive. This is deref()ed in the weak callback of the v8::Context.
- script_state->Ref();
- return script_state;
-}
-
-static void DerefCallback(const v8::WeakCallbackInfo<ScriptState>& data) {
- data.GetParameter()->Deref();
-}
-
-static void ContextCollectedCallback(
- const v8::WeakCallbackInfo<ScriptState>& data) {
- data.GetParameter()->ClearContext();
- data.SetSecondPassCallback(DerefCallback);
-}
-
-ScriptState::ScriptState(v8::Local<v8::Context> context,
- PassRefPtr<DOMWrapperWorld> world)
- : isolate_(context->GetIsolate()),
- context_(isolate_, context),
- world_(std::move(world)),
- per_context_data_(V8PerContextData::Create(context)) {
- DCHECK(world_);
- context_.SetWeak(this, &ContextCollectedCallback);
- context->SetAlignedPointerInEmbedderData(kV8ContextPerContextDataIndex, this);
-}
-
-ScriptState::~ScriptState() {
- DCHECK(!per_context_data_);
- DCHECK(context_.IsEmpty());
-}
-
-void ScriptState::DetachGlobalObject() {
- DCHECK(!context_.IsEmpty());
- GetContext()->DetachGlobal();
-}
-
-void ScriptState::DisposePerContextData() {
- per_context_data_ = nullptr;
-}
-
-} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptState.h ('k') | third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698