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

Unified Diff: content/renderer/media/webmediaplayer_impl.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: removing inline 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
« no previous file with comments | « content/renderer/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: content/renderer/media/webmediaplayer_impl.cc
diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc
index 6aa009a18f401e9d954f6649fbfd9c073f53c634..0bda2f77804736192af34362b634462d946a24d7 100644
--- a/content/renderer/media/webmediaplayer_impl.cc
+++ b/content/renderer/media/webmediaplayer_impl.cc
@@ -167,7 +167,6 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
accelerated_compositing_reported_(false),
incremented_externally_allocated_memory_(false),
gpu_factories_(RenderThreadImpl::current()->GetGpuFactories()),
- is_local_source_(false),
supports_save_(true),
starting_(false),
chunk_demuxer_(NULL),
@@ -318,18 +317,15 @@ void WebMediaPlayerImpl::DoLoad(LoadType load_type,
// Otherwise it's a regular request which requires resolving the URL first.
data_source_.reset(new BufferedDataSource(
+ url,
+ static_cast<BufferedResourceLoader::CORSMode>(cors_mode),
main_loop_,
frame_,
media_log_.get(),
&buffered_data_source_host_,
base::Bind(&WebMediaPlayerImpl::NotifyDownloading, AsWeakPtr())));
data_source_->Initialize(
- url, static_cast<BufferedResourceLoader::CORSMode>(cors_mode),
- base::Bind(
- &WebMediaPlayerImpl::DataSourceInitialized,
- AsWeakPtr(), gurl));
-
- is_local_source_ = !gurl.SchemeIsHTTPOrHTTPS();
+ base::Bind(&WebMediaPlayerImpl::DataSourceInitialized, AsWeakPtr()));
}
void WebMediaPlayerImpl::play() {
@@ -1114,7 +1110,7 @@ void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id,
default_url_gurl);
}
-void WebMediaPlayerImpl::DataSourceInitialized(const GURL& gurl, bool success) {
+void WebMediaPlayerImpl::DataSourceInitialized(bool success) {
DCHECK(main_loop_->BelongsToCurrentThread());
if (!success) {
@@ -1250,8 +1246,8 @@ void WebMediaPlayerImpl::SetReadyState(WebMediaPlayer::ReadyState state) {
DCHECK(main_loop_->BelongsToCurrentThread());
DVLOG(1) << "SetReadyState: " << state;
- if (state == WebMediaPlayer::ReadyStateHaveEnoughData &&
- is_local_source_ &&
+ if (state == WebMediaPlayer::ReadyStateHaveEnoughData && data_source_ &&
+ data_source_->assume_fully_buffered() &&
network_state_ == WebMediaPlayer::NetworkStateLoading)
SetNetworkState(WebMediaPlayer::NetworkStateLoaded);
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698