OLD | NEW |
---|---|
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 Loading... | |
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 changes or existing keys | |
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 | |
69 // if necessary. | |
70 virtual void keysStatusesChange(const WebVector<WebEncryptedMediaKeyInfo rmation>&, bool hasAdditionalUsableKey) = 0; | |
dcheng
2015/01/20 22:11:48
Minor nit: it seems unfortunate to have expiration
jrummell
2015/01/20 23:03:09
ddorwin mentioned this in PS#2. I'll change it in
| |
71 | |
63 protected: | 72 protected: |
64 virtual ~Client(); | 73 virtual ~Client(); |
65 }; | 74 }; |
66 | 75 |
67 virtual ~WebContentDecryptionModuleSession(); | 76 virtual ~WebContentDecryptionModuleSession(); |
68 | 77 |
69 virtual void setClientInterface(Client*) = 0; | 78 virtual void setClientInterface(Client*) = 0; |
70 virtual WebString sessionId() const = 0; | 79 virtual WebString sessionId() const = 0; |
71 | 80 |
72 virtual void initializeNewSession(const WebString& initDataType, const unsig ned char* initData, size_t initDataLength, const WebString& sessionType, WebCont entDecryptionModuleResult) = 0; | 81 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; | 82 virtual void load(const WebString& sessionId, WebContentDecryptionModuleResu lt) = 0; |
74 virtual void update(const unsigned char* response, size_t responseLength, We bContentDecryptionModuleResult) = 0; | 83 virtual void update(const unsigned char* response, size_t responseLength, We bContentDecryptionModuleResult) = 0; |
75 virtual void close(WebContentDecryptionModuleResult) = 0; | 84 virtual void close(WebContentDecryptionModuleResult) = 0; |
76 virtual void remove(WebContentDecryptionModuleResult) = 0; | 85 virtual void remove(WebContentDecryptionModuleResult) = 0; |
77 }; | 86 }; |
78 | 87 |
79 } // namespace blink | 88 } // namespace blink |
80 | 89 |
81 #endif // WebContentDecryptionModuleSession_h | 90 #endif // WebContentDecryptionModuleSession_h |
OLD | NEW |