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

Unified Diff: webkit/media/simple_data_source.cc

Issue 8661002: Fire CanPlayThrough immediately for local and streaming media files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix media/event-attributes.html Created 9 years, 1 month 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: webkit/media/simple_data_source.cc
diff --git a/webkit/media/simple_data_source.cc b/webkit/media/simple_data_source.cc
index 16d0a9f6c8d011cfd80d53cdb67b65b33633a5cf..3f38f9b7b424f66d78a3d47d4c950785487f0c82 100644
--- a/webkit/media/simple_data_source.cc
+++ b/webkit/media/simple_data_source.cc
@@ -49,6 +49,7 @@ SimpleDataSource::SimpleDataSource(
frame_(frame),
size_(-1),
single_origin_(true),
+ local_source_(false),
state_(UNINITIALIZED),
keep_test_loader_(false) {
DCHECK(render_loop);
@@ -100,6 +101,9 @@ void SimpleDataSource::Initialize(
return;
}
+ // If scheme is file or data, it is a local source.
+ local_source_ = url_.SchemeIsFile() || url_.SchemeIs(kDataScheme);
+
// Post a task to the render thread to start loading the resource.
render_loop_->PostTask(FROM_HERE,
base::Bind(&SimpleDataSource::StartTask, this));
@@ -146,6 +150,10 @@ void SimpleDataSource::SetPreload(media::Preload preload) {
void SimpleDataSource::SetBitrate(int bitrate) {
}
+bool SimpleDataSource::IsLocalSource() {
+ return local_source_;
+}
+
void SimpleDataSource::SetURLLoaderForTest(WebKit::WebURLLoader* mock_loader) {
url_loader_.reset(mock_loader);
keep_test_loader_ = true;
@@ -352,8 +360,6 @@ void SimpleDataSource::UpdateHostState() {
if (host()) {
host()->SetTotalBytes(size_);
host()->SetBufferedBytes(size_);
- // If scheme is file or data, say we are loaded.
- host()->SetLoaded(url_.SchemeIsFile() || url_.SchemeIs(kDataScheme));
}
}

Powered by Google App Engine
This is Rietveld 408576698