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

Side by Side Diff: media/mojo/services/mojo_renderer_service.cc

Issue 870693002: Require Renderer::Initialize() to return a status code via callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/mojo/services/mojo_renderer_service.h" 5 #include "media/mojo/services/mojo_renderer_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 base::Bind( 118 base::Bind(
119 &MojoRendererService::OnRendererInitializeDone, weak_this_, callback), 119 &MojoRendererService::OnRendererInitializeDone, weak_this_, callback),
120 base::Bind(&MojoRendererService::OnUpdateStatistics, weak_this_), 120 base::Bind(&MojoRendererService::OnUpdateStatistics, weak_this_),
121 base::Bind(&MojoRendererService::OnBufferingStateChanged, weak_this_), 121 base::Bind(&MojoRendererService::OnBufferingStateChanged, weak_this_),
122 base::Bind(&PaintNothing), 122 base::Bind(&PaintNothing),
123 base::Bind(&MojoRendererService::OnRendererEnded, weak_this_), 123 base::Bind(&MojoRendererService::OnRendererEnded, weak_this_),
124 base::Bind(&MojoRendererService::OnError, weak_this_)); 124 base::Bind(&MojoRendererService::OnError, weak_this_));
125 } 125 }
126 126
127 void MojoRendererService::OnRendererInitializeDone( 127 void MojoRendererService::OnRendererInitializeDone(
128 const mojo::Closure& callback) { 128 const mojo::Closure& callback, PipelineStatus status) {
129 DVLOG(1) << __FUNCTION__; 129 DVLOG(1) << __FUNCTION__;
130 130
131 if (status != PIPELINE_OK && state_ != STATE_ERROR)
132 OnError(status);
133
131 if (state_ == STATE_ERROR) { 134 if (state_ == STATE_ERROR) {
132 renderer_.reset(); 135 renderer_.reset();
133 } else { 136 } else {
134 DCHECK_EQ(state_, STATE_INITIALIZING); 137 DCHECK_EQ(state_, STATE_INITIALIZING);
135 state_ = STATE_PLAYING; 138 state_ = STATE_PLAYING;
136 } 139 }
137 140
138 callback.Run(); 141 callback.Run();
139 } 142 }
140 143
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 186 }
184 187
185 void MojoRendererService::OnFlushCompleted(const mojo::Closure& callback) { 188 void MojoRendererService::OnFlushCompleted(const mojo::Closure& callback) {
186 DVLOG(1) << __FUNCTION__; 189 DVLOG(1) << __FUNCTION__;
187 DCHECK_EQ(state_, STATE_FLUSHING); 190 DCHECK_EQ(state_, STATE_FLUSHING);
188 state_ = STATE_PLAYING; 191 state_ = STATE_PLAYING;
189 callback.Run(); 192 callback.Run();
190 } 193 }
191 194
192 } // namespace media 195 } // namespace media
OLDNEW
« media/filters/renderer_impl.cc ('K') | « media/mojo/services/mojo_renderer_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698