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

Side by Side Diff: third_party/WebKit/Source/core/workers/ParentFrameTaskRunners.h

Issue 2199633002: Revert of Pass per-frame task runners to Workers (when possible) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ParentFrameTaskRunners_h
6 #define ParentFrameTaskRunners_h
7
8 #include "core/CoreExport.h"
9 #include "wtf/Allocator.h"
10 #include "wtf/Noncopyable.h"
11 #include "wtf/PtrUtil.h"
12 #include <memory>
13
14 namespace blink {
15
16 class Document;
17 class WebTaskRunner;
18
19 // Represents a set of task runners of the parent (or associated) document's
20 // frame. This could be accessed from worker thread(s) and must be initialized
21 // on the parent context thread (i.e. MainThread) on construction time, rather
22 // than being done lazily.
23 class CORE_EXPORT ParentFrameTaskRunners final {
24 WTF_MAKE_NONCOPYABLE(ParentFrameTaskRunners);
25 USING_FAST_MALLOC(ParentFrameTaskRunners);
26 public:
27 static std::unique_ptr<ParentFrameTaskRunners> create(Document* document)
28 {
29 return wrapUnique(new ParentFrameTaskRunners(document));
30 }
31
32 ~ParentFrameTaskRunners();
33
34 WebTaskRunner* getUnthrottledTaskRunner();
35 WebTaskRunner* getTimerTaskRunner();
36 WebTaskRunner* getLoadingTaskRunner();
37
38 private:
39 ParentFrameTaskRunners(Document*);
40
41 std::unique_ptr<WebTaskRunner> m_unthrottledTaskRunner;
42 std::unique_ptr<WebTaskRunner> m_timerTaskRunner;
43 std::unique_ptr<WebTaskRunner> m_loadingTaskRunner;
44 };
45
46 } // namespace blink
47
48 #endif // ParentFrameTaskRunners_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698