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

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

Issue 2530613003: media: Fix lifetime of InterfaceFactoryImpl and created impls (Closed)
Patch Set: comments addressed Created 4 years 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/optional.h" 10 #include "base/optional.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 void MojoRendererService::InitiateScopedSurfaceRequest( 278 void MojoRendererService::InitiateScopedSurfaceRequest(
279 const InitiateScopedSurfaceRequestCallback& callback) { 279 const InitiateScopedSurfaceRequestCallback& callback) {
280 if (initiate_surface_request_cb_.is_null()) { 280 if (initiate_surface_request_cb_.is_null()) {
281 // |renderer_| is likely not of type MediaPlayerRenderer. 281 // |renderer_| is likely not of type MediaPlayerRenderer.
282 // This is an unexpected call, and the connection should be closed. 282 // This is an unexpected call, and the connection should be closed.
283 mojo::ReportBadMessage("Unexpected call to InitiateScopedSurfaceRequest."); 283 mojo::ReportBadMessage("Unexpected call to InitiateScopedSurfaceRequest.");
284 284
285 // This may cause |this| to be destructed. 285 // This may cause |this| to be destructed.
286 DCHECK(!bad_message_cb_.is_null()); 286 DCHECK(!bad_message_cb_.is_null());
287 bad_message_cb_.Run(); 287 bad_message_cb_.Run();
288
288 return; 289 return;
289 } 290 }
290 291
291 callback.Run(initiate_surface_request_cb_.Run()); 292 callback.Run(initiate_surface_request_cb_.Run());
292 } 293 }
294
293 } // namespace media 295 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698