OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/renderer/media/crypto/proxy_media_keys.h" | 5 #include "content/renderer/media/crypto/proxy_media_keys.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 if (session_type != media::MediaKeys::TEMPORARY_SESSION) { | 59 if (session_type != media::MediaKeys::TEMPORARY_SESSION) { |
60 promise->reject(NOT_SUPPORTED_ERROR, 0, | 60 promise->reject(NOT_SUPPORTED_ERROR, 0, |
61 "Only the temporary session type is supported."); | 61 "Only the temporary session type is supported."); |
62 return; | 62 return; |
63 } | 63 } |
64 | 64 |
65 // TODO(xhwang): Move these checks up to blink and DCHECK here. | 65 // TODO(xhwang): Move these checks up to blink and DCHECK here. |
66 // See http://crbug.com/342510 | 66 // See http://crbug.com/342510 |
67 CdmHostMsg_CreateSession_InitDataType create_session_init_data_type; | 67 CdmHostMsg_CreateSession_InitDataType create_session_init_data_type; |
68 if (init_data_type == "cenc") { | 68 if (init_data_type == "cenc") { |
69 create_session_init_data_type = CREATE_SESSION_TYPE_MP4; | 69 create_session_init_data_type = INIT_DATA_TYPE_CENC; |
70 } else if (init_data_type == "webm") { | 70 } else if (init_data_type == "webm") { |
71 create_session_init_data_type = CREATE_SESSION_TYPE_WEBM; | 71 create_session_init_data_type = INIT_DATA_TYPE_WEBM; |
72 } else { | 72 } else { |
73 DLOG(ERROR) << "Unsupported EME CreateSession content type of " | 73 DLOG(ERROR) << "Unsupported EME CreateSession content type of " |
74 << init_data_type; | 74 << init_data_type; |
75 promise->reject( | 75 promise->reject( |
76 NOT_SUPPORTED_ERROR, | 76 NOT_SUPPORTED_ERROR, |
77 0, | 77 0, |
78 "Unsupported EME CreateSession init data type of " + init_data_type); | 78 "Unsupported EME CreateSession init data type of " + init_data_type); |
79 return; | 79 return; |
80 } | 80 } |
81 | 81 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 session_expiration_update_cb_(session_expiration_update_cb) { | 198 session_expiration_update_cb_(session_expiration_update_cb) { |
199 cdm_id_ = manager->RegisterMediaKeys(this); | 199 cdm_id_ = manager->RegisterMediaKeys(this); |
200 } | 200 } |
201 | 201 |
202 void ProxyMediaKeys::InitializeCdm(const std::string& key_system, | 202 void ProxyMediaKeys::InitializeCdm(const std::string& key_system, |
203 const GURL& security_origin) { | 203 const GURL& security_origin) { |
204 manager_->InitializeCdm(cdm_id_, this, key_system, security_origin); | 204 manager_->InitializeCdm(cdm_id_, this, key_system, security_origin); |
205 } | 205 } |
206 | 206 |
207 } // namespace content | 207 } // namespace content |
OLD | NEW |