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

Side by Side Diff: webkit/renderer/media/android/webmediaplayer_android.h

Issue 16327002: android: Implement single origin and CORS check for video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No CORS/redirect check when using media source. 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
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 #ifndef WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 5 #ifndef WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
6 #define WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 6 #define WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "cc/layers/video_frame_provider.h" 15 #include "cc/layers/video_frame_provider.h"
16 #include "media/base/demuxer_stream.h" 16 #include "media/base/demuxer_stream.h"
17 #include "media/base/media_keys.h" 17 #include "media/base/media_keys.h"
18 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 18 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
19 #include "third_party/WebKit/public/platform/WebSize.h" 19 #include "third_party/WebKit/public/platform/WebSize.h"
20 #include "third_party/WebKit/public/platform/WebURL.h" 20 #include "third_party/WebKit/public/platform/WebURL.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h"
22 #include "ui/gfx/rect_f.h" 22 #include "ui/gfx/rect_f.h"
23 #include "webkit/renderer/media/android/media_info_loader_android.h"
23 #include "webkit/renderer/media/android/media_source_delegate.h" 24 #include "webkit/renderer/media/android/media_source_delegate.h"
24 #include "webkit/renderer/media/android/stream_texture_factory_android.h" 25 #include "webkit/renderer/media/android/stream_texture_factory_android.h"
25 #include "webkit/renderer/media/crypto/proxy_decryptor.h" 26 #include "webkit/renderer/media/crypto/proxy_decryptor.h"
26 27
27 namespace media { 28 namespace media {
28 class MediaLog; 29 class MediaLog;
29 } 30 }
30 31
31 namespace WebKit { 32 namespace WebKit {
32 class WebFrame; 33 class WebFrame;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Requesting whether the surface texture peer needs to be reestablished. 238 // Requesting whether the surface texture peer needs to be reestablished.
238 void SetNeedsEstablishPeer(bool needs_establish_peer); 239 void SetNeedsEstablishPeer(bool needs_establish_peer);
239 240
240 #if defined(GOOGLE_TV) 241 #if defined(GOOGLE_TV)
241 // Request external surface for out-of-band composition. 242 // Request external surface for out-of-band composition.
242 void RequestExternalSurface(); 243 void RequestExternalSurface();
243 #endif 244 #endif
244 245
245 private: 246 private:
246 void ReallocateVideoFrame(); 247 void ReallocateVideoFrame();
248 void InitializeProxy(bool is_media_source);
249 void DidLoadMediaInfo(MediaInfoLoaderAndroid::Status status);
247 250
248 #if defined(GOOGLE_TV) 251 #if defined(GOOGLE_TV)
249 // Actually do the work for generateKeyRequest/addKey so they can easily 252 // Actually do the work for generateKeyRequest/addKey so they can easily
250 // report results to UMA. 253 // report results to UMA.
251 MediaKeyException GenerateKeyRequestInternal( 254 MediaKeyException GenerateKeyRequestInternal(
252 const WebKit::WebString& key_system, 255 const WebKit::WebString& key_system,
253 const unsigned char* init_data, 256 const unsigned char* init_data,
254 unsigned init_data_length); 257 unsigned init_data_length);
255 MediaKeyException AddKeyInternal(const WebKit::WebString& key_system, 258 MediaKeyException AddKeyInternal(const WebKit::WebString& key_system,
256 const unsigned char* key, 259 const unsigned char* key,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // destructor. 355 // destructor.
353 WebMediaPlayerProxyAndroid* proxy_; 356 WebMediaPlayerProxyAndroid* proxy_;
354 357
355 // The current playing time. Because the media player is in the browser 358 // The current playing time. Because the media player is in the browser
356 // process, it will regularly update the |current_time_| by calling 359 // process, it will regularly update the |current_time_| by calling
357 // OnTimeUpdate(). 360 // OnTimeUpdate().
358 double current_time_; 361 double current_time_;
359 362
360 media::MediaLog* media_log_; 363 media::MediaLog* media_log_;
361 364
365 scoped_ptr<MediaInfoLoaderAndroid> info_loader_;
366
362 // The currently selected key system. Empty string means that no key system 367 // The currently selected key system. Empty string means that no key system
363 // has been selected. 368 // has been selected.
364 WebKit::WebString current_key_system_; 369 WebKit::WebString current_key_system_;
365 370
366 // Temporary for EME v0.1. In the future the init data type should be passed 371 // Temporary for EME v0.1. In the future the init data type should be passed
367 // through GenerateKeyRequest() directly from WebKit. 372 // through GenerateKeyRequest() directly from WebKit.
368 std::string init_data_type_; 373 std::string init_data_type_;
369 374
370 // The decryptor that manages decryption keys and decrypts encrypted frames. 375 // The decryptor that manages decryption keys and decrypts encrypted frames.
371 scoped_ptr<ProxyDecryptor> decryptor_; 376 scoped_ptr<ProxyDecryptor> decryptor_;
372 377
373 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 378 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
374 }; 379 };
375 380
376 } // namespace webkit_media 381 } // namespace webkit_media
377 382
378 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 383 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698