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

Side by Side Diff: third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp

Issue 2811863002: Move ScriptState::GetExecutionContext (Part 4) (Closed)
Patch Set: Fix Document.cpp 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 2016 The Chromium Authors. All rights reserved. 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 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 "core/dom/TaskRunnerHelper.h" 5 #include "core/dom/TaskRunnerHelper.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/ExecutionContext.h"
8 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
9 #include "platform/WebFrameScheduler.h" 10 #include "platform/WebFrameScheduler.h"
10 #include "platform/WebTaskRunner.h" 11 #include "platform/WebTaskRunner.h"
11 #include "public/platform/Platform.h" 12 #include "public/platform/Platform.h"
12 #include "public/platform/WebThread.h" 13 #include "public/platform/WebThread.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 RefPtr<WebTaskRunner> TaskRunnerHelper::Get(TaskType type, LocalFrame* frame) { 17 RefPtr<WebTaskRunner> TaskRunnerHelper::Get(TaskType type, LocalFrame* frame) {
17 // TODO(haraken): Optimize the mapping from TaskTypes to task runners. 18 // TODO(haraken): Optimize the mapping from TaskTypes to task runners.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 TaskType type, 66 TaskType type,
66 ExecutionContext* execution_context) { 67 ExecutionContext* execution_context) {
67 return Get(type, execution_context && execution_context->IsDocument() 68 return Get(type, execution_context && execution_context->IsDocument()
68 ? static_cast<Document*>(execution_context) 69 ? static_cast<Document*>(execution_context)
69 : nullptr); 70 : nullptr);
70 } 71 }
71 72
72 RefPtr<WebTaskRunner> TaskRunnerHelper::Get(TaskType type, 73 RefPtr<WebTaskRunner> TaskRunnerHelper::Get(TaskType type,
73 ScriptState* script_state) { 74 ScriptState* script_state) {
74 return Get(type, 75 return Get(type,
75 script_state ? script_state->GetExecutionContext() : nullptr); 76 script_state ? ExecutionContext::From(script_state) : nullptr);
76 } 77 }
77 78
78 } // namespace blink 79 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/MessagePort.cpp ('k') | third_party/WebKit/Source/core/events/Event.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698