Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 { | |
|
alex clarke (OOO till 29th)
2017/01/26 16:02:36
So I like the RAII style handle (we should think a
alex clarke (OOO till 29th)
2017/01/26 16:13:56
Actually that would only work if this wasn't virtu
altimin
2017/01/26 16:23:13
Actually we can do that with move-only types:
cla
alex clarke (OOO till 29th)
2017/01/26 16:26:54
Can use WTF::WeakPtr (which is an alias for base::
| |
| 22 public: | |
| 23 ActiveConnectionHandle() {} | |
| 24 virtual ~ActiveConnectionHandle() {} | |
|
alex clarke (OOO till 29th)
2017/01/26 16:02:36
Please make this pure virtual.
altimin
2017/02/08 15:56:54
We can't have pure virtual destructors.
| |
| 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 Loading... | |
| 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 connection | |
|
Sami
2017/01/26 15:53:34
nit: mention that this means real time connections
altimin
2017/02/08 15:56:54
Done.
| |
| 83 // (websocket, webrtc, etc). When connection is closed this handle must | |
| 84 // 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 |
| OLD | NEW |