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

Unified Diff: content/renderer/media/buffered_data_source.cc

Issue 306953005: Changing constructor of BufferedDataSource to accept GURL and CORSMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/buffered_data_source.cc
diff --git a/content/renderer/media/buffered_data_source.cc b/content/renderer/media/buffered_data_source.cc
index d0461785f5e5b6e9b79eccee19f4e752da684b31..04c7f9b263ce2bc4c7cce51cbf43806573fa87ec 100644
--- a/content/renderer/media/buffered_data_source.cc
+++ b/content/renderer/media/buffered_data_source.cc
@@ -79,12 +79,15 @@ void BufferedDataSource::ReadOperation::Run(
}
BufferedDataSource::BufferedDataSource(
+ const GURL& url,
+ BufferedResourceLoader::CORSMode cors_mode,
const scoped_refptr<base::MessageLoopProxy>& render_loop,
WebFrame* frame,
media::MediaLog* media_log,
BufferedDataSourceHost* host,
const DownloadingCB& downloading_cb)
- : cors_mode_(BufferedResourceLoader::kUnspecified),
+ : url_(url),
+ cors_mode_(cors_mode),
total_bytes_(kPositionNotSpecified),
assume_fully_buffered_(false),
streaming_(false),
@@ -128,19 +131,14 @@ BufferedResourceLoader* BufferedDataSource::CreateResourceLoader(
media_log_.get());
}
-void BufferedDataSource::Initialize(
- const GURL& url,
- BufferedResourceLoader::CORSMode cors_mode,
- const InitializeCB& init_cb) {
+void BufferedDataSource::Initialize(const InitializeCB& init_cb) {
DCHECK(render_loop_->BelongsToCurrentThread());
DCHECK(!init_cb.is_null());
DCHECK(!loader_.get());
- url_ = url;
- cors_mode_ = cors_mode;
init_cb_ = init_cb;
- if (url_.SchemeIs(url::kHttpScheme) || url_.SchemeIs(url::kHttpsScheme)) {
+ if (url_.SchemeIsHTTPOrHTTPS()) {
// Do an unbounded range request starting at the beginning. If the server
// responds with 200 instead of 206 we'll fall back into a streaming mode.
loader_.reset(CreateResourceLoader(0, kPositionNotSpecified));

Powered by Google App Engine
This is Rietveld 408576698