| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 MediaRouterMojoImpl::~MediaRouterMojoImpl() { | 94 MediaRouterMojoImpl::~MediaRouterMojoImpl() { |
| 95 DCHECK(thread_checker_.CalledOnValidThread()); | 95 DCHECK(thread_checker_.CalledOnValidThread()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 // static | 98 // static |
| 99 void MediaRouterMojoImpl::BindToRequest( | 99 void MediaRouterMojoImpl::BindToRequest( |
| 100 const std::string& extension_id, | 100 const std::string& extension_id, |
| 101 content::BrowserContext* context, | 101 content::BrowserContext* context, |
| 102 mojo::InterfaceRequest<interfaces::MediaRouter> request) { | 102 mojo::InterfaceRequest<interfaces::MediaRouter> request) { |
| 103 MediaRouterMojoImpl* impl = | 103 MediaRouterMojoImpl* impl = static_cast<MediaRouterMojoImpl*>( |
| 104 MediaRouterMojoImplFactory::GetApiForBrowserContext(context); | 104 MediaRouterFactory::GetApiForBrowserContext(context)); |
| 105 DCHECK(impl); | 105 DCHECK(impl); |
| 106 | 106 |
| 107 impl->BindToMojoRequest(request.Pass(), extension_id); | 107 impl->BindToMojoRequest(request.Pass(), extension_id); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void MediaRouterMojoImpl::BindToMojoRequest( | 110 void MediaRouterMojoImpl::BindToMojoRequest( |
| 111 mojo::InterfaceRequest<interfaces::MediaRouter> request, | 111 mojo::InterfaceRequest<interfaces::MediaRouter> request, |
| 112 const std::string& extension_id) { | 112 const std::string& extension_id) { |
| 113 DCHECK(thread_checker_.CalledOnValidThread()); | 113 DCHECK(thread_checker_.CalledOnValidThread()); |
| 114 | 114 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 return; | 471 return; |
| 472 } | 472 } |
| 473 | 473 |
| 474 for (const auto& next_request : pending_requests_) | 474 for (const auto& next_request : pending_requests_) |
| 475 next_request.Run(); | 475 next_request.Run(); |
| 476 | 476 |
| 477 pending_requests_.clear(); | 477 pending_requests_.clear(); |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace media_router | 480 } // namespace media_router |
| OLD | NEW |