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

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

Issue 6686061: PipelineError is dead. Long live PipelineStatus! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: responses to 2nd CR Created 9 years, 9 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/glue/media/simple_data_source.cc ('k') | webkit/glue/webmediaplayer_impl.h » ('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/glue/media/web_data_source_factory.h" 5 #include "webkit/glue/media/web_data_source_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace webkit_glue { 9 namespace webkit_glue {
10 10
11 class WebDataSourceFactory::BuildRequest 11 class WebDataSourceFactory::BuildRequest
12 : public media::AsyncDataSourceFactoryBase::BuildRequest { 12 : public media::AsyncDataSourceFactoryBase::BuildRequest {
13 public: 13 public:
14 BuildRequest(const std::string& url, BuildCallback* callback, 14 BuildRequest(const std::string& url, BuildCallback* callback,
15 WebDataSource* data_source, 15 WebDataSource* data_source,
16 WebDataSourceBuildObserverHack* build_observer); 16 WebDataSourceBuildObserverHack* build_observer);
17 virtual ~BuildRequest(); 17 virtual ~BuildRequest();
18 18
19 protected: 19 protected:
20 // AsyncDataSourceFactoryBase::BuildRequest method. 20 // AsyncDataSourceFactoryBase::BuildRequest method.
21 virtual void DoStart(); 21 virtual void DoStart();
22 22
23 private: 23 private:
24 void InitDone(media::PipelineError error); 24 void InitDone(media::PipelineStatus status);
25 25
26 scoped_refptr<WebDataSource> data_source_; 26 scoped_refptr<WebDataSource> data_source_;
27 WebDataSourceBuildObserverHack* build_observer_; 27 WebDataSourceBuildObserverHack* build_observer_;
28 28
29 DISALLOW_COPY_AND_ASSIGN(BuildRequest); 29 DISALLOW_COPY_AND_ASSIGN(BuildRequest);
30 }; 30 };
31 31
32 WebDataSourceFactory::WebDataSourceFactory( 32 WebDataSourceFactory::WebDataSourceFactory(
33 MessageLoop* render_loop, 33 MessageLoop* render_loop,
34 WebKit::WebFrame* frame, 34 WebKit::WebFrame* frame,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 if (data_source_.get()) { 77 if (data_source_.get()) {
78 data_source_->CancelInitialize(); 78 data_source_->CancelInitialize();
79 data_source_ = NULL; 79 data_source_ = NULL;
80 } 80 }
81 } 81 }
82 82
83 void WebDataSourceFactory::BuildRequest::DoStart() { 83 void WebDataSourceFactory::BuildRequest::DoStart() {
84 data_source_->Initialize(url(), NewCallback(this, &BuildRequest::InitDone)); 84 data_source_->Initialize(url(), NewCallback(this, &BuildRequest::InitDone));
85 } 85 }
86 86
87 void WebDataSourceFactory::BuildRequest::InitDone(media::PipelineError error) { 87 void WebDataSourceFactory::BuildRequest::InitDone(
88 media::PipelineStatus status) {
88 scoped_refptr<WebDataSource> data_source; 89 scoped_refptr<WebDataSource> data_source;
89 90
90 data_source = (error == media::PIPELINE_OK) ? data_source_ : NULL; 91 data_source = (status == media::PIPELINE_OK) ? data_source_ : NULL;
91 data_source_ = NULL; 92 data_source_ = NULL;
92 93
93 if (build_observer_ && data_source.get()) { 94 if (build_observer_ && data_source.get()) {
94 build_observer_->Run(data_source.get()); 95 build_observer_->Run(data_source.get());
95 } 96 }
96 97
97 RequestComplete(error, data_source); 98 RequestComplete(status, data_source);
98 // Don't do anything after this line. This object is deleted by 99 // Don't do anything after this line. This object is deleted by
99 // RequestComplete(). 100 // RequestComplete().
100 } 101 }
101 102
102 } // namespace webkit_glue 103 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/media/simple_data_source.cc ('k') | webkit/glue/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698