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

Side by Side Diff: chrome/renderer/media/data_source_impl.cc

Issue 9712: AppCachePlumbing (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "chrome/renderer/media/data_source_impl.h" 8 #include "chrome/renderer/media/data_source_impl.h"
9 #include "chrome/renderer/render_view.h" 9 #include "chrome/renderer/render_view.h"
10 #include "chrome/renderer/webmediaplayer_delegate_impl.h" 10 #include "chrome/renderer/webmediaplayer_delegate_impl.h"
11 #include "chrome/renderer/render_thread.h" 11 #include "chrome/renderer/render_thread.h"
12 #include "media/base/filter_host.h" 12 #include "media/base/filter_host.h"
13 #include "media/base/pipeline.h" 13 #include "media/base/pipeline.h"
14 #include "net/base/load_flags.h" 14 #include "net/base/load_flags.h"
15 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
16 #include "webkit/glue/webappcachecontext.h"
16 17
17 DataSourceImpl::DataSourceImpl(WebMediaPlayerDelegateImpl* delegate) 18 DataSourceImpl::DataSourceImpl(WebMediaPlayerDelegateImpl* delegate)
18 : delegate_(delegate), 19 : delegate_(delegate),
19 render_loop_(RenderThread::current()->message_loop()), 20 render_loop_(RenderThread::current()->message_loop()),
20 stopped_(false), 21 stopped_(false),
21 download_event_(false, false), 22 download_event_(false, false),
22 downloaded_bytes_(0), 23 downloaded_bytes_(0),
23 total_bytes_(0), 24 total_bytes_(0),
24 total_bytes_known_(false), 25 total_bytes_known_(false),
25 download_completed_(false), 26 download_completed_(false),
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 "null", // TODO(abarth): provide frame_origin 207 "null", // TODO(abarth): provide frame_origin
207 "null", // TODO(abarth): provide main_frame_origin 208 "null", // TODO(abarth): provide main_frame_origin
208 std::string(), // Provide no header. 209 std::string(), // Provide no header.
209 "", // default_mime_type 210 "", // default_mime_type
210 // Prefer to load from cache, also enable downloading the file, the 211 // Prefer to load from cache, also enable downloading the file, the
211 // resource will be saved to a single response data file if it's possible. 212 // resource will be saved to a single response data file if it's possible.
212 net::LOAD_PREFERRING_CACHE | net::LOAD_ENABLE_DOWNLOAD_FILE, 213 net::LOAD_PREFERRING_CACHE | net::LOAD_ENABLE_DOWNLOAD_FILE,
213 base::GetCurrentProcId(), 214 base::GetCurrentProcId(),
214 ResourceType::MEDIA, 215 ResourceType::MEDIA,
215 0, 216 0,
217 // TODO(michaeln): delegate->mediaplayer->frame->
218 // app_cache_context()->context_id()
219 // For now don't service media resource requests from the appcache.
220 WebAppCacheContext::kNoAppCacheContextId,
216 delegate_->view()->routing_id()); 221 delegate_->view()->routing_id());
217 // Start the resource loading. 222 // Start the resource loading.
218 resource_loader_bridge_->Start(this); 223 resource_loader_bridge_->Start(this);
219 } 224 }
220 225
221 void DataSourceImpl::ReleaseResources(bool render_thread_is_dying) { 226 void DataSourceImpl::ReleaseResources(bool render_thread_is_dying) {
222 DCHECK(MessageLoop::current() == render_loop_); 227 DCHECK(MessageLoop::current() == render_loop_);
223 if (render_thread_is_dying) { 228 if (render_thread_is_dying) {
224 // If render thread is dying we can't call cancel on this pointer, we will 229 // If render thread is dying we can't call cancel on this pointer, we will
225 // just let this object leak. 230 // just let this object leak.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 306 }
302 } 307 }
303 308
304 std::string DataSourceImpl::GetURLForDebugging() { 309 std::string DataSourceImpl::GetURLForDebugging() {
305 return uri_; 310 return uri_;
306 } 311 }
307 312
308 const media::MediaFormat& DataSourceImpl::media_format() { 313 const media::MediaFormat& DataSourceImpl::media_format() {
309 return media_format_; 314 return media_format_;
310 } 315 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698