Chromium Code Reviews| Index: third_party/WebKit/Source/platform/WebFrameScheduler.h | 
| diff --git a/third_party/WebKit/Source/platform/WebFrameScheduler.h b/third_party/WebKit/Source/platform/WebFrameScheduler.h | 
| index 069fedf6b2bbc6dd2eac8d1e6ed62e3edc2c383f..a6744ab4a70e2588c033c43554a4b2110a5ecd49 100644 | 
| --- a/third_party/WebKit/Source/platform/WebFrameScheduler.h | 
| +++ b/third_party/WebKit/Source/platform/WebFrameScheduler.h | 
| @@ -7,6 +7,8 @@ | 
| #include "wtf/RefPtr.h" | 
| +#include <memory> | 
| + | 
| namespace blink { | 
| class WebTaskRunner; | 
| @@ -16,6 +18,15 @@ class WebFrameScheduler { | 
| public: | 
| virtual ~WebFrameScheduler() {} | 
| + 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::
 
 | 
| + public: | 
| + ActiveConnectionHandle() {} | 
| + 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.
 
 | 
| + | 
| + private: | 
| + DISALLOW_COPY_AND_ASSIGN(ActiveConnectionHandle); | 
| + }; | 
| + | 
| // The scheduler may throttle tasks associated with offscreen frames. | 
| virtual void setFrameVisible(bool) {} | 
| @@ -67,6 +78,13 @@ class WebFrameScheduler { | 
| // Tells the scheduler that the first meaningful paint has occured for this | 
| // frame. | 
| virtual void onFirstMeaningfulPaint() {} | 
| + | 
| + // 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.
 
 | 
| + // (websocket, webrtc, etc). When connection is closed this handle must | 
| + // be destroyed. | 
| + virtual std::unique_ptr<ActiveConnectionHandle> onActiveConnectionCreated() { | 
| + return nullptr; | 
| + }; | 
| }; | 
| } // namespace blink |