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

Side by Side Diff: webkit/media/web_data_source_factory.cc

Issue 9015015: Take advantage of the new Pass() machinery on scoped_ptr{,_malloc}. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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
« no previous file with comments | « webkit/media/web_data_source_factory.h ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/media/web_data_source_factory.h" 5 #include "webkit/media/web_data_source_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "media/base/media_log.h" 9 #include "media/base/media_log.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 factory_function_(factory_function), 43 factory_function_(factory_function),
44 build_observer_(build_observer) { 44 build_observer_(build_observer) {
45 DCHECK(render_loop_); 45 DCHECK(render_loop_);
46 DCHECK(frame_); 46 DCHECK(frame_);
47 DCHECK(media_log_); 47 DCHECK(media_log_);
48 DCHECK(factory_function_); 48 DCHECK(factory_function_);
49 } 49 }
50 50
51 WebDataSourceFactory::~WebDataSourceFactory() {} 51 WebDataSourceFactory::~WebDataSourceFactory() {}
52 52
53 media::DataSourceFactory* WebDataSourceFactory::Clone() const { 53 scoped_ptr<media::DataSourceFactory> WebDataSourceFactory::Clone() const {
54 return new WebDataSourceFactory(render_loop_, frame_, media_log_, 54 return scoped_ptr<media::DataSourceFactory>(new WebDataSourceFactory(
55 factory_function_, build_observer_); 55 render_loop_, frame_, media_log_, factory_function_, build_observer_));
56 } 56 }
57 57
58 bool WebDataSourceFactory::AllowRequests() const { 58 bool WebDataSourceFactory::AllowRequests() const {
59 return true; 59 return true;
60 } 60 }
61 61
62 media::AsyncDataSourceFactoryBase::BuildRequest* 62 media::AsyncDataSourceFactoryBase::BuildRequest*
63 WebDataSourceFactory::CreateRequest(const std::string& url, 63 WebDataSourceFactory::CreateRequest(const std::string& url,
64 const BuildCallback& callback) { 64 const BuildCallback& callback) {
65 WebDataSource* data_source = factory_function_(render_loop_, frame_, 65 WebDataSource* data_source = factory_function_(render_loop_, frame_,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (!build_observer_.is_null() && data_source.get()) { 101 if (!build_observer_.is_null() && data_source.get()) {
102 build_observer_.Run(data_source.get()); 102 build_observer_.Run(data_source.get());
103 } 103 }
104 104
105 RequestComplete(status, data_source); 105 RequestComplete(status, data_source);
106 // Don't do anything after this line. This object is deleted by 106 // Don't do anything after this line. This object is deleted by
107 // RequestComplete(). 107 // RequestComplete().
108 } 108 }
109 109
110 } // namespace webkit_media 110 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/web_data_source_factory.h ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698