Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: content/renderer/media/webmediaplayer_impl.cc

Issue 179123009: Encrypted Media: Use uint32 for systemCode in SessionError. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 text_track_index_++)); 1055 text_track_index_++));
1056 1056
1057 scoped_ptr<media::TextTrack> text_track( 1057 scoped_ptr<media::TextTrack> text_track(
1058 new TextTrackImpl(main_loop_, client_, web_inband_text_track.Pass())); 1058 new TextTrackImpl(main_loop_, client_, web_inband_text_track.Pass()));
1059 1059
1060 done_cb.Run(text_track.Pass()); 1060 done_cb.Run(text_track.Pass());
1061 } 1061 }
1062 1062
1063 void WebMediaPlayerImpl::OnKeyError(const std::string& session_id, 1063 void WebMediaPlayerImpl::OnKeyError(const std::string& session_id,
1064 media::MediaKeys::KeyError error_code, 1064 media::MediaKeys::KeyError error_code,
1065 int system_code) { 1065 uint32 system_code) {
1066 DCHECK(main_loop_->BelongsToCurrentThread()); 1066 DCHECK(main_loop_->BelongsToCurrentThread());
1067 1067
1068 EmeUMAHistogramEnumeration(current_key_system_, "KeyError", 1068 EmeUMAHistogramEnumeration(current_key_system_, "KeyError",
1069 error_code, media::MediaKeys::kMaxKeyError); 1069 error_code, media::MediaKeys::kMaxKeyError);
1070 1070
1071 unsigned short short_system_code = 0;
1072 if (system_code > std::numeric_limits<unsigned short>::max()) {
1073 LOG(WARNING) << "system_code exceeds unsigned short limit.";
1074 short_system_code = std::numeric_limits<unsigned short>::max();
1075 } else {
1076 short_system_code = static_cast<unsigned short>(system_code);
1077 }
1078
1071 client_->keyError( 1079 client_->keyError(
1072 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), 1080 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)),
1073 WebString::fromUTF8(session_id), 1081 WebString::fromUTF8(session_id),
1074 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), 1082 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code),
1075 system_code); 1083 short_system_code);
1076 } 1084 }
1077 1085
1078 void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id, 1086 void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id,
1079 const std::vector<uint8>& message, 1087 const std::vector<uint8>& message,
1080 const std::string& default_url) { 1088 const std::string& default_url) {
1081 DCHECK(main_loop_->BelongsToCurrentThread()); 1089 DCHECK(main_loop_->BelongsToCurrentThread());
1082 1090
1083 const GURL default_url_gurl(default_url); 1091 const GURL default_url_gurl(default_url);
1084 DLOG_IF(WARNING, !default_url.empty() && !default_url_gurl.is_valid()) 1092 DLOG_IF(WARNING, !default_url.empty() && !default_url_gurl.is_valid())
1085 << "Invalid URL in default_url: " << default_url; 1093 << "Invalid URL in default_url: " << default_url;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 1324
1317 if (web_cdm_) { 1325 if (web_cdm_) {
1318 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); 1326 decryptor_ready_cb.Run(web_cdm_->GetDecryptor());
1319 return; 1327 return;
1320 } 1328 }
1321 1329
1322 decryptor_ready_cb_ = decryptor_ready_cb; 1330 decryptor_ready_cb_ = decryptor_ready_cb;
1323 } 1331 }
1324 1332
1325 } // namespace content 1333 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.h ('k') | content/renderer/pepper/content_decryptor_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698