Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 | 264 |
| 265 callback.Run(success); | 265 callback.Run(success); |
| 266 } | 266 } |
| 267 | 267 |
| 268 void MojoRendererService::InitiateScopedSurfaceRequest( | 268 void MojoRendererService::InitiateScopedSurfaceRequest( |
| 269 const InitiateScopedSurfaceRequestCallback& callback) { | 269 const InitiateScopedSurfaceRequestCallback& callback) { |
| 270 if (initiate_surface_request_cb_.is_null()) { | 270 if (initiate_surface_request_cb_.is_null()) { |
| 271 // |renderer_| is likely not of type MediaPlayerRenderer. | 271 // |renderer_| is likely not of type MediaPlayerRenderer. |
| 272 // This is an unexpected call, and the connection should be closed. | 272 // This is an unexpected call, and the connection should be closed. |
| 273 mojo::ReportBadMessage("Unexpected call to InitiateScopedSurfaceRequest."); | 273 mojo::ReportBadMessage("Unexpected call to InitiateScopedSurfaceRequest."); |
| 274 binding_->Close(); | 274 |
| 275 if (binding_) | |
| 276 binding_->Close(); | |
|
xhwang
2016/11/23 22:27:09
tguilbert:
Today the |binding_| is a StrongBindin
tguilbert
2016/11/23 23:45:06
I originally used a base::Optional<UnguessableToke
xhwang
2016/11/29 10:20:57
tguilbert:
I have a solution to use a bad_message
tguilbert
2016/11/29 19:05:33
We discussed offline. I agree with everything that
| |
| 277 | |
| 275 return; | 278 return; |
| 276 } | 279 } |
| 277 | 280 |
| 278 callback.Run(initiate_surface_request_cb_.Run()); | 281 callback.Run(initiate_surface_request_cb_.Run()); |
| 279 } | 282 } |
| 280 } // namespace media | 283 } // namespace media |
| OLD | NEW |