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

Issue 2683993006: [scheduler] Plumb information about active webrtc connections to scheduler (Closed)

Created:
3 years, 10 months ago by altimin
Modified:
3 years, 10 months ago
Reviewers:
haraken, Guido Urdaneta
CC:
chromium-reviews, blink-reviews, kinuko+watch
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[scheduler] Plumb information about active webrtc connections to scheduler Notify scheduler about webrtc connections. BUG=690929 Review-Url: https://codereview.chromium.org/2683993006 Cr-Commit-Position: refs/heads/master@{#449640} Committed: https://chromium.googlesource.com/chromium/src/+/407bdb243f9dd1d94f7e99318a7f60df1f421dfa

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -1 line) Patch
M third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h View 3 chunks +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp View 3 chunks +7 lines, -0 lines 2 comments Download
M third_party/WebKit/Source/web/tests/ActiveConnectionThrottlingTest.cpp View 2 chunks +82 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (10 generated)
altimin
PTAL
3 years, 10 months ago (2017-02-10 14:41:40 UTC) #3
haraken
LGTM with a question. https://codereview.chromium.org/2683993006/diff/1/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp File third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp (right): https://codereview.chromium.org/2683993006/diff/1/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp#newcode526 third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp:526: document->frame()->frameScheduler()->onActiveConnectionCreated(); Another possible API would ...
3 years, 10 months ago (2017-02-10 16:51:20 UTC) #9
altimin
Thanks! https://codereview.chromium.org/2683993006/diff/1/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp File third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp (right): https://codereview.chromium.org/2683993006/diff/1/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp#newcode526 third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp:526: document->frame()->frameScheduler()->onActiveConnectionCreated(); On 2017/02/10 16:51:20, haraken wrote: > > ...
3 years, 10 months ago (2017-02-10 16:57:01 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2683993006/1
3 years, 10 months ago (2017-02-10 16:57:49 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/407bdb243f9dd1d94f7e99318a7f60df1f421dfa
3 years, 10 months ago (2017-02-10 17:05:21 UTC) #15
haraken
On 2017/02/10 16:57:01, altimin wrote: > Thanks! > > https://codereview.chromium.org/2683993006/diff/1/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp > File third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp > (right): ...
3 years, 10 months ago (2017-02-10 17:05:55 UTC) #16
altimin
On 2017/02/10 17:05:55, haraken wrote: > On 2017/02/10 16:57:01, altimin wrote: > > Thanks! > ...
3 years, 10 months ago (2017-02-10 17:32:14 UTC) #17
haraken
3 years, 10 months ago (2017-02-11 00:58:43 UTC) #18
Message was sent while issue was closed.
On 2017/02/10 17:32:14, altimin wrote:
> On 2017/02/10 17:05:55, haraken wrote:
> > On 2017/02/10 16:57:01, altimin wrote:
> > > Thanks!
> > > 
> > >
> >
>
https://codereview.chromium.org/2683993006/diff/1/third_party/WebKit/Source/m...
> > > File
third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
> > > (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/2683993006/diff/1/third_party/WebKit/Source/m...
> > >
third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp:526:
> > > document->frame()->frameScheduler()->onActiveConnectionCreated();
> > > On 2017/02/10 16:51:20, haraken wrote:
> > > > 
> > > > Another possible API would be to use an observer pattern like
> > > > ActiveScriptWrappable::hasPendingActivity().
> > > > 
> > > > class RTCPeerConnection : public HasUnthrottledTask {
> > > >   bool hasUnthrottledTask() override { return !m_closed || !m_stopped; }
> > > > };
> > > > 
> > > > Then developers don't need to write .reset() in many places. The
observer
> > > > pattern would be less error-prone than the .reset() pattern.
> > > 
> > > I would argue that you still need to notify the scheduler when active
> > connection
> > > has gone away (checking all HasActiveTask subclasses is slow and will
> probably
> > > involve troubles with ownership models and weak pointers). Thus some kind
of
> > > call is needed, and resetting handlers is arguably one of the best
options:
> > e.g.
> > > calling reset on an empty handle or calling reset twice will work as
> intended.
> > 
> > My worry is that developers may forget to call .reset() in some cases.
That's
> > why ActiveScriptWrappable (which is used to keep a V8 wrapper alive while
DOM
> > has some references) uses the observer pattern instead of .reset() pattern.
> 
> I still prefer current approach. But your point is very accurate, but I think
> that we will be able to address it with sufficient test coverage. I improved
> existing tests for this: crrev.com/2683993006.

If you really want to go with that approach, can you add a DCHECK to verify that
all handlers have been reset when the scheduler shuts down?

Powered by Google App Engine
This is Rietveld 408576698