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/webmediaplayer_impl.h" | 5 #include "content/renderer/media/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 | 1092 |
1093 client_->keyError( | 1093 client_->keyError( |
1094 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), | 1094 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), |
1095 WebString::fromUTF8(session_id), | 1095 WebString::fromUTF8(session_id), |
1096 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), | 1096 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), |
1097 short_system_code); | 1097 short_system_code); |
1098 } | 1098 } |
1099 | 1099 |
1100 void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id, | 1100 void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id, |
1101 const std::vector<uint8>& message, | 1101 const std::vector<uint8>& message, |
1102 const std::string& default_url) { | 1102 const GURL& destination_url) { |
1103 DCHECK(main_loop_->BelongsToCurrentThread()); | 1103 DCHECK(main_loop_->BelongsToCurrentThread()); |
1104 | 1104 |
1105 const GURL default_url_gurl(default_url); | 1105 DCHECK(destination_url.is_empty() || destination_url.is_valid()); |
1106 DLOG_IF(WARNING, !default_url.empty() && !default_url_gurl.is_valid()) | |
1107 << "Invalid URL in default_url: " << default_url; | |
1108 | 1106 |
1109 client_->keyMessage( | 1107 client_->keyMessage( |
1110 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), | 1108 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), |
1111 WebString::fromUTF8(session_id), | 1109 WebString::fromUTF8(session_id), |
1112 message.empty() ? NULL : &message[0], | 1110 message.empty() ? NULL : &message[0], |
1113 message.size(), | 1111 message.size(), |
1114 default_url_gurl); | 1112 destination_url); |
1115 } | 1113 } |
1116 | 1114 |
1117 void WebMediaPlayerImpl::DataSourceInitialized(const GURL& gurl, bool success) { | 1115 void WebMediaPlayerImpl::DataSourceInitialized(const GURL& gurl, bool success) { |
1118 DCHECK(main_loop_->BelongsToCurrentThread()); | 1116 DCHECK(main_loop_->BelongsToCurrentThread()); |
1119 | 1117 |
1120 if (!success) { | 1118 if (!success) { |
1121 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); | 1119 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); |
1122 | 1120 |
1123 // TODO(scherkus): This should be handled by HTMLMediaElement and controls | 1121 // TODO(scherkus): This should be handled by HTMLMediaElement and controls |
1124 // should know when to invalidate themselves http://crbug.com/337015 | 1122 // should know when to invalidate themselves http://crbug.com/337015 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 compositor_task_runner_->PostTask(FROM_HERE, | 1373 compositor_task_runner_->PostTask(FROM_HERE, |
1376 base::Bind(&GetCurrentFrameAndSignal, | 1374 base::Bind(&GetCurrentFrameAndSignal, |
1377 base::Unretained(compositor_), | 1375 base::Unretained(compositor_), |
1378 &video_frame, | 1376 &video_frame, |
1379 &event)); | 1377 &event)); |
1380 event.Wait(); | 1378 event.Wait(); |
1381 return video_frame; | 1379 return video_frame; |
1382 } | 1380 } |
1383 | 1381 |
1384 } // namespace content | 1382 } // namespace content |
OLD | NEW |