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

Unified Diff: content/renderer/media/android/media_info_loader.cc

Issue 408873004: Fix for cross-origin video check for webgl on android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang warnings Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/android/media_info_loader.cc
diff --git a/content/renderer/media/android/media_info_loader.cc b/content/renderer/media/android/media_info_loader.cc
index a89356f2cf788eebf3b0caa0635420bf36ed3374..3c22389e46e259e06265eb931cd9f29ec40cced1 100644
--- a/content/renderer/media/android/media_info_loader.cc
+++ b/content/renderer/media/android/media_info_loader.cc
@@ -29,6 +29,7 @@ MediaInfoLoader::MediaInfoLoader(
const ReadyCB& ready_cb)
: loader_failed_(false),
url_(url),
+ allow_stored_credentials_(false),
cors_mode_(cors_mode),
single_origin_(true),
ready_cb_(ready_cb) {}
@@ -41,6 +42,7 @@ void MediaInfoLoader::Start(blink::WebFrame* frame) {
CHECK(frame);
start_time_ = base::TimeTicks::Now();
+ first_party_url_ = frame->document().firstPartyForCookies();
// Prepare the request.
WebURLRequest request(url_);
@@ -57,14 +59,17 @@ void MediaInfoLoader::Start(blink::WebFrame* frame) {
options.allowCredentials = true;
options.crossOriginRequestPolicy =
WebURLLoaderOptions::CrossOriginRequestPolicyAllow;
+ allow_stored_credentials_ = true;
} else {
options.exposeAllResponseHeaders = true;
// The author header set is empty, no preflight should go ahead.
options.preflightPolicy = WebURLLoaderOptions::PreventPreflight;
options.crossOriginRequestPolicy =
WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl;
- if (cors_mode_ == blink::WebMediaPlayer::CORSModeUseCredentials)
+ if (cors_mode_ == blink::WebMediaPlayer::CORSModeUseCredentials) {
options.allowCredentials = true;
+ allow_stored_credentials_ = true;
+ }
}
loader.reset(frame->createAssociatedURLLoader(options));
}
@@ -93,6 +98,8 @@ void MediaInfoLoader::willSendRequest(
single_origin_ = url_.GetOrigin() == GURL(newRequest.url()).GetOrigin();
url_ = newRequest.url();
+ first_party_url_ = newRequest.firstPartyForCookies();
+ allow_stored_credentials_ = newRequest.allowStoredCredentials();
}
void MediaInfoLoader::didSendData(
@@ -188,7 +195,8 @@ void MediaInfoLoader::DidBecomeReady(Status status) {
base::TimeTicks::Now() - start_time_);
active_loader_.reset();
if (!ready_cb_.is_null())
- base::ResetAndReturn(&ready_cb_).Run(status);
+ base::ResetAndReturn(&ready_cb_).Run(status, url_, first_party_url_,
+ allow_stored_credentials_);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698