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 GURL verified_gurl = GURL(default_url_string->value()); |
xhwang
2014/05/22 18:44:52
I am surprised to see that we still have "default
| |
613 if (!verified_gurl.is_valid() && !verified_gurl.is_empty()) { | |
614 DLOG(WARNING) << "SessionMessage default_url is invalid : " | |
615 << verified_gurl.possibly_invalid_spec(); | |
616 verified_gurl = GURL::EmptyGURL(); // Replace invalid default_url. | |
617 } | |
618 | |
619 session_message_cb_.Run( | |
620 session_id, message, verified_gurl); | |
613 } | 621 } |
614 | 622 |
615 void ContentDecryptorDelegate::OnSessionReady(uint32 session_id) { | 623 void ContentDecryptorDelegate::OnSessionReady(uint32 session_id) { |
616 if (session_ready_cb_.is_null()) | 624 if (session_ready_cb_.is_null()) |
617 return; | 625 return; |
618 | 626 |
619 session_ready_cb_.Run(session_id); | 627 session_ready_cb_.Run(session_id); |
620 } | 628 } |
621 | 629 |
622 void ContentDecryptorDelegate::OnSessionClosed(uint32 session_id) { | 630 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; | 1064 const media::Decryptor::AudioBuffers empty_frames; |
1057 audio_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, | 1065 audio_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, |
1058 empty_frames); | 1066 empty_frames); |
1059 } | 1067 } |
1060 | 1068 |
1061 if (!video_decode_cb_.is_null()) | 1069 if (!video_decode_cb_.is_null()) |
1062 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); | 1070 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); |
1063 } | 1071 } |
1064 | 1072 |
1065 } // namespace content | 1073 } // namespace content |
OLD | NEW |