| OLD | NEW |
| 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/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "platform/WebFrameScheduler.h" | 9 #include "platform/WebFrameScheduler.h" |
| 10 #include "platform/WebTaskRunner.h" | 10 #include "platform/WebTaskRunner.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 return nullptr; | 55 return nullptr; |
| 56 } | 56 } |
| 57 | 57 |
| 58 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, Document* document) { | 58 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, Document* document) { |
| 59 return get(type, document ? document->frame() : nullptr); | 59 return get(type, document ? document->frame() : nullptr); |
| 60 } | 60 } |
| 61 | 61 |
| 62 RefPtr<WebTaskRunner> TaskRunnerHelper::get( | 62 RefPtr<WebTaskRunner> TaskRunnerHelper::get( |
| 63 TaskType type, | 63 TaskType type, |
| 64 ExecutionContext* executionContext) { | 64 ExecutionContext* executionContext) { |
| 65 return get(type, executionContext && executionContext->isDocument() | 65 return get(type, |
| 66 ? static_cast<Document*>(executionContext) | 66 executionContext && executionContext->isDocument() |
| 67 : nullptr); | 67 ? static_cast<Document*>(executionContext) |
| 68 : nullptr); |
| 68 } | 69 } |
| 69 | 70 |
| 70 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, | 71 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, |
| 71 ScriptState* scriptState) { | 72 ScriptState* scriptState) { |
| 72 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr); | 73 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr); |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace blink | 76 } // namespace blink |
| OLD | NEW |