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

Unified Diff: media/base/android/media_drm_bridge.h

Issue 276973005: BrowserMediaPlayerManager manages MediaKeys objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MEDIA_EXPORT Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/android/media_drm_bridge.h
diff --git a/media/base/android/media_drm_bridge.h b/media/base/android/media_drm_bridge.h
index f34bbc43b22a2f13a2ae63f713f87640b831d8a9..70cb0683e296e9e36b90ed106dd8561a81f01376 100644
--- a/media/base/android/media_drm_bridge.h
+++ b/media/base/android/media_drm_bridge.h
@@ -59,10 +59,18 @@ class MEDIA_EXPORT MediaDrmBridge : public MediaKeys {
// Returns a MediaDrmBridge instance if |key_system| is supported, or a NULL
// pointer otherwise.
- static scoped_ptr<MediaDrmBridge> Create(int cdm_id,
- const std::string& key_system,
- const GURL& security_origin,
- MediaPlayerManager* manager);
+ static scoped_ptr<MediaDrmBridge> Create(
+ const std::string& key_system,
+ const SessionCreatedCB& session_created_cb,
+ const SessionMessageCB& session_message_cb,
+ const SessionReadyCB& session_ready_cb,
+ const SessionClosedCB& session_closed_cb,
+ const SessionErrorCB& session_error_cb);
+
+ // Returns a MediaDrmBridge instance if |key_system| is supported, or a NULL
+ // otherwise. No session callbacks are provided. This is used when we need to
+ // use MediaDrmBridge without creating any sessions.
+ static scoped_ptr<MediaDrmBridge> Create(const std::string& key_system);
ddorwin 2014/05/13 00:59:38 For clarity (and because overloading is not allowe
xhwang 2014/05/14 16:42:06 Done.
// Returns true if |security_level| is successfully set, or false otherwise.
// Call this function right after Create() and before any other calls.
@@ -120,33 +128,29 @@ class MEDIA_EXPORT MediaDrmBridge : public MediaKeys {
// video playback.
bool IsProtectedSurfaceRequired();
ddorwin 2014/05/13 00:59:38 Note: My earlier comments wondered whether we shou
xhwang 2014/05/14 16:42:06 See my reply above for discussion.
- int cdm_id() const { return cdm_id_; }
-
- const GURL& security_origin() const { return security_origin_; }
-
private:
- MediaDrmBridge(int cdm_id,
- const std::vector<uint8>& scheme_uuid,
- const GURL& security_origin,
- MediaPlayerManager* manager);
+ MediaDrmBridge(const std::vector<uint8>& scheme_uuid,
+ const SessionCreatedCB& session_created_cb,
+ const SessionMessageCB& session_message_cb,
+ const SessionReadyCB& session_ready_cb,
+ const SessionClosedCB& session_closed_cb,
+ const SessionErrorCB& session_error_cb);
// Get the security level of the media.
SecurityLevel GetSecurityLevel();
- // ID of the CDM object.
- int cdm_id_;
-
// UUID of the key system.
std::vector<uint8> scheme_uuid_;
- // media stream's security origin.
- const GURL security_origin_;
-
// Java MediaDrm instance.
base::android::ScopedJavaGlobalRef<jobject> j_media_drm_;
- // Non-owned pointer.
- MediaPlayerManager* manager_;
+ // Callbacks for firing session events.
+ SessionCreatedCB session_created_cb_;
+ SessionMessageCB session_message_cb_;
+ SessionReadyCB session_ready_cb_;
+ SessionClosedCB session_closed_cb_;
+ SessionErrorCB session_error_cb_;
base::Closure media_crypto_ready_cb_;

Powered by Google App Engine
This is Rietveld 408576698