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

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

Issue 2645813002: Add TaskRunnerHelper::get for Frame that casts to LocalFrame if possible or uses nullptr. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef TaskRunnerHelper_h 5 #ifndef TaskRunnerHelper_h
6 #define TaskRunnerHelper_h 6 #define TaskRunnerHelper_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 #include "wtf/HashTraits.h" 10 #include "wtf/HashTraits.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class Document; 14 class Document;
15 class ExecutionContext; 15 class ExecutionContext;
16 class Frame;
16 class LocalFrame; 17 class LocalFrame;
17 class ScriptState; 18 class ScriptState;
18 class WebTaskRunner; 19 class WebTaskRunner;
19 20
20 enum class TaskType : unsigned { 21 enum class TaskType : unsigned {
21 // Speced tasks and related internal tasks should be posted to one of 22 // Speced tasks and related internal tasks should be posted to one of
22 // the following task runners. These task runners may be throttled. 23 // the following task runners. These task runners may be throttled.
23 DOMManipulation, 24 DOMManipulation,
24 UserInteraction, 25 UserInteraction,
25 Networking, 26 Networking,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 }; 73 };
73 74
74 // A set of helper functions to get a WebTaskRunner for TaskType and a context 75 // A set of helper functions to get a WebTaskRunner for TaskType and a context
75 // object. The posted tasks are guaranteed to run in a sequence if they have the 76 // object. The posted tasks are guaranteed to run in a sequence if they have the
76 // same TaskType and the context objects belong to the same frame. 77 // same TaskType and the context objects belong to the same frame.
77 class CORE_EXPORT TaskRunnerHelper final { 78 class CORE_EXPORT TaskRunnerHelper final {
78 STATIC_ONLY(TaskRunnerHelper); 79 STATIC_ONLY(TaskRunnerHelper);
79 80
80 public: 81 public:
81 static RefPtr<WebTaskRunner> get(TaskType, LocalFrame*); 82 static RefPtr<WebTaskRunner> get(TaskType, LocalFrame*);
83 static RefPtr<WebTaskRunner> get(TaskType, Frame*);
82 static RefPtr<WebTaskRunner> get(TaskType, Document*); 84 static RefPtr<WebTaskRunner> get(TaskType, Document*);
83 static RefPtr<WebTaskRunner> get(TaskType, ExecutionContext*); 85 static RefPtr<WebTaskRunner> get(TaskType, ExecutionContext*);
84 static RefPtr<WebTaskRunner> get(TaskType, ScriptState*); 86 static RefPtr<WebTaskRunner> get(TaskType, ScriptState*);
85 }; 87 };
86 88
87 } // namespace blink 89 } // namespace blink
88 90
89 #endif 91 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698