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

Issue 2584553002: New method StatsObserver::OnCompleteReports, passing ownership. (Closed)

Created:
4 years ago by nisse-webrtc
Modified:
4 years ago
CC:
webrtc-reviews_webrtc.org, the sun, tterriberry_mozilla.com
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

New method StatsObserver::OnCompleteReports, passing ownership. The new name, OnCompleteReports rather than OnComplete, is needed because in C++ method lookup, overriding a method hides all otherwise inherited methods with the same name, even if they have a different signature. And here, the intention is that each subclass should override one or the other of the two methods, and inherit the method it doesn't override. This cl is a prerequisite for https://codereview.webrtc.org/2567143003/, because the Chrome glue code needs to retain the stats report after the OnComplete method has returned. Currently, Chrome makes a copy of the stats mapping (which breaks when changing ValuePtr from an rtc::linked_ptr to an std::unique_ptr). After this cl, Chrome can be fixed to take ownership and no longer needs to copy anything, unblocking cl 2567143003. BUG=webrtc:6424 Review-Url: https://codereview.webrtc.org/2584553002 Cr-Commit-Position: refs/heads/master@{#15708} Committed: https://chromium.googlesource.com/external/webrtc/+/b36ee8d498be2fa58fde3f3f3d69a74e4d3b817d

Patch Set 1 #

Total comments: 2

Patch Set 2 : Drop unneeded ".get()". #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -12 lines) Patch
M webrtc/api/peerconnection.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M webrtc/api/peerconnectioninterface.h View 1 1 chunk +8 lines, -1 line 0 comments Download
M webrtc/api/test/mockpeerconnectionobservers.h View 1 chunk +3 lines, -3 lines 0 comments Download
M webrtc/sdk/android/src/jni/peerconnection_jni.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/sdk/objc/Framework/Classes/RTCPeerConnection+Stats.mm View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 20 (7 generated)
nisse-webrtc
PTAL.
4 years ago (2016-12-15 13:23:46 UTC) #2
hbos
lgtm https://codereview.webrtc.org/2584553002/diff/1/webrtc/api/peerconnectioninterface.h File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/2584553002/diff/1/webrtc/api/peerconnectioninterface.h#newcode118 webrtc/api/peerconnectioninterface.h:118: OnComplete(*reports.get()); nit: Just *reports works too
4 years ago (2016-12-15 13:39:41 UTC) #3
nisse-webrtc
https://codereview.webrtc.org/2584553002/diff/1/webrtc/api/peerconnectioninterface.h File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/2584553002/diff/1/webrtc/api/peerconnectioninterface.h#newcode118 webrtc/api/peerconnectioninterface.h:118: OnComplete(*reports.get()); On 2016/12/15 13:39:40, hbos wrote: > nit: Just ...
4 years ago (2016-12-15 14:02:31 UTC) #4
the sun
lgtm
4 years ago (2016-12-15 14:39:41 UTC) #5
magjed_webrtc
lgtm Regarding that you have to name the new function OnCompleteReports and not OnComplete, it ...
4 years ago (2016-12-19 12:56:20 UTC) #6
nisse-webrtc
On 2016/12/19 12:56:20, magjed_webrtc wrote: > Regarding that you have to name the new function ...
4 years ago (2016-12-19 13:38:34 UTC) #7
magjed_webrtc
On 2016/12/19 13:38:34, nisse-webrtc wrote: > On 2016/12/19 12:56:20, magjed_webrtc wrote: > > Regarding that ...
4 years ago (2016-12-19 14:03:36 UTC) #8
nisse-webrtc
On 2016/12/19 14:03:36, magjed_webrtc wrote: > How it is implemented by the compiler isn't really ...
4 years ago (2016-12-19 14:29:31 UTC) #9
tkchin_webrtc
On 2016/12/19 14:29:31, nisse-webrtc wrote: > On 2016/12/19 14:03:36, magjed_webrtc wrote: > > How it ...
4 years ago (2016-12-19 23:41:41 UTC) #11
nisse-webrtc
Thanks for the review. Magnus, is the cl description good enough?
4 years ago (2016-12-20 07:37:40 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2584553002/20001
4 years ago (2016-12-20 10:43:17 UTC) #16
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/external/webrtc/+/b36ee8d498be2fa58fde3f3f3d69a74e4d3b817d
4 years ago (2016-12-20 11:30:04 UTC) #19
nisse-webrtc
3 years, 11 months ago (2017-01-18 09:20:12 UTC) #20
Message was sent while issue was closed.
A revert of this CL (patchset #2 id:20001) has been created in
https://codereview.webrtc.org/2641783002/ by nisse@webrtc.org.

The reason for reverting is: The new method doesn't work as intended. 

It can't pass ownership, because the StatsReports is a vector of raw pointers to
StatReport objects owned by the StatsCollector..

Powered by Google App Engine
This is Rietveld 408576698