| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 5 #ifndef WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| 6 #define WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 6 #define WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual void Destroy() OVERRIDE; | 63 virtual void Destroy() OVERRIDE; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 // TODO(xhwang): After we removed DecryptorClient. We probably can also remove | 66 // TODO(xhwang): After we removed DecryptorClient. We probably can also remove |
| 67 // this Client class as well. Investigate this possibility. | 67 // this Client class as well. Investigate this possibility. |
| 68 class Client { | 68 class Client { |
| 69 public: | 69 public: |
| 70 enum Status { | 70 enum Status { |
| 71 kKeyAdded, | 71 kKeyAdded, |
| 72 kKeyError, | 72 kKeyError, |
| 73 kKeyMessage, | 73 kKeyMessage |
| 74 kNeedKey | |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 Client(); | 76 Client(); |
| 78 virtual ~Client(); | 77 virtual ~Client(); |
| 79 | 78 |
| 80 Status status() { return status_; } | 79 Status status() { return status_; } |
| 81 const std::string& session_id() { return session_id_; } | 80 const std::string& session_id() { return session_id_; } |
| 82 const std::string& key_message() { return key_message_; } | 81 const std::string& key_message() { return key_message_; } |
| 83 const std::string& default_url() { return default_url_; } | 82 const std::string& default_url() { return default_url_; } |
| 84 | 83 |
| 85 // Resets the Client to a clean state. | 84 // Resets the Client to a clean state. |
| 86 void Reset(); | 85 void Reset(); |
| 87 | 86 |
| 88 void KeyAdded(const std::string& session_id); | 87 void KeyAdded(const std::string& session_id); |
| 89 void KeyError(const std::string& session_id, | 88 void KeyError(const std::string& session_id, |
| 90 media::MediaKeys::KeyError error_code, | 89 media::MediaKeys::KeyError error_code, |
| 91 int system_code); | 90 int system_code); |
| 92 void KeyMessage(const std::string& session_id, | 91 void KeyMessage(const std::string& session_id, |
| 93 const std::string& message, | 92 const std::string& message, |
| 94 const std::string& default_url); | 93 const std::string& default_url); |
| 95 void NeedKey(const std::string& session_id, | |
| 96 const std::string& type, | |
| 97 scoped_ptr<uint8[]> init_data, int init_data_length); | |
| 98 | 94 |
| 99 private: | 95 private: |
| 100 Status status_; | 96 Status status_; |
| 101 std::string session_id_; | 97 std::string session_id_; |
| 102 std::string key_message_; | 98 std::string key_message_; |
| 103 std::string default_url_; | 99 std::string default_url_; |
| 104 }; | 100 }; |
| 105 | 101 |
| 106 // Prepares next heartbeat message and sets a timer for it. | 102 // Prepares next heartbeat message and sets a timer for it. |
| 107 void ScheduleNextHeartBeat(); | 103 void ScheduleNextHeartBeat(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER | 160 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER |
| 165 | 161 |
| 166 scoped_ptr<CdmVideoDecoder> video_decoder_; | 162 scoped_ptr<CdmVideoDecoder> video_decoder_; |
| 167 | 163 |
| 168 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 164 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
| 169 }; | 165 }; |
| 170 | 166 |
| 171 } // namespace webkit_media | 167 } // namespace webkit_media |
| 172 | 168 |
| 173 #endif // WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 169 #endif // WEBKIT_RENDERER_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| OLD | NEW |