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

Side by Side Diff: chrome/browser/media/router/media_router_mojo_impl.cc

Issue 1420533008: [Media Router] Set initial sink availability to available in MRMojoImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/media/router/media_router_mojo_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 [](const media_router::MediaRoute& route) { 84 [](const media_router::MediaRoute& route) {
85 return route.is_local(); }) != 85 return route.is_local(); }) !=
86 routes.end(); 86 routes.end();
87 87
88 // |this| will be deleted in UpdateHasLocalRoute() if |has_local_route| is 88 // |this| will be deleted in UpdateHasLocalRoute() if |has_local_route| is
89 // false. Note that ObserverList supports removing an observer while 89 // false. Note that ObserverList supports removing an observer while
90 // iterating through it. 90 // iterating through it.
91 router_->UpdateHasLocalRoute(has_local_route); 91 router_->UpdateHasLocalRoute(has_local_route);
92 } 92 }
93 93
94 // TODO(mfoltz): Flip the default sink availability to UNAVAILABLE, once the
95 // MRPM sends initial availability status.
96 MediaRouterMojoImpl::MediaRouterMojoImpl( 94 MediaRouterMojoImpl::MediaRouterMojoImpl(
97 extensions::EventPageTracker* event_page_tracker) 95 extensions::EventPageTracker* event_page_tracker)
98 : event_page_tracker_(event_page_tracker), 96 : event_page_tracker_(event_page_tracker),
99 instance_id_(base::GenerateGUID()), 97 instance_id_(base::GenerateGUID()),
100 has_local_route_(false), 98 has_local_route_(false),
101 availability_(interfaces::MediaRouter::SINK_AVAILABILITY_AVAILABLE), 99 availability_(interfaces::MediaRouter::SINK_AVAILABILITY_UNAVAILABLE),
102 wakeup_attempt_count_(0), 100 wakeup_attempt_count_(0),
103 weak_factory_(this) { 101 weak_factory_(this) {
104 DCHECK(event_page_tracker_); 102 DCHECK(event_page_tracker_);
105 } 103 }
106 104
107 MediaRouterMojoImpl::~MediaRouterMojoImpl() { 105 MediaRouterMojoImpl::~MediaRouterMojoImpl() {
108 DCHECK(thread_checker_.CalledOnValidThread()); 106 DCHECK(thread_checker_.CalledOnValidThread());
109 107
110 // Make sure |routes_observer_| is destroyed first, because it triggers 108 // Make sure |routes_observer_| is destroyed first, because it triggers
111 // additional cleanup logic in this class that depends on other fields. 109 // additional cleanup logic in this class that depends on other fields.
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 } 778 }
781 779
782 void MediaRouterMojoImpl::DrainPendingRequests() { 780 void MediaRouterMojoImpl::DrainPendingRequests() {
783 DLOG_WITH_INSTANCE(ERROR) 781 DLOG_WITH_INSTANCE(ERROR)
784 << "Draining request queue. (queue-length=" << pending_requests_.size() 782 << "Draining request queue. (queue-length=" << pending_requests_.size()
785 << ")"; 783 << ")";
786 pending_requests_.clear(); 784 pending_requests_.clear();
787 } 785 }
788 786
789 } // namespace media_router 787 } // namespace media_router
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/router/media_router_mojo_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698