| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/media/router/media_router_mojo_impl.h" | 5 #include "chrome/browser/media/router/media_router_mojo_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/guid.h" | 8 #include "base/guid.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "chrome/browser/media/router/media_router_mojo_impl_factory.h" | 13 #include "chrome/browser/media/router/media_router_factory.h" |
| 14 #include "chrome/browser/media/router/media_router_type_converters.h" | 14 #include "chrome/browser/media/router/media_router_type_converters.h" |
| 15 #include "chrome/browser/media/router/media_routes_observer.h" | 15 #include "chrome/browser/media/router/media_routes_observer.h" |
| 16 #include "chrome/browser/media/router/media_sinks_observer.h" | 16 #include "chrome/browser/media/router/media_sinks_observer.h" |
| 17 #include "extensions/browser/process_manager.h" | 17 #include "extensions/browser/process_manager.h" |
| 18 | 18 |
| 19 #define DVLOG_WITH_INSTANCE(level) \ | 19 #define DVLOG_WITH_INSTANCE(level) \ |
| 20 DVLOG(level) << "MR #" << instance_id_ << ": " | 20 DVLOG(level) << "MR #" << instance_id_ << ": " |
| 21 | 21 |
| 22 #define DLOG_WITH_INSTANCE(level) DLOG(level) << "MR #" << instance_id_ << ": " | 22 #define DLOG_WITH_INSTANCE(level) DLOG(level) << "MR #" << instance_id_ << ": " |
| 23 | 23 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 MediaRouterMojoImpl::~MediaRouterMojoImpl() { | 89 MediaRouterMojoImpl::~MediaRouterMojoImpl() { |
| 90 DCHECK(thread_checker_.CalledOnValidThread()); | 90 DCHECK(thread_checker_.CalledOnValidThread()); |
| 91 } | 91 } |
| 92 | 92 |
| 93 // static | 93 // static |
| 94 void MediaRouterMojoImpl::BindToRequest( | 94 void MediaRouterMojoImpl::BindToRequest( |
| 95 const std::string& extension_id, | 95 const std::string& extension_id, |
| 96 content::BrowserContext* context, | 96 content::BrowserContext* context, |
| 97 mojo::InterfaceRequest<interfaces::MediaRouter> request) { | 97 mojo::InterfaceRequest<interfaces::MediaRouter> request) { |
| 98 MediaRouterMojoImpl* impl = | 98 MediaRouterMojoImpl* impl = static_cast<MediaRouterMojoImpl*>( |
| 99 MediaRouterMojoImplFactory::GetApiForBrowserContext(context); | 99 MediaRouterFactory::GetApiForBrowserContext(context)); |
| 100 DCHECK(impl); | 100 DCHECK(impl); |
| 101 | 101 |
| 102 impl->BindToMojoRequest(request.Pass(), extension_id); | 102 impl->BindToMojoRequest(request.Pass(), extension_id); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void MediaRouterMojoImpl::BindToMojoRequest( | 105 void MediaRouterMojoImpl::BindToMojoRequest( |
| 106 mojo::InterfaceRequest<interfaces::MediaRouter> request, | 106 mojo::InterfaceRequest<interfaces::MediaRouter> request, |
| 107 const std::string& extension_id) { | 107 const std::string& extension_id) { |
| 108 DCHECK(thread_checker_.CalledOnValidThread()); | 108 DCHECK(thread_checker_.CalledOnValidThread()); |
| 109 | 109 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 return; | 464 return; |
| 465 } | 465 } |
| 466 | 466 |
| 467 for (const auto& next_request : pending_requests_) | 467 for (const auto& next_request : pending_requests_) |
| 468 next_request.Run(); | 468 next_request.Run(); |
| 469 | 469 |
| 470 pending_requests_.clear(); | 470 pending_requests_.clear(); |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace media_router | 473 } // namespace media_router |
| OLD | NEW |