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 DLOG_IF(WARNING, !destination_url.is_empty() && !destination_url.is_valid()) |
1106 DLOG_IF(WARNING, !default_url.empty() && !default_url_gurl.is_valid()) | 1106 << "Invalid URL in destination_url: " << destination_url.spec(); |
xhwang
2014/05/29 16:17:44
Since we verified |destination_url| upstream (in t
| |
1107 << "Invalid URL in default_url: " << default_url; | |
1108 | 1107 |
1109 client_->keyMessage( | 1108 client_->keyMessage( |
1110 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), | 1109 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), |
1111 WebString::fromUTF8(session_id), | 1110 WebString::fromUTF8(session_id), |
1112 message.empty() ? NULL : &message[0], | 1111 message.empty() ? NULL : &message[0], |
1113 message.size(), | 1112 message.size(), |
1114 default_url_gurl); | 1113 destination_url); |
1115 } | 1114 } |
1116 | 1115 |
1117 void WebMediaPlayerImpl::DataSourceInitialized(const GURL& gurl, bool success) { | 1116 void WebMediaPlayerImpl::DataSourceInitialized(const GURL& gurl, bool success) { |
1118 DCHECK(main_loop_->BelongsToCurrentThread()); | 1117 DCHECK(main_loop_->BelongsToCurrentThread()); |
1119 | 1118 |
1120 if (!success) { | 1119 if (!success) { |
1121 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); | 1120 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); |
1122 | 1121 |
1123 // TODO(scherkus): This should be handled by HTMLMediaElement and controls | 1122 // TODO(scherkus): This should be handled by HTMLMediaElement and controls |
1124 // should know when to invalidate themselves http://crbug.com/337015 | 1123 // 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, | 1374 compositor_task_runner_->PostTask(FROM_HERE, |
1376 base::Bind(&GetCurrentFrameAndSignal, | 1375 base::Bind(&GetCurrentFrameAndSignal, |
1377 base::Unretained(compositor_), | 1376 base::Unretained(compositor_), |
1378 &video_frame, | 1377 &video_frame, |
1379 &event)); | 1378 &event)); |
1380 event.Wait(); | 1379 event.Wait(); |
1381 return video_frame; | 1380 return video_frame; |
1382 } | 1381 } |
1383 | 1382 |
1384 } // namespace content | 1383 } // namespace content |
OLD | NEW |