Bug 148109

Summary: Media Session: don't begin listening for interruptions when an interruption provider is created
Product: WebKit Reporter: Matt Rajca <mrajca>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: conrad_shultz, eric.carlson, mrajca, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 145411    
Attachments:
Description Flags
Patch eric.carlson: review+

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>