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

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

Issue 23072043: Change NeedKeyCB to use std::vector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 916
917 void WebMediaPlayerImpl::OnKeyAdded(const std::string& session_id) { 917 void WebMediaPlayerImpl::OnKeyAdded(const std::string& session_id) {
918 DCHECK(main_loop_->BelongsToCurrentThread()); 918 DCHECK(main_loop_->BelongsToCurrentThread());
919 EmeUMAHistogramCounts(current_key_system_, "KeyAdded", 1); 919 EmeUMAHistogramCounts(current_key_system_, "KeyAdded", 1);
920 GetClient()->keyAdded(current_key_system_, 920 GetClient()->keyAdded(current_key_system_,
921 WebString::fromUTF8(session_id)); 921 WebString::fromUTF8(session_id));
922 } 922 }
923 923
924 void WebMediaPlayerImpl::OnNeedKey(const std::string& session_id, 924 void WebMediaPlayerImpl::OnNeedKey(const std::string& session_id,
925 const std::string& type, 925 const std::string& type,
926 scoped_ptr<uint8[]> init_data, 926 const std::vector<uint8>& init_data) {
927 int init_data_size) {
928 DCHECK(main_loop_->BelongsToCurrentThread()); 927 DCHECK(main_loop_->BelongsToCurrentThread());
929 928
930 // Do not fire NeedKey event if encrypted media is not enabled. 929 // Do not fire NeedKey event if encrypted media is not enabled.
931 if (!decryptor_) 930 if (!decryptor_)
932 return; 931 return;
933 932
934 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1); 933 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1);
935 934
936 DCHECK(init_data_type_.empty() || type.empty() || type == init_data_type_); 935 DCHECK(init_data_type_.empty() || type.empty() || type == init_data_type_);
937 if (init_data_type_.empty()) 936 if (init_data_type_.empty())
938 init_data_type_ = type; 937 init_data_type_ = type;
939 938
940 GetClient()->keyNeeded(WebString(), 939 GetClient()->keyNeeded(WebString(),
941 WebString::fromUTF8(session_id), 940 WebString::fromUTF8(session_id),
942 init_data.get(), 941 &init_data[0],
xhwang 2013/08/23 17:24:37 ditto
acolwell GONE FROM CHROMIUM 2013/08/23 19:55:28 Done.
943 init_data_size); 942 init_data.size());
944 } 943 }
945 944
946 scoped_ptr<media::TextTrack> 945 scoped_ptr<media::TextTrack>
947 WebMediaPlayerImpl::OnTextTrack(media::TextKind kind, 946 WebMediaPlayerImpl::OnTextTrack(media::TextKind kind,
948 const std::string& label, 947 const std::string& label,
949 const std::string& language) { 948 const std::string& language) {
950 typedef WebInbandTextTrackImpl::Kind webkind_t; 949 typedef WebInbandTextTrackImpl::Kind webkind_t;
951 const webkind_t webkind = static_cast<webkind_t>(kind); 950 const webkind_t webkind = static_cast<webkind_t>(kind);
952 const WebKit::WebString weblabel = WebKit::WebString::fromUTF8(label); 951 const WebKit::WebString weblabel = WebKit::WebString::fromUTF8(label);
953 const WebKit::WebString weblanguage = WebKit::WebString::fromUTF8(language); 952 const WebKit::WebString weblanguage = WebKit::WebString::fromUTF8(language);
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 1236
1238 if (pending_repaint_) 1237 if (pending_repaint_)
1239 return; 1238 return;
1240 1239
1241 pending_repaint_ = true; 1240 pending_repaint_ = true;
1242 main_loop_->PostTask(FROM_HERE, base::Bind( 1241 main_loop_->PostTask(FROM_HERE, base::Bind(
1243 &WebMediaPlayerImpl::Repaint, AsWeakPtr())); 1242 &WebMediaPlayerImpl::Repaint, AsWeakPtr()));
1244 } 1243 }
1245 1244
1246 } // namespace content 1245 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698