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

Side by Side Diff: third_party/WebKit/Source/platform/WebFrameScheduler.h

Issue 2652973002: [scheduler] Plumb websocket information to scheduler (Closed)
Patch Set: git Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 WebFrameScheduler_h 5 #ifndef WebFrameScheduler_h
6 #define WebFrameScheduler_h 6 #define WebFrameScheduler_h
7 7
8 #include "wtf/RefPtr.h" 8 #include "wtf/RefPtr.h"
9 9
10 #include <memory>
11
10 namespace blink { 12 namespace blink {
11 13
12 class WebTaskRunner; 14 class WebTaskRunner;
13 class WebViewScheduler; 15 class WebViewScheduler;
14 16
15 class WebFrameScheduler { 17 class WebFrameScheduler {
16 public: 18 public:
17 virtual ~WebFrameScheduler() {} 19 virtual ~WebFrameScheduler() {}
18 20
21 class ActiveConnectionHandle {
22 public:
23 ActiveConnectionHandle() {}
24 virtual ~ActiveConnectionHandle() {}
25
26 private:
27 DISALLOW_COPY_AND_ASSIGN(ActiveConnectionHandle);
28 };
29
19 // The scheduler may throttle tasks associated with offscreen frames. 30 // The scheduler may throttle tasks associated with offscreen frames.
20 virtual void setFrameVisible(bool) {} 31 virtual void setFrameVisible(bool) {}
21 32
22 // Tells the scheduler that the page this frame belongs to supposed to be 33 // Tells the scheduler that the page this frame belongs to supposed to be
23 // throttled (because it's not been visible for a few seconds). 34 // throttled (because it's not been visible for a few seconds).
24 virtual void setPageThrottled(bool) {} 35 virtual void setPageThrottled(bool) {}
25 36
26 // Set whether this frame is suspended. Only unthrottledTaskRunner tasks are 37 // Set whether this frame is suspended. Only unthrottledTaskRunner tasks are
27 // allowed to run on a suspended frame. 38 // allowed to run on a suspended frame.
28 virtual void setSuspended(bool) {} 39 virtual void setSuspended(bool) {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 virtual void didStopLoading(unsigned long identifier) {} 71 virtual void didStopLoading(unsigned long identifier) {}
61 72
62 // Tells the scheduler if we are parsing a document on another thread. This 73 // Tells the scheduler if we are parsing a document on another thread. This
63 // tells the scheduler not to advance virtual time if it's using the 74 // tells the scheduler not to advance virtual time if it's using the
64 // DETERMINISTIC_LOADING policy. 75 // DETERMINISTIC_LOADING policy.
65 virtual void setDocumentParsingInBackground(bool) {} 76 virtual void setDocumentParsingInBackground(bool) {}
66 77
67 // Tells the scheduler that the first meaningful paint has occured for this 78 // Tells the scheduler that the first meaningful paint has occured for this
68 // frame. 79 // frame.
69 virtual void onFirstMeaningfulPaint() {} 80 virtual void onFirstMeaningfulPaint() {}
81
82 // Notifies scheduler that this frame has established an active real time
83 // connection (websocket, webrtc, etc). When connection is closed this handle
84 // must be destroyed.
85 virtual std::unique_ptr<ActiveConnectionHandle> onActiveConnectionCreated() {
86 return nullptr;
87 };
70 }; 88 };
71 89
72 } // namespace blink 90 } // namespace blink
73 91
74 #endif // WebFrameScheduler_h 92 #endif // WebFrameScheduler_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698