Chromium Code Reviews| 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" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 int tab_id, | 197 int tab_id, |
| 198 const std::vector<MediaRouteResponseCallback>& callbacks) { | 198 const std::vector<MediaRouteResponseCallback>& callbacks) { |
| 199 DCHECK(thread_checker_.CalledOnValidThread()); | 199 DCHECK(thread_checker_.CalledOnValidThread()); |
| 200 | 200 |
| 201 if (!origin.is_valid()) { | 201 if (!origin.is_valid()) { |
| 202 DVLOG_WITH_INSTANCE(1) << "Invalid origin: " << origin; | 202 DVLOG_WITH_INSTANCE(1) << "Invalid origin: " << origin; |
| 203 for (const MediaRouteResponseCallback& callback : callbacks) | 203 for (const MediaRouteResponseCallback& callback : callbacks) |
| 204 callback.Run(nullptr, "Invalid origin"); | 204 callback.Run(nullptr, "Invalid origin"); |
| 205 return; | 205 return; |
| 206 } | 206 } |
| 207 | |
|
apacible
2015/08/11 18:29:58
remove newline?
haibinlu
2015/08/12 20:32:53
Done.
| |
| 207 RunOrDefer(base::Bind( | 208 RunOrDefer(base::Bind( |
| 208 &MediaRouterMojoImpl::DoCreateRoute, base::Unretained(this), source_id, | 209 &MediaRouterMojoImpl::DoCreateRoute, base::Unretained(this), source_id, |
| 209 sink_id, origin.is_empty() ? "" : origin.spec(), tab_id, callbacks)); | 210 sink_id, origin.is_empty() ? "" : origin.spec(), tab_id, callbacks)); |
| 210 } | 211 } |
| 211 | 212 |
| 212 void MediaRouterMojoImpl::JoinRoute( | 213 void MediaRouterMojoImpl::JoinRoute( |
| 213 const MediaSource::Id& source_id, | 214 const MediaSource::Id& source_id, |
| 214 const std::string& presentation_id, | 215 const std::string& presentation_id, |
| 215 const GURL& origin, | 216 const GURL& origin, |
| 216 int tab_id, | 217 int tab_id, |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 495 return; | 496 return; |
| 496 } | 497 } |
| 497 | 498 |
| 498 for (const auto& next_request : pending_requests_) | 499 for (const auto& next_request : pending_requests_) |
| 499 next_request.Run(); | 500 next_request.Run(); |
| 500 | 501 |
| 501 pending_requests_.clear(); | 502 pending_requests_.clear(); |
| 502 } | 503 } |
| 503 | 504 |
| 504 } // namespace media_router | 505 } // namespace media_router |
| OLD | NEW |