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 #include "content/renderer/media/webcontentdecryptionmodulesession_impl.h" | 5 #include "content/renderer/media/webcontentdecryptionmodulesession_impl.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 blink::WebString WebContentDecryptionModuleSessionImpl::sessionId() const { | 30 blink::WebString WebContentDecryptionModuleSessionImpl::sessionId() const { |
31 return web_session_id_; | 31 return web_session_id_; |
32 } | 32 } |
33 | 33 |
34 void WebContentDecryptionModuleSessionImpl::initializeNewSession( | 34 void WebContentDecryptionModuleSessionImpl::initializeNewSession( |
35 const blink::WebString& mime_type, | 35 const blink::WebString& mime_type, |
36 const uint8* init_data, size_t init_data_length) { | 36 const uint8* init_data, size_t init_data_length) { |
37 // TODO(ddorwin): Guard against this in supported types check and remove this. | 37 // TODO(ddorwin): Guard against this in supported types check and remove this. |
38 // Chromium only supports ASCII MIME types. | 38 // Chromium only supports ASCII MIME types. |
39 if (!base::IsStringASCII(mime_type)) { | 39 if (!IsStringASCII(mime_type)) { |
40 NOTREACHED(); | 40 NOTREACHED(); |
41 OnSessionError(media::MediaKeys::kUnknownError, 0); | 41 OnSessionError(media::MediaKeys::kUnknownError, 0); |
42 return; | 42 return; |
43 } | 43 } |
44 | 44 |
45 adapter_->InitializeNewSession( | 45 adapter_->InitializeNewSession( |
46 session_id_, base::UTF16ToASCII(mime_type), init_data, init_data_length); | 46 session_id_, base::UTF16ToASCII(mime_type), init_data, init_data_length); |
47 } | 47 } |
48 | 48 |
49 void WebContentDecryptionModuleSessionImpl::update(const uint8* response, | 49 void WebContentDecryptionModuleSessionImpl::update(const uint8* response, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 void WebContentDecryptionModuleSessionImpl::OnSessionError( | 88 void WebContentDecryptionModuleSessionImpl::OnSessionError( |
89 media::MediaKeys::KeyError error_code, | 89 media::MediaKeys::KeyError error_code, |
90 uint32 system_code) { | 90 uint32 system_code) { |
91 client_->error(static_cast<Client::MediaKeyErrorCode>(error_code), | 91 client_->error(static_cast<Client::MediaKeyErrorCode>(error_code), |
92 system_code); | 92 system_code); |
93 } | 93 } |
94 | 94 |
95 } // namespace content | 95 } // namespace content |
OLD | NEW |