RESOLVED FIXED 147008
Media Session: add support for platform-specific interruption providers
https://bugs.webkit.org/show_bug.cgi?id=147008
Summary Media Session: add support for platform-specific interruption providers
Matt Rajca
Reported 2015-07-16 11:12:14 PDT
Interruption providers will notify media sessions of start/end-of-interruption events.
Attachments
Patch (18.46 KB, patch)
2015-07-16 11:27 PDT, Matt Rajca
eric.carlson: review+
Matt Rajca
Comment 1 2015-07-16 11:27:54 PDT
Radar WebKit Bug Importer
Comment 2 2015-07-16 11:29:12 PDT
Eric Carlson
Comment 3 2015-07-16 11:40:14 PDT
Comment on attachment 256916 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256916&action=review > Source/WebCore/ChangeLog:9 > + * platform/audio/MediaSessionInterruptionProvider.cpp: Added base class to be used by MediaSessionManager to Nit: This isn't audio-specific, so why don't you put it into a new "platform/mediasession" directory? > Source/WebCore/platform/audio/MediaSessionInterruptionProvider.cpp:37 > +MediaSessionInterruptionProvider::MediaSessionInterruptionProvider(MediaSessionInterruptionProviderClient& client) > + : m_client(&client) > +{ > + beginListeningForInterruptions(); > +} Will there ever be more than one interruption provider? If so, what is the lifetime of an object - who creates it? If there will only ever be one, you need a static accessor method and you need a way to add/remove clients.
Matt Rajca
Comment 4 2015-07-16 13:43:51 PDT
(In reply to comment #3) > Comment on attachment 256916 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=256916&action=review > > > Source/WebCore/ChangeLog:9 > > + * platform/audio/MediaSessionInterruptionProvider.cpp: Added base class to be used by MediaSessionManager to > > Nit: This isn't audio-specific, so why don't you put it into a new > "platform/mediasession" directory? Will do. > > > Source/WebCore/platform/audio/MediaSessionInterruptionProvider.cpp:37 > > +MediaSessionInterruptionProvider::MediaSessionInterruptionProvider(MediaSessionInterruptionProviderClient& client) > > + : m_client(&client) > > +{ > > + beginListeningForInterruptions(); > > +} > > Will there ever be more than one interruption provider? If so, what is the > lifetime of an object - who creates it? The interruption provider will only be used by the MediaSessionManager singleton (there will only be one client). > > If there will only ever be one, you need a static accessor method and you > need a way to add/remove clients.
Eric Carlson
Comment 5 2015-07-16 14:11:54 PDT
Comment on attachment 256916 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256916&action=review > Source/WebCore/platform/audio/MediaSessionInterruptionProvider.h:57 > + // To be overriden by subclasses. > + virtual void beginListeningForInterruptions(); > + virtual void stopListeningForInterruptions(); If these must be overridden, why not make the pure-virtual? > Source/WebCore/platform/audio/mac/MediaSessionInterruptionProviderMac.h:37 > + using MediaSessionInterruptionProvider::MediaSessionInterruptionProvider; Is this necessary?
Matt Rajca
Comment 6 2015-07-16 16:19:31 PDT
(In reply to comment #5) > Comment on attachment 256916 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=256916&action=review > > > Source/WebCore/platform/audio/MediaSessionInterruptionProvider.h:57 > > + // To be overriden by subclasses. > > + virtual void beginListeningForInterruptions(); > > + virtual void stopListeningForInterruptions(); > > If these must be overridden, why not make the pure-virtual? These methods are called from the base class's constructor and destructor so they cannot be pure virtual. > > > Source/WebCore/platform/audio/mac/MediaSessionInterruptionProviderMac.h:37 > > + using MediaSessionInterruptionProvider::MediaSessionInterruptionProvider; > > Is this necessary? Yes, constructors aren't inherited.
Matt Rajca
Comment 7 2015-07-16 16:28:42 PDT
Note You need to log in before you can comment on or make changes to this bug.