Bug 148109 - Media Session: don't begin listening for interruptions when an interruption provider is created
Summary: Media Session: don't begin listening for interruptions when an interruption p...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 145411
  Show dependency treegraph
 
Reported: 2015-08-17 17:01 PDT by Matt Rajca
Modified: 2015-08-18 18:05 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.58 KB, patch)
2015-08-17 17:06 PDT, Matt Rajca
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Rajca 2015-08-17 17:01:25 PDT
If we call beginListeningForInterruption in MediaSessionInterruptionProvider's constructor, the current class's implementation will get called, not implementations provided by subclasses (this makes sense since base classes are initialized before derived classes). To fix this, we let clients of MediaSessionInterruptionProvider start listening for interruptions instead.
Comment 1 Radar WebKit Bug Importer 2015-08-17 17:02:42 PDT
<rdar://problem/22317444>
Comment 2 Matt Rajca 2015-08-17 17:06:49 PDT
Created attachment 259212 [details]
Patch
Comment 3 Eric Carlson 2015-08-18 08:20:03 PDT
Comment on attachment 259212 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259212&action=review

> Source/WebCore/Modules/mediasession/MediaSessionManager.cpp:48
> +    m_interruptionProvider->beginListeningForInterruptions();

Shouldn't this and stopListeningForInterruptions be pure virtual?
Comment 4 Matt Rajca 2015-08-18 18:04:13 PDT
(In reply to comment #3)
> Comment on attachment 259212 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=259212&action=review
> 
> > Source/WebCore/Modules/mediasession/MediaSessionManager.cpp:48
> > +    m_interruptionProvider->beginListeningForInterruptions();
> 
> Shouldn't this and stopListeningForInterruptions be pure virtual?

Yeah. That wasn't possible before since we were calling these in MediaSessionInterruptionProvider's constructor/destructor, but now that that responsibility has been demoted to the caller, I'll make the switch.
Comment 5 Matt Rajca 2015-08-18 18:05:22 PDT
Committed r188615: <http://trac.webkit.org/changeset/188615>