| Index: media/base/media_keys.h
|
| diff --git a/media/base/media_keys.h b/media/base/media_keys.h
|
| index 733880ed91181ba4b23ba6171875e6fcb0a11893..6ddeb2ae2c6e7f6ce6af84ec4c4eab8c2efd6ce1 100644
|
| --- a/media/base/media_keys.h
|
| +++ b/media/base/media_keys.h
|
| @@ -61,7 +61,8 @@ class MEDIA_EXPORT MediaKeys{
|
| QUOTA_EXCEEDED_ERROR,
|
| UNKNOWN_ERROR,
|
| CLIENT_ERROR,
|
| - OUTPUT_ERROR
|
| + OUTPUT_ERROR,
|
| + EXCEPTION_MAX = OUTPUT_ERROR
|
| };
|
|
|
| // Type of license required when creating/loading a session.
|
| @@ -77,9 +78,10 @@ class MEDIA_EXPORT MediaKeys{
|
| // Must be consistent with the values specified in the spec:
|
| // https://w3c.github.io/encrypted-media/#idl-def-MediaKeyMessageType
|
| enum MessageType {
|
| - LICENSE_REQUEST,
|
| - LICENSE_RENEWAL,
|
| - LICENSE_RELEASE
|
| + LICENSE_REQUEST,
|
| + LICENSE_RENEWAL,
|
| + LICENSE_RELEASE,
|
| + MESSAGE_TYPE_MAX = LICENSE_RELEASE
|
| };
|
|
|
| virtual ~MediaKeys();
|
| @@ -90,10 +92,15 @@ class MEDIA_EXPORT MediaKeys{
|
| int certificate_data_length,
|
| scoped_ptr<SimpleCdmPromise> promise) = 0;
|
|
|
| - // Creates a session with the |init_data_type|, |init_data| and |session_type|
|
| - // provided.
|
| - // Note: UpdateSession() and ReleaseSession() should only be called after
|
| - // |promise| is resolved.
|
| + // Creates a session with |session_type|. Then generates a request with the
|
| + // |init_data_type| and |init_data|.
|
| + // Note:
|
| + // 1. The session ID will be provided when the |promise| is resolved.
|
| + // 2. The generated request should be returned through a SessionMessageCB,
|
| + // which must be AFTER the |promise| is resolved. Otherwise, the session ID
|
| + // in the callback will not be recognized.
|
| + // 3. UpdateSession(), CloseSession() and RemoveSession() should only be
|
| + // called after the |promise| is resolved.
|
| virtual void CreateSessionAndGenerateRequest(
|
| SessionType session_type,
|
| const std::string& init_data_type,
|
| @@ -102,8 +109,8 @@ class MEDIA_EXPORT MediaKeys{
|
| scoped_ptr<NewSessionCdmPromise> promise) = 0;
|
|
|
| // Loads a session with the |web_session_id| provided.
|
| - // Note: UpdateSession() and ReleaseSession() should only be called after
|
| - // |promise| is resolved.
|
| + // Note: UpdateSession(), CloseSession() and RemoveSession() should only be
|
| + // called after the |promise| is resolved.
|
| virtual void LoadSession(SessionType session_type,
|
| const std::string& web_session_id,
|
| scoped_ptr<NewSessionCdmPromise> promise) = 0;
|
| @@ -146,7 +153,7 @@ typedef base::Callback<void(const std::string& web_session_id,
|
| typedef base::Callback<void(const std::string& web_session_id)> SessionClosedCB;
|
|
|
| typedef base::Callback<void(const std::string& web_session_id,
|
| - MediaKeys::Exception exception_code,
|
| + MediaKeys::Exception exception,
|
| uint32 system_code,
|
| const std::string& error_message)> SessionErrorCB;
|
|
|
|
|