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

Unified Diff: webkit/media/webmediaplayer_impl.cc

Issue 10543007: Add CORS-awareness to HTML5 media elements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 side-by-side diff with in-line comments
Download patch
« webkit/media/webmediaplayer_impl.h ('K') | « webkit/media/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/webmediaplayer_impl.cc
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc
index 84c48c8e53b6d29af3a781c41179c29125393053..441ffb6493ff70e3fdd7a1cc0c2937e3ba1a911e 100644
--- a/webkit/media/webmediaplayer_impl.cc
+++ b/webkit/media/webmediaplayer_impl.cc
@@ -81,6 +81,15 @@ const float kMaxRate = 16.0f;
namespace webkit_media {
+#define COMPILE_ASSERT_MATCHING_ENUM(name) \
+ COMPILE_ASSERT(static_cast<int>(WebKit::WebMediaPlayer::name) == \
+ static_cast<int>(BufferedResourceLoader::k ## name), \
+ mismatching_enums)
+COMPILE_ASSERT_MATCHING_ENUM(Unspecified);
+COMPILE_ASSERT_MATCHING_ENUM(Anonymous);
+COMPILE_ASSERT_MATCHING_ENUM(UseCredentials);
+#undef COMPILE_ASSERT_MATCHING_ENUM
+
WebMediaPlayerImpl::WebMediaPlayerImpl(
WebKit::WebFrame* frame,
WebKit::WebMediaPlayerClient* client,
@@ -198,6 +207,11 @@ URLSchemeForHistogram URLScheme(const GURL& url) {
} // anonymous namespace
void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
+ load(url, Unspecified);
+}
+
+void WebMediaPlayerImpl::load(const WebKit::WebURL& url,
+ CrossOriginAttribute cross_origin_attribute) {
DCHECK_EQ(main_loop_, MessageLoop::current());
GURL gurl(url);
@@ -215,6 +229,7 @@ void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
if (BuildMediaStreamCollection(url, media_stream_client_,
message_loop_factory_.get(),
filter_collection_.get())) {
+ DCHECK_EQ(cross_origin_attribute, Unspecified);
scherkus (not reviewing) 2012/06/06 00:44:36 so adding a crossorigin attribute to a media strea
Ami GONE FROM CHROMIUM 2012/06/06 00:59:29 Done.
StartPipeline();
return;
}
@@ -225,6 +240,7 @@ void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
message_loop_factory_.get(),
filter_collection_.get(),
&video_decoder)) {
+ DCHECK_EQ(cross_origin_attribute, Unspecified);
proxy_->set_video_decoder(video_decoder);
StartPipeline();
return;
@@ -233,9 +249,12 @@ void WebMediaPlayerImpl::load(const WebKit::WebURL& url) {
// Otherwise it's a regular request which requires resolving the URL first.
proxy_->set_data_source(
new BufferedDataSource(main_loop_, frame_, media_log_));
- proxy_->data_source()->Initialize(url, base::Bind(
- &WebMediaPlayerImpl::DataSourceInitialized,
- base::Unretained(this), gurl));
+ proxy_->data_source()->Initialize(
+ url, static_cast<BufferedResourceLoader::CrossOriginAttribute>(
+ cross_origin_attribute),
+ base::Bind(
+ &WebMediaPlayerImpl::DataSourceInitialized,
+ base::Unretained(this), gurl));
is_local_source_ = !gurl.SchemeIs("http") && !gurl.SchemeIs("https");
@@ -362,6 +381,7 @@ void WebMediaPlayerImpl::setVisible(bool visible) {
COMPILE_ASSERT_MATCHING_ENUM(PreloadNone, NONE);
COMPILE_ASSERT_MATCHING_ENUM(PreloadMetaData, METADATA);
COMPILE_ASSERT_MATCHING_ENUM(PreloadAuto, AUTO);
+#undef COMPILE_ASSERT_MATCHING_ENUM
void WebMediaPlayerImpl::setPreload(WebMediaPlayer::Preload preload) {
DCHECK_EQ(main_loop_, MessageLoop::current());
« webkit/media/webmediaplayer_impl.h ('K') | « webkit/media/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698