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

Issue 10387135: Add deletion observer to P2PSocketDispatcher. (Closed)

Created:
8 years, 7 months ago by perkj_chrome
Modified:
8 years, 7 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, jochen+watch-content_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Add deletion observer to P2PSocketDispatcher. This is an alternative solution to http://codereview.chromium.org/10332114/ RenderViewObserver is actually destroyed in the same order as they are created. Ie P2PSocketDispatcher::P2PSocketDispatcher MediaStreamImpl::MediaStreamImpl P2PSocketDispatcher::~P2PSocketDispatcher MediaStreamImpl::~MediaStreamImpl Since MediaStreamImpl holds an observer object to P2PSocketDispatcher and the P2PSocketDispatcher require all observers to have unregistered before it is deleted, it is required that the MediaStreamImpl is either destroyed before P2PSocketDispatcher or that it is notified that the PSocketDispatcher will be destroyed. BUG=127782 TEST= Please see the defect Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=138066

Patch Set 1 #

Patch Set 2 : Added comments and fixed style nits. #

Total comments: 12

Patch Set 3 : Fixing code style issues. #

Patch Set 4 : Fix dll export. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -20 lines) Patch
M content/renderer/media/media_stream_impl.h View 1 2 3 5 chunks +8 lines, -1 line 0 comments Download
M content/renderer/media/media_stream_impl.cc View 1 2 5 chunks +27 lines, -19 lines 0 comments Download
M content/renderer/p2p/socket_dispatcher.h View 1 2 3 chunks +18 lines, -0 lines 0 comments Download
M content/renderer/p2p/socket_dispatcher.cc View 1 2 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
perkj_chrome
Hej, here comes an alternative to http://codereview.chromium.org/10332114/ Lets see tomorrow which one to pursue.
8 years, 7 months ago (2012-05-15 16:18:16 UTC) #1
perkj_chrome
Hi, sergeyu, can you please review this cl? Please also see the discussion in by ...
8 years, 7 months ago (2012-05-17 11:36:20 UTC) #2
tommi (sloooow) - chröme
lgtm. looks hacky but I don't see an alternative right now besides redesigning how the ...
8 years, 7 months ago (2012-05-17 11:58:16 UTC) #3
piman
LGTM. I like this approach a lot better where dependencies are explicit.
8 years, 7 months ago (2012-05-17 16:40:30 UTC) #4
Sergey Ulanov
I have some style nits. LGTM when they are addressed. https://chromiumcodereview.appspot.com/10387135/diff/3001/content/renderer/p2p/socket_dispatcher.h File content/renderer/p2p/socket_dispatcher.h (right): https://chromiumcodereview.appspot.com/10387135/diff/3001/content/renderer/p2p/socket_dispatcher.h#newcode59 ...
8 years, 7 months ago (2012-05-17 18:20:14 UTC) #5
perkj_chrome
Thanks, sergeyu, can you have another look? https://chromiumcodereview.appspot.com/10387135/diff/3001/content/renderer/p2p/socket_dispatcher.h File content/renderer/p2p/socket_dispatcher.h (right): https://chromiumcodereview.appspot.com/10387135/diff/3001/content/renderer/p2p/socket_dispatcher.h#newcode59 content/renderer/p2p/socket_dispatcher.h:59: class P2PSocketDispatcherObserver ...
8 years, 7 months ago (2012-05-18 07:54:25 UTC) #6
piman
On Fri, May 18, 2012 at 12:54 AM, <perkj@chromium.org> wrote: > Thanks, sergeyu, can you ...
8 years, 7 months ago (2012-05-18 20:11:23 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/10387135/6003
8 years, 7 months ago (2012-05-20 07:34:39 UTC) #8
commit-bot: I haz the power
Try job failure for 10387135-6003 (retry) on win for step "compile" (clobber build). It's a ...
8 years, 7 months ago (2012-05-20 08:17:29 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/10387135/10004
8 years, 7 months ago (2012-05-20 15:43:56 UTC) #10
commit-bot: I haz the power
Change committed as 138066
8 years, 7 months ago (2012-05-20 16:57:01 UTC) #11
Sergey Ulanov
8 years, 7 months ago (2012-05-21 17:57:19 UTC) #12
https://chromiumcodereview.appspot.com/10387135/diff/3001/content/renderer/p2...
File content/renderer/p2p/socket_dispatcher.h (right):

https://chromiumcodereview.appspot.com/10387135/diff/3001/content/renderer/p2...
content/renderer/p2p/socket_dispatcher.h:59: class P2PSocketDispatcherObserver {
On 2012/05/18 07:54:25, perkj wrote:
> On 2012/05/17 18:20:15, sergeyu wrote:
> > Can this be defined inside of P2PSocketDispatcher?
> 
> Yes, but last time I did it triggered this long discussion a month later:
>
https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thr...
> 
> So now the style guide explicitly says this type of classes should be in
> separate header files, which to me seems like overkill...
> 

Well, that's very arguable rule, not everybody agrees with it, and there are
tons of code that doesn't follow that rule.
In any case, the whole point of that rule is to speed up compilation by
separating class definitions into separate headers. In this particular case,
because there is only a handful of files that include this header, I highly
doubt that this approach can improve compilation time. Nonetheless, if you
decided to go by the letter of the style guide, then you should also move this
class to a separate header. If you keep it in this header, then there is no
reason not to make it nested.

https://chromiumcodereview.appspot.com/10387135/diff/3001/content/renderer/p2...
content/renderer/p2p/socket_dispatcher.h:64: ~P2PSocketDispatcherObserver() {}
On 2012/05/18 07:54:25, perkj wrote:
> On 2012/05/17 18:20:15, sergeyu wrote:
> > virtual
> ok, this is something that comes up from time to time. Some people claim it
> should not be virtual since the implementation should never be deleted through
> this interface.

The style guide says that ALL interfaces must have a virtual destructor.

Powered by Google App Engine
This is Rietveld 408576698