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

Issue 2530613003: media: Fix lifetime of InterfaceFactoryImpl and created impls (Closed)

Created:
4 years ago by xhwang
Modified:
4 years ago
CC:
Aaron Boodman, abarth-chromium, alokp+watch_chromium.org, alokp, chromium-reviews, darin (slow to review), feature-media-reviews_chromium.org, qsr+mojo_chromium.org, tguilbert, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

media: Fix lifetime of InterfaceFactoryImpl and created impls Makes sure that when InterfaceFactoryImpl is destructed, all mojo interface implemenations (e.g. MojoAudioDecoderService) are destructed. To achieve this, a helper class StrongBindingSet is introduced such that: - When connection error happens, the entry will be removed from the binding set, and the bound impl object will be destructed. - When StrongBindingSet is destructed, it'll destruct all outstanding impl objects in the binding set. BUG=604912 TEST=Added a unittest for StrongBindingSet. Committed: https://crrev.com/e557531d68bbd31b40c2b5c8daa70638c60710c7 Cr-Commit-Position: refs/heads/master@{#435141}

Patch Set 1 #

Total comments: 10

Patch Set 2 : comments addressed #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -23 lines) Patch
M media/mojo/BUILD.gn View 1 2 chunks +2 lines, -0 lines 0 comments Download
M media/mojo/services/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M media/mojo/services/interface_factory_impl.h View 2 chunks +11 lines, -0 lines 2 comments Download
M media/mojo/services/interface_factory_impl.cc View 1 5 chunks +23 lines, -9 lines 0 comments Download
M media/mojo/services/mojo_renderer_service.h View 1 4 chunks +14 lines, -14 lines 0 comments Download
M media/mojo/services/mojo_renderer_service.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
A media/mojo/services/strong_binding_set.h View 1 1 chunk +97 lines, -0 lines 0 comments Download
A media/mojo/services/strong_binding_set_unittest.cc View 1 1 chunk +103 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (18 generated)
xhwang
This is not ready to commit. I need to add some unittests to StrongBindingSet and ...
4 years ago (2016-11-23 22:27:09 UTC) #4
Ken Rockot(use gerrit already)
Seems reasonable to me https://codereview.chromium.org/2530613003/diff/1/media/mojo/services/strong_binding_set.h File media/mojo/services/strong_binding_set.h (right): https://codereview.chromium.org/2530613003/diff/1/media/mojo/services/strong_binding_set.h#newcode53 media/mojo/services/strong_binding_set.h:53: base::Bind(&Entry::OnConnectionError, base::Unretained(this))); nit, you could ...
4 years ago (2016-11-23 22:33:31 UTC) #5
sandersd (OOO until July 31)
lgtm. I don't currently foresee needing MojoVideoDecoderService to outlive the factory, so the particular mechanism ...
4 years ago (2016-11-23 23:28:49 UTC) #6
tguilbert
https://codereview.chromium.org/2530613003/diff/1/media/mojo/services/mojo_renderer_service.cc File media/mojo/services/mojo_renderer_service.cc (right): https://codereview.chromium.org/2530613003/diff/1/media/mojo/services/mojo_renderer_service.cc#newcode276 media/mojo/services/mojo_renderer_service.cc:276: binding_->Close(); On 2016/11/23 22:27:09, xhwang wrote: > tguilbert: > ...
4 years ago (2016-11-23 23:45:06 UTC) #8
xhwang
comments addressed
4 years ago (2016-11-29 10:19:58 UTC) #11
xhwang
https://codereview.chromium.org/2530613003/diff/1/media/mojo/services/mojo_renderer_service.cc File media/mojo/services/mojo_renderer_service.cc (right): https://codereview.chromium.org/2530613003/diff/1/media/mojo/services/mojo_renderer_service.cc#newcode276 media/mojo/services/mojo_renderer_service.cc:276: binding_->Close(); On 2016/11/23 23:45:06, tguilbert wrote: > On 2016/11/23 ...
4 years ago (2016-11-29 10:20:58 UTC) #12
tguilbert
LGTM Discussed offline. Opened crbug.com/669606. https://codereview.chromium.org/2530613003/diff/1/media/mojo/services/mojo_renderer_service.cc File media/mojo/services/mojo_renderer_service.cc (right): https://codereview.chromium.org/2530613003/diff/1/media/mojo/services/mojo_renderer_service.cc#newcode276 media/mojo/services/mojo_renderer_service.cc:276: binding_->Close(); On 2016/11/29 10:20:57, ...
4 years ago (2016-11-29 19:05:33 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.chromium.org/2530613003/20001
4 years ago (2016-11-30 05:10:52 UTC) #24
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years ago (2016-11-30 07:51:58 UTC) #26
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/e557531d68bbd31b40c2b5c8daa70638c60710c7 Cr-Commit-Position: refs/heads/master@{#435141}
4 years ago (2016-11-30 07:56:18 UTC) #28
Julien Isorce Samsung
Hello, this causes the following build error: ../../media/mojo/services/interface_factory_impl.cc:82:3: error: use of undeclared identifier 'video_decoder_bindings_'; did ...
4 years ago (2016-11-30 16:30:44 UTC) #29
xhwang
https://codereview.chromium.org/2530613003/diff/20001/media/mojo/services/interface_factory_impl.h File media/mojo/services/interface_factory_impl.h (right): https://codereview.chromium.org/2530613003/diff/20001/media/mojo/services/interface_factory_impl.h#newcode61 media/mojo/services/interface_factory_impl.h:61: #if defined(ENABLE_MOJO_AUDIO_DECODER) On 2016/11/30 16:30:44, Julien Isorce wrote: > ...
4 years ago (2016-11-30 17:38:49 UTC) #30
Julien Isorce Samsung
On 2016/11/30 17:38:49, xhwang wrote: > https://codereview.chromium.org/2530613003/diff/20001/media/mojo/services/interface_factory_impl.h > File media/mojo/services/interface_factory_impl.h (right): > > https://codereview.chromium.org/2530613003/diff/20001/media/mojo/services/interface_factory_impl.h#newcode61 > ...
4 years ago (2016-11-30 17:41:28 UTC) #31
xhwang
4 years ago (2016-11-30 17:48:16 UTC) #32
Message was sent while issue was closed.
On 2016/11/30 17:41:28, Julien Isorce wrote:
> On 2016/11/30 17:38:49, xhwang wrote:
> >
>
https://codereview.chromium.org/2530613003/diff/20001/media/mojo/services/int...
> > File media/mojo/services/interface_factory_impl.h (right):
> > 
> >
>
https://codereview.chromium.org/2530613003/diff/20001/media/mojo/services/int...
> > media/mojo/services/interface_factory_impl.h:61: #if
> > defined(ENABLE_MOJO_AUDIO_DECODER)
> > On 2016/11/30 16:30:44, Julien Isorce wrote:
> > > Should be ENABLE_MOJO_VIDEO_DECODER
> > 
> > oops, thanks!
> > 
> > I'll fix it now.
> > 
> > OOC, are you using mojo video decoder?
> 
> yes with https://codereview.chromium.org/2115603002/

Cool and interesting :) Thanks!

Powered by Google App Engine
This is Rietveld 408576698