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

Side by Side Diff: webkit/media/webmediaplayer_impl.cc

Issue 15772012: Separate MediaKeys interface from Decryptor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android Created 7 years, 6 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
« no previous file with comments | « webkit/media/webmediaplayer_impl.h ('k') | webkit/plugins/ppapi/content_decryptor_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "webkit/media/webmediaplayer_impl.h" 5 #include "webkit/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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 WebInbandTextTrackImpl* const text_track = 1004 WebInbandTextTrackImpl* const text_track =
1005 new WebInbandTextTrackImpl(webkind, weblabel, weblanguage, 1005 new WebInbandTextTrackImpl(webkind, weblabel, weblanguage,
1006 text_track_index_++); 1006 text_track_index_++);
1007 GetClient()->addTextTrack(text_track); 1007 GetClient()->addTextTrack(text_track);
1008 1008
1009 return scoped_ptr<media::TextTrack>(new TextTrackImpl(text_track)); 1009 return scoped_ptr<media::TextTrack>(new TextTrackImpl(text_track));
1010 } 1010 }
1011 1011
1012 #define COMPILE_ASSERT_MATCHING_ENUM(name) \ 1012 #define COMPILE_ASSERT_MATCHING_ENUM(name) \
1013 COMPILE_ASSERT(static_cast<int>(WebKit::WebMediaPlayerClient::name) == \ 1013 COMPILE_ASSERT(static_cast<int>(WebKit::WebMediaPlayerClient::name) == \
1014 static_cast<int>(media::Decryptor::k ## name), \ 1014 static_cast<int>(media::MediaKeys::k ## name), \
1015 mismatching_enums) 1015 mismatching_enums)
1016 COMPILE_ASSERT_MATCHING_ENUM(UnknownError); 1016 COMPILE_ASSERT_MATCHING_ENUM(UnknownError);
1017 COMPILE_ASSERT_MATCHING_ENUM(ClientError); 1017 COMPILE_ASSERT_MATCHING_ENUM(ClientError);
1018 COMPILE_ASSERT_MATCHING_ENUM(ServiceError); 1018 COMPILE_ASSERT_MATCHING_ENUM(ServiceError);
1019 COMPILE_ASSERT_MATCHING_ENUM(OutputError); 1019 COMPILE_ASSERT_MATCHING_ENUM(OutputError);
1020 COMPILE_ASSERT_MATCHING_ENUM(HardwareChangeError); 1020 COMPILE_ASSERT_MATCHING_ENUM(HardwareChangeError);
1021 COMPILE_ASSERT_MATCHING_ENUM(DomainError); 1021 COMPILE_ASSERT_MATCHING_ENUM(DomainError);
1022 #undef COMPILE_ASSERT_MATCHING_ENUM 1022 #undef COMPILE_ASSERT_MATCHING_ENUM
1023 1023
1024 void WebMediaPlayerImpl::OnKeyError(const std::string& key_system, 1024 void WebMediaPlayerImpl::OnKeyError(const std::string& key_system,
1025 const std::string& session_id, 1025 const std::string& session_id,
1026 media::Decryptor::KeyError error_code, 1026 media::MediaKeys::KeyError error_code,
1027 int system_code) { 1027 int system_code) {
1028 DCHECK(main_loop_->BelongsToCurrentThread()); 1028 DCHECK(main_loop_->BelongsToCurrentThread());
1029 1029
1030 EmeUMAHistogramEnumeration( 1030 EmeUMAHistogramEnumeration(
1031 key_system, "KeyError", error_code, media::Decryptor::kMaxKeyError); 1031 key_system, "KeyError", error_code, media::MediaKeys::kMaxKeyError);
1032 1032
1033 GetClient()->keyError( 1033 GetClient()->keyError(
1034 WebString::fromUTF8(key_system), 1034 WebString::fromUTF8(key_system),
1035 WebString::fromUTF8(session_id), 1035 WebString::fromUTF8(session_id),
1036 static_cast<WebKit::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), 1036 static_cast<WebKit::WebMediaPlayerClient::MediaKeyErrorCode>(error_code),
1037 system_code); 1037 system_code);
1038 } 1038 }
1039 1039
1040 void WebMediaPlayerImpl::OnKeyMessage(const std::string& key_system, 1040 void WebMediaPlayerImpl::OnKeyMessage(const std::string& key_system,
1041 const std::string& session_id, 1041 const std::string& session_id,
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 1289
1290 if (pending_repaint_) 1290 if (pending_repaint_)
1291 return; 1291 return;
1292 1292
1293 pending_repaint_ = true; 1293 pending_repaint_ = true;
1294 main_loop_->PostTask(FROM_HERE, base::Bind( 1294 main_loop_->PostTask(FROM_HERE, base::Bind(
1295 &WebMediaPlayerImpl::Repaint, AsWeakPtr())); 1295 &WebMediaPlayerImpl::Repaint, AsWeakPtr()));
1296 } 1296 }
1297 1297
1298 } // namespace webkit_media 1298 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/webmediaplayer_impl.h ('k') | webkit/plugins/ppapi/content_decryptor_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698