Chromium Code Reviews| Index: content/browser/media/android/browser_media_player_manager.h |
| diff --git a/content/browser/media/android/browser_media_player_manager.h b/content/browser/media/android/browser_media_player_manager.h |
| index 308ed02f5b0598322e926eacdef366dda9501556..4a5ba6fb42c803467fb6683f5d9b7e092af4be0d 100644 |
| --- a/content/browser/media/android/browser_media_player_manager.h |
| +++ b/content/browser/media/android/browser_media_player_manager.h |
| @@ -26,7 +26,7 @@ |
| namespace media { |
| class DemuxerAndroid; |
| -class MediaDrmBridge; |
| +class MediaKeys; |
| } |
| namespace content { |
| @@ -35,11 +35,11 @@ class ContentViewCoreImpl; |
| class ExternalVideoSurfaceContainer; |
| class WebContents; |
| -// This class manages all the MediaPlayerAndroid objects. It receives |
| -// control operations from the the render process, and forwards |
| -// them to corresponding MediaPlayerAndroid object. Callbacks from |
| -// MediaPlayerAndroid objects are converted to IPCs and then sent to the |
| -// render process. |
| +// This class manages all the MediaPlayerAndroid and CDM objects. |
| +// It receives control operations from the the render process, and forwards |
| +// them to corresponding MediaPlayerAndroid or CDM object. Callbacks from |
| +// MediaPlayerAndroid and CDM objects are converted to IPCs and then sent to |
| +// the render process. |
| class CONTENT_EXPORT BrowserMediaPlayerManager |
| : public WebContentsObserver, |
| public media::MediaPlayerManager { |
| @@ -90,7 +90,7 @@ class CONTENT_EXPORT BrowserMediaPlayerManager |
| virtual media::MediaResourceGetter* GetMediaResourceGetter() OVERRIDE; |
| virtual media::MediaPlayerAndroid* GetFullscreenPlayer() OVERRIDE; |
| virtual media::MediaPlayerAndroid* GetPlayer(int player_id) OVERRIDE; |
| - virtual media::MediaDrmBridge* GetDrmBridge(int cdm_id) OVERRIDE; |
| + virtual media::MediaKeys* GetCdm(int cdm_id) OVERRIDE; |
| virtual void DestroyAllMediaPlayers() OVERRIDE; |
| virtual void RequestFullScreen(int player_id) OVERRIDE; |
| virtual void OnSessionCreated(int cdm_id, |
| @@ -99,7 +99,7 @@ class CONTENT_EXPORT BrowserMediaPlayerManager |
| virtual void OnSessionMessage(int cdm_id, |
| uint32 session_id, |
| const std::vector<uint8>& message, |
| - const GURL& destination_url) OVERRIDE; |
| + const std::string& destination_url) OVERRIDE; |
|
ddorwin
2014/05/13 00:59:38
Why the change?
Should we pass GURLs around as muc
xhwang
2014/05/14 16:42:06
std::string is used in media_keys.h. Filed a bug a
|
| virtual void OnSessionReady(int cdm_id, uint32 session_id) OVERRIDE; |
| virtual void OnSessionClosed(int cdm_id, uint32 session_id) OVERRIDE; |
| virtual void OnSessionError(int cdm_id, |
| @@ -164,14 +164,13 @@ class CONTENT_EXPORT BrowserMediaPlayerManager |
| int player_id, |
| media::MediaPlayerAndroid* player); |
| - // Adds a new MediaDrmBridge for the given |key_system|, |cdm_id|, and |
| - // |frame_url|. |
| - void AddDrmBridge(int cdm_id, |
| - const std::string& key_system, |
| - const GURL& frame_url); |
| + // Adds a new CDM for the given |key_system|, |cdm_id|, and |security_origin|. |
|
ddorwin
2014/05/13 00:59:38
Would it be more accurate to say this?
// Adds a n
xhwang
2014/05/14 16:42:06
Done.
|
| + void AddCdm(int cdm_id, |
| + const std::string& key_system, |
| + const GURL& security_origin); |
| - // Removes the DRM bridge with the specified id. |
| - void RemoveDrmBridge(int cdm_id); |
| + // Removes the CDM with the specified id. |
| + void RemoveCdm(int cdm_id); |
| private: |
| // If |permitted| is false, it does nothing but send |
| @@ -216,13 +215,17 @@ class CONTENT_EXPORT BrowserMediaPlayerManager |
| // An array of managed players. |
| ScopedVector<media::MediaPlayerAndroid> players_; |
| - // An array of managed media DRM bridges. |
| - ScopedVector<media::MediaDrmBridge> drm_bridges_; |
| + // A map from CDM IDs to managed CDMs. |
| + typedef std::map<int, media::MediaKeys*> CdmMap; |
| + CdmMap cdm_map_; |
| - // Map from DrmBridge cdm_id to MediaPlayerAndroid player_id to indicate that |
| - // the DrmBridge is set on the MediaPlayerAndroid object. |
| - typedef std::map<int, int> DrmBridgePlayerMap; |
| - DrmBridgePlayerMap drm_bridge_player_map_; |
| + // Map from CDM ID to MediaPlayerAndroid player ID to indicate that |
| + // the CDM is set on the MediaPlayerAndroid object. |
| + typedef std::map<int, int> CdmToPlayerMap; |
| + CdmToPlayerMap cdm_to_player_map_; |
| + |
| + // Map from CDM ID to CDM's security origin. |
|
ddorwin
2014/05/13 00:59:38
Why doesn't the CDM object maintain this? Should w
xhwang
2014/05/14 16:42:06
Because most CDM objects are not interested in thi
|
| + std::map<int, GURL> security_origin_map_; |
|
ddorwin
2014/05/13 00:59:38
cdm_...
xhwang
2014/05/14 16:42:06
Done.
|
| // The fullscreen video view object or NULL if video is not played in |
| // fullscreen. |