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

Side by Side Diff: public/platform/WebContentDecryptionModuleSession.h

Issue 858693002: Add MediaKeySession.keystatuseschange event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebContentDecryptionModuleSession_h 31 #ifndef WebContentDecryptionModuleSession_h
32 #define WebContentDecryptionModuleSession_h 32 #define WebContentDecryptionModuleSession_h
33 33
34 #include "WebCommon.h" 34 #include "WebCommon.h"
35 #include "WebVector.h"
35 #include "public/platform/WebContentDecryptionModuleException.h" 36 #include "public/platform/WebContentDecryptionModuleException.h"
36 #include "public/platform/WebContentDecryptionModuleResult.h" 37 #include "public/platform/WebContentDecryptionModuleResult.h"
37 38
38 namespace blink { 39 namespace blink {
39 40
41 class WebEncryptedMediaKeyInformation;
40 class WebString; 42 class WebString;
41 class WebURL; 43 class WebURL;
42 44
43 class BLINK_PLATFORM_EXPORT WebContentDecryptionModuleSession { 45 class BLINK_PLATFORM_EXPORT WebContentDecryptionModuleSession {
44 public: 46 public:
45 class BLINK_PLATFORM_EXPORT Client { 47 class BLINK_PLATFORM_EXPORT Client {
46 public: 48 public:
47 enum class MessageType { 49 enum class MessageType {
48 LicenseRequest, 50 LicenseRequest,
49 LicenseRenewal, 51 LicenseRenewal,
50 LicenseRelease 52 LicenseRelease
51 }; 53 };
52 54
53 virtual void message(MessageType, const unsigned char* message, size_t m essageLength) = 0; 55 virtual void message(MessageType, const unsigned char* message, size_t m essageLength) = 0;
54 // FIXME: Remove this method once Chromium updated to call the method ab ove. 56 // FIXME: Remove this method once Chromium updated to call the method ab ove.
55 virtual void message(const unsigned char* message, size_t messageLength, const WebURL& destinationURL) = 0; 57 virtual void message(const unsigned char* message, size_t messageLength, const WebURL& destinationURL) = 0;
56 virtual void close() = 0; 58 virtual void close() = 0;
57 59
58 // Called when the expiration time for the session changes. 60 // Called when the expiration time for the session changes.
59 // |updatedExpiryTimeInMS| is specified as the number of milliseconds 61 // |updatedExpiryTimeInMS| is specified as the number of milliseconds
60 // since 01 January, 1970 UTC. 62 // since 01 January, 1970 UTC.
61 virtual void expirationChanged(double updatedExpiryTimeInMS) = 0; 63 virtual void expirationChanged(double updatedExpiryTimeInMS) = 0;
62 64
65 // Called when the set of keys for this session change or existing keys
ddorwin 2015/01/17 00:34:56 nit: changes - the subject is "set"
jrummell 2015/01/20 19:46:34 Done.
66 // change state. |hasAdditionalUsableKey| is set if a key is newly
67 // usable (e.g. new key available, previously expired key has been
68 // renewed, etc.) and the browser should attempt to resume playback.
ddorwin 2015/01/17 00:34:56 "... attempt to resume playback if necessary."
jrummell 2015/01/20 19:46:34 Done.
69 virtual void keysChange(bool hasAdditionalUsableKey, const WebVector<Web EncryptedMediaKeyInformation>&) = 0;
70
63 protected: 71 protected:
64 virtual ~Client(); 72 virtual ~Client();
65 }; 73 };
66 74
67 virtual ~WebContentDecryptionModuleSession(); 75 virtual ~WebContentDecryptionModuleSession();
68 76
69 virtual void setClientInterface(Client*) = 0; 77 virtual void setClientInterface(Client*) = 0;
70 virtual WebString sessionId() const = 0; 78 virtual WebString sessionId() const = 0;
71 79
72 virtual void initializeNewSession(const WebString& initDataType, const unsig ned char* initData, size_t initDataLength, const WebString& sessionType, WebCont entDecryptionModuleResult) = 0; 80 virtual void initializeNewSession(const WebString& initDataType, const unsig ned char* initData, size_t initDataLength, const WebString& sessionType, WebCont entDecryptionModuleResult) = 0;
73 virtual void load(const WebString& sessionId, WebContentDecryptionModuleResu lt) = 0; 81 virtual void load(const WebString& sessionId, WebContentDecryptionModuleResu lt) = 0;
74 virtual void update(const unsigned char* response, size_t responseLength, We bContentDecryptionModuleResult) = 0; 82 virtual void update(const unsigned char* response, size_t responseLength, We bContentDecryptionModuleResult) = 0;
75 virtual void close(WebContentDecryptionModuleResult) = 0; 83 virtual void close(WebContentDecryptionModuleResult) = 0;
76 virtual void remove(WebContentDecryptionModuleResult) = 0; 84 virtual void remove(WebContentDecryptionModuleResult) = 0;
77 }; 85 };
78 86
79 } // namespace blink 87 } // namespace blink
80 88
81 #endif // WebContentDecryptionModuleSession_h 89 #endif // WebContentDecryptionModuleSession_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698