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

Side by Side Diff: Source/web/WebMediaPlayerClientImpl.cpp

Issue 950813005: Change initDataType and sessionType to be enums (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: android compile issues Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "config.h" 5 #include "config.h"
6 #include "web/WebMediaPlayerClientImpl.h" 6 #include "web/WebMediaPlayerClientImpl.h"
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/html/HTMLMediaElement.h" 9 #include "core/html/HTMLMediaElement.h"
10 #include "core/html/TimeRanges.h" 10 #include "core/html/TimeRanges.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 void WebMediaPlayerClientImpl::keyError(const WebString& keySystem, const WebStr ing& sessionId, MediaKeyErrorCode errorCode, unsigned short systemCode) 116 void WebMediaPlayerClientImpl::keyError(const WebString& keySystem, const WebStr ing& sessionId, MediaKeyErrorCode errorCode, unsigned short systemCode)
117 { 117 {
118 HTMLMediaElementEncryptedMedia::keyError(mediaElement(), keySystem, sessionI d, errorCode, systemCode); 118 HTMLMediaElementEncryptedMedia::keyError(mediaElement(), keySystem, sessionI d, errorCode, systemCode);
119 } 119 }
120 120
121 void WebMediaPlayerClientImpl::keyMessage(const WebString& keySystem, const WebS tring& sessionId, const unsigned char* message, unsigned messageLength, const We bURL& defaultURL) 121 void WebMediaPlayerClientImpl::keyMessage(const WebString& keySystem, const WebS tring& sessionId, const unsigned char* message, unsigned messageLength, const We bURL& defaultURL)
122 { 122 {
123 HTMLMediaElementEncryptedMedia::keyMessage(mediaElement(), keySystem, sessio nId, message, messageLength, defaultURL); 123 HTMLMediaElementEncryptedMedia::keyMessage(mediaElement(), keySystem, sessio nId, message, messageLength, defaultURL);
124 } 124 }
125 125
126 void WebMediaPlayerClientImpl::encrypted(WebEncryptedMediaInitDataType initDataT ype, const unsigned char* initData, unsigned initDataLength)
127 {
128 HTMLMediaElementEncryptedMedia::encrypted(mediaElement(), initDataType, init Data, initDataLength);
129 }
130
131 // FIXME: Remove this once Chromium updated to use enum type.
126 void WebMediaPlayerClientImpl::encrypted(const WebString& initDataType, const un signed char* initData, unsigned initDataLength) 132 void WebMediaPlayerClientImpl::encrypted(const WebString& initDataType, const un signed char* initData, unsigned initDataLength)
127 { 133 {
128 HTMLMediaElementEncryptedMedia::encrypted(mediaElement(), initDataType, init Data, initDataLength); 134 WebEncryptedMediaInitDataType newInitDataType;
135 if (initDataType == "cenc") {
136 newInitDataType = WebEncryptedMediaInitDataType::Cenc;
137 } else if (initDataType == "webm") {
138 newInitDataType = WebEncryptedMediaInitDataType::Webm;
139 } else if (initDataType == "keyids") {
140 newInitDataType = WebEncryptedMediaInitDataType::Keyids;
141 } else {
142 newInitDataType = WebEncryptedMediaInitDataType::Unknown;
143 }
144 HTMLMediaElementEncryptedMedia::encrypted(mediaElement(), newInitDataType, i nitData, initDataLength);
129 } 145 }
130 146
131 void WebMediaPlayerClientImpl::didBlockPlaybackWaitingForKey() 147 void WebMediaPlayerClientImpl::didBlockPlaybackWaitingForKey()
132 { 148 {
133 HTMLMediaElementEncryptedMedia::didBlockPlaybackWaitingForKey(mediaElement() ); 149 HTMLMediaElementEncryptedMedia::didBlockPlaybackWaitingForKey(mediaElement() );
134 } 150 }
135 151
136 void WebMediaPlayerClientImpl::didResumePlaybackBlockedForKey() 152 void WebMediaPlayerClientImpl::didResumePlaybackBlockedForKey()
137 { 153 {
138 HTMLMediaElementEncryptedMedia::didResumePlaybackBlockedForKey(mediaElement( )); 154 HTMLMediaElementEncryptedMedia::didResumePlaybackBlockedForKey(mediaElement( ));
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 335 }
320 336
321 DEFINE_TRACE(WebMediaPlayerClientImpl::AudioClientImpl) 337 DEFINE_TRACE(WebMediaPlayerClientImpl::AudioClientImpl)
322 { 338 {
323 visitor->trace(m_client); 339 visitor->trace(m_client);
324 } 340 }
325 341
326 #endif 342 #endif
327 343
328 } // namespace blink 344 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebMediaPlayerClientImpl.h ('k') | public/platform/WebContentDecryptionModuleSession.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698