OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/pepper/content_decryptor_delegate.h" | 5 #include "content/renderer/pepper/content_decryptor_delegate.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
602 message.assign(data, data + message_array_buffer->ByteLength()); | 602 message.assign(data, data + message_array_buffer->ByteLength()); |
603 } | 603 } |
604 | 604 |
605 StringVar* default_url_string = StringVar::FromPPVar(default_url_var); | 605 StringVar* default_url_string = StringVar::FromPPVar(default_url_var); |
606 | 606 |
607 if (!default_url_string) { | 607 if (!default_url_string) { |
608 OnSessionError(session_id, media::MediaKeys::kUnknownError, 0); | 608 OnSessionError(session_id, media::MediaKeys::kUnknownError, 0); |
609 return; | 609 return; |
610 } | 610 } |
611 | 611 |
612 session_message_cb_.Run(session_id, message, default_url_string->value()); | 612 session_message_cb_.Run( |
613 session_id, message, GURL(default_url_string->value())); | |
xhwang
2014/05/21 16:59:01
hmm, the |default_url_string| may not be a valid U
ddorwin
2014/05/21 17:51:56
Link: https://code.google.com/p/chromium/codesearc
| |
613 } | 614 } |
614 | 615 |
615 void ContentDecryptorDelegate::OnSessionReady(uint32 session_id) { | 616 void ContentDecryptorDelegate::OnSessionReady(uint32 session_id) { |
616 if (session_ready_cb_.is_null()) | 617 if (session_ready_cb_.is_null()) |
617 return; | 618 return; |
618 | 619 |
619 session_ready_cb_.Run(session_id); | 620 session_ready_cb_.Run(session_id); |
620 } | 621 } |
621 | 622 |
622 void ContentDecryptorDelegate::OnSessionClosed(uint32 session_id) { | 623 void ContentDecryptorDelegate::OnSessionClosed(uint32 session_id) { |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1056 const media::Decryptor::AudioBuffers empty_frames; | 1057 const media::Decryptor::AudioBuffers empty_frames; |
1057 audio_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, | 1058 audio_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, |
1058 empty_frames); | 1059 empty_frames); |
1059 } | 1060 } |
1060 | 1061 |
1061 if (!video_decode_cb_.is_null()) | 1062 if (!video_decode_cb_.is_null()) |
1062 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); | 1063 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); |
1063 } | 1064 } |
1064 | 1065 |
1065 } // namespace content | 1066 } // namespace content |
OLD | NEW |