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

Issue 2685093002: Switching some interfaces to use std::unique_ptr<>. (Closed)

Created:
3 years, 10 months ago by Taylor Brandstetter
Modified:
3 years, 10 months ago
CC:
webrtc-reviews_webrtc.org, the sun, tterriberry_mozilla.com
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Switching some interfaces to use std::unique_ptr<>. This helps show where ownership is transfered between objects. Specifically, this CL wraps cricket::VideoCapturer, MediaEngineInterface and DataEngineInterface in unique_ptr. BUG=None TBR=magjed@webrtc.org Review-Url: https://codereview.webrtc.org/2685093002 Cr-Commit-Position: refs/heads/master@{#16548} Committed: https://chromium.googlesource.com/external/webrtc/+/112b2e99d806a8f60ad3dcb5abc9dd82b704df65

Patch Set 1 #

Total comments: 2

Patch Set 2 : Get rid of unneeded comment. #

Total comments: 7

Patch Set 3 : Updating a few more places. #

Patch Set 4 : Making these changes backwards compatible for mock PC factory classes #

Patch Set 5 : Fixing "hidden overload" compile warning. #

Patch Set 6 : Rebase onto master #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -114 lines) Patch
M webrtc/api/peerconnectionfactoryproxy.h View 1 2 3 4 2 chunks +7 lines, -2 lines 0 comments Download
M webrtc/api/peerconnectioninterface.h View 1 2 3 2 chunks +26 lines, -4 lines 4 comments Download
M webrtc/examples/peerconnection/client/conductor.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M webrtc/examples/peerconnection/client/conductor.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M webrtc/media/base/videocapturerfactory.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M webrtc/media/engine/webrtcmediaengine.h View 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/media/engine/webrtcvideocapturerfactory.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M webrtc/media/engine/webrtcvideocapturerfactory.cc View 1 2 1 chunk +5 lines, -4 lines 0 comments Download
M webrtc/pc/channelmanager.h View 1 2 chunks +6 lines, -7 lines 0 comments Download
M webrtc/pc/channelmanager.cc View 1 chunk +11 lines, -13 lines 0 comments Download
M webrtc/pc/channelmanager_unittest.cc View 3 chunks +13 lines, -18 lines 0 comments Download
M webrtc/pc/peerconnection_unittest.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M webrtc/pc/peerconnectionfactory.h View 1 2 3 4 3 chunks +9 lines, -3 lines 0 comments Download
M webrtc/pc/peerconnectionfactory.cc View 1 2 3 chunks +17 lines, -12 lines 3 comments Download
M webrtc/pc/peerconnectionfactory_unittest.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M webrtc/pc/peerconnectioninterface_unittest.cc View 1 2 5 chunks +15 lines, -9 lines 0 comments Download
M webrtc/pc/rtcstatscollector_unittest.cc View 2 chunks +5 lines, -3 lines 0 comments Download
M webrtc/pc/rtpsenderreceiver_unittest.cc View 2 chunks +5 lines, -3 lines 0 comments Download
M webrtc/pc/statscollector_unittest.cc View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M webrtc/pc/test/peerconnectiontestwrapper.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M webrtc/pc/videocapturertracksource.h View 2 chunks +4 lines, -4 lines 2 comments Download
M webrtc/pc/videocapturertracksource.cc View 1 chunk +9 lines, -9 lines 0 comments Download
M webrtc/pc/videocapturertracksource_unittest.cc View 3 chunks +4 lines, -6 lines 0 comments Download
M webrtc/pc/webrtcsession_unittest.cc View 2 chunks +6 lines, -3 lines 0 comments Download
M webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoSource.mm View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 28 (15 generated)
pthatcher1
lgtm, but it would be nice to have a second reviewer, perhaps someone from STO. ...
3 years, 10 months ago (2017-02-10 18:21:25 UTC) #2
Taylor Brandstetter
nisse@, since you've been working on similar cleanup efforts, want to take a look? https://codereview.webrtc.org/2685093002/diff/1/webrtc/pc/channelmanager.h ...
3 years, 10 months ago (2017-02-10 21:55:48 UTC) #4
the sun
lgtm https://codereview.webrtc.org/2685093002/diff/20001/webrtc/api/peerconnectioninterface.h File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/2685093002/diff/20001/webrtc/api/peerconnectioninterface.h#newcode970 webrtc/api/peerconnectioninterface.h:970: // TODO(deadbeef): Make pure virtual once implemented by ...
3 years, 10 months ago (2017-02-10 22:00:11 UTC) #6
Taylor Brandstetter
https://codereview.webrtc.org/2685093002/diff/20001/webrtc/api/peerconnectioninterface.h File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/2685093002/diff/20001/webrtc/api/peerconnectioninterface.h#newcode970 webrtc/api/peerconnectioninterface.h:970: // TODO(deadbeef): Make pure virtual once implemented by chromium ...
3 years, 10 months ago (2017-02-11 01:50:09 UTC) #8
Taylor Brandstetter
+magjed for the Obj-C file
3 years, 10 months ago (2017-02-11 01:51:01 UTC) #10
Taylor Brandstetter
https://codereview.webrtc.org/2685093002/diff/20001/webrtc/api/peerconnectioninterface.h File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/2685093002/diff/20001/webrtc/api/peerconnectioninterface.h#newcode970 webrtc/api/peerconnectioninterface.h:970: // TODO(deadbeef): Make pure virtual once implemented by chromium ...
3 years, 10 months ago (2017-02-11 02:13:22 UTC) #11
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/2685093002/100001
3 years, 10 months ago (2017-02-11 03:05:55 UTC) #19
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/external/webrtc/+/112b2e99d806a8f60ad3dcb5abc9dd82b704df65
3 years, 10 months ago (2017-02-11 04:13:46 UTC) #22
nisse-webrtc
On 2017/02/11 02:13:22, Taylor Brandstetter wrote: > https://codereview.webrtc.org/2685093002/diff/20001/webrtc/api/peerconnectioninterface.h > File webrtc/api/peerconnectioninterface.h (right): > > https://codereview.webrtc.org/2685093002/diff/20001/webrtc/api/peerconnectioninterface.h#newcode970 ...
3 years, 10 months ago (2017-02-13 08:25:09 UTC) #23
nisse-webrtc
One scary TODO comment, but generally looks good. https://codereview.webrtc.org/2685093002/diff/100001/webrtc/api/peerconnectioninterface.h File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/2685093002/diff/100001/webrtc/api/peerconnectioninterface.h#newcode968 webrtc/api/peerconnectioninterface.h:968: // ...
3 years, 10 months ago (2017-02-13 08:25:58 UTC) #25
the sun
https://codereview.webrtc.org/2685093002/diff/100001/webrtc/pc/peerconnectionfactory.cc File webrtc/pc/peerconnectionfactory.cc (right): https://codereview.webrtc.org/2685093002/diff/100001/webrtc/pc/peerconnectionfactory.cc#newcode212 webrtc/pc/peerconnectionfactory.cc:212: // TODO: Need to make sure only one VoE ...
3 years, 10 months ago (2017-02-13 09:02:31 UTC) #26
nisse-webrtc
On 2017/02/13 09:02:31, the sun wrote: > https://codereview.webrtc.org/2685093002/diff/100001/webrtc/pc/peerconnectionfactory.cc > File webrtc/pc/peerconnectionfactory.cc (right): > > https://codereview.webrtc.org/2685093002/diff/100001/webrtc/pc/peerconnectionfactory.cc#newcode212 ...
3 years, 10 months ago (2017-02-13 09:11:20 UTC) #27
Taylor Brandstetter
3 years, 10 months ago (2017-02-13 17:47:45 UTC) #28
Message was sent while issue was closed.
Addressed these things in this follow-up CL (only affected comments):
https://codereview.webrtc.org/2692923002/

https://codereview.webrtc.org/2685093002/diff/100001/webrtc/api/peerconnectio...
File webrtc/api/peerconnectioninterface.h (right):

https://codereview.webrtc.org/2685093002/diff/100001/webrtc/api/peerconnectio...
webrtc/api/peerconnectioninterface.h:968: // Creates a
VideoTrackSourceInterface. The new source takes ownership of
On 2017/02/13 08:25:58, nisse-webrtc wrote:
> You could drop the ownership comment here too, since it's implied by
unique_ptr.

Done.

https://codereview.webrtc.org/2685093002/diff/100001/webrtc/api/peerconnectio...
webrtc/api/peerconnectioninterface.h:973:
std::unique_ptr<cricket::VideoCapturer> capturer) {
On 2017/02/13 08:25:58, nisse-webrtc wrote:
> We should aim to kill cricket::VideoCapturer. As far as I'm aware, it's
> now used only by the layers of wrappers around webrtc's own platform specific
> capturers. Which should should be refactored into to implementing
> VideoTrackSourceInterface directly.
> 
> (Not an objection to this change, it's just annoying that we still have this
> method).

Added TODO.

https://codereview.webrtc.org/2685093002/diff/100001/webrtc/pc/peerconnection...
File webrtc/pc/peerconnectionfactory.cc (right):

https://codereview.webrtc.org/2685093002/diff/100001/webrtc/pc/peerconnection...
webrtc/pc/peerconnectionfactory.cc:212: // TODO:  Need to make sure only one VoE
is created inside
On 2017/02/13 09:02:31, the sun wrote:
> On 2017/02/13 08:25:58, nisse-webrtc wrote:
> > When? Do you intend to ensure that before landing?
> 
> This is an old comment (mid 2013) and nothing I'd be terribly concerned with
for
> several reasons:
> 
> 1. I can find two instances in VoE of global state - both instance counters
used
> exclusively in logging.
> 2. Much of the code using them is going to be removed within Q1. 

Removing comment.

https://codereview.webrtc.org/2685093002/diff/100001/webrtc/pc/videocapturert...
File webrtc/pc/videocapturertracksource.h (right):

https://codereview.webrtc.org/2685093002/diff/100001/webrtc/pc/videocapturert...
webrtc/pc/videocapturertracksource.h:37: // VideoCapturerTrackSource takes
ownership of |capturer|.
On 2017/02/13 08:25:58, nisse-webrtc wrote:
> Another redundant ownership comment.

Fixed.

Powered by Google App Engine
This is Rietveld 408576698