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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp

Issue 2810743003: Move ScriptState::GetExecutionContext (Part 3) (Closed)
Patch Set: Rebase 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 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/ScriptPromiseResolver.h" 5 #include "bindings/core/v8/ScriptPromiseResolver.h"
6 6
7 #include "core/dom/ExecutionContext.h"
7 #include "core/dom/TaskRunnerHelper.h" 8 #include "core/dom/TaskRunnerHelper.h"
8 #include "core/probe/CoreProbes.h" 9 #include "core/probe/CoreProbes.h"
9 10
10 namespace blink { 11 namespace blink {
11 12
12 ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* script_state) 13 ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* script_state)
13 : SuspendableObject(script_state->GetExecutionContext()), 14 : SuspendableObject(ExecutionContext::From(script_state)),
14 state_(kPending), 15 state_(kPending),
15 script_state_(script_state), 16 script_state_(script_state),
16 timer_(TaskRunnerHelper::Get(TaskType::kMicrotask, GetExecutionContext()), 17 timer_(TaskRunnerHelper::Get(TaskType::kMicrotask, GetExecutionContext()),
17 this, 18 this,
18 &ScriptPromiseResolver::OnTimerFired), 19 &ScriptPromiseResolver::OnTimerFired),
19 resolver_(script_state) { 20 resolver_(script_state) {
20 if (GetExecutionContext()->IsContextDestroyed()) { 21 if (GetExecutionContext()->IsContextDestroyed()) {
21 state_ = kDetached; 22 state_ = kDetached;
22 resolver_.Clear(); 23 resolver_.Clear();
23 } 24 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 81 }
81 } 82 }
82 Detach(); 83 Detach();
83 } 84 }
84 85
85 DEFINE_TRACE(ScriptPromiseResolver) { 86 DEFINE_TRACE(ScriptPromiseResolver) {
86 SuspendableObject::Trace(visitor); 87 SuspendableObject::Trace(visitor);
87 } 88 }
88 89
89 } // namespace blink 90 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698