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

Side by Side Diff: chrome/browser/ui/webui/media_router/query_result_manager.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months 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
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/ui/webui/media_router/query_result_manager.h" 5 #include "chrome/browser/ui/webui/media_router/query_result_manager.h"
6 6
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/media/router/media_router.h" 9 #include "chrome/browser/media/router/media_router.h"
10 #include "chrome/browser/media/router/media_sinks_observer.h" 10 #include "chrome/browser/media/router/media_sinks_observer.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if (source.Empty()) { 80 if (source.Empty()) {
81 LOG(WARNING) << "StartSinksQuery called with empty source for " 81 LOG(WARNING) << "StartSinksQuery called with empty source for "
82 << cast_mode; 82 << cast_mode;
83 return; 83 return;
84 } 84 }
85 85
86 SetSourceForCastMode(cast_mode, source); 86 SetSourceForCastMode(cast_mode, source);
87 RemoveObserverForCastMode(cast_mode); 87 RemoveObserverForCastMode(cast_mode);
88 UpdateWithSinksQueryResult(cast_mode, std::vector<MediaSink>()); 88 UpdateWithSinksQueryResult(cast_mode, std::vector<MediaSink>());
89 89
90 scoped_ptr<CastModeMediaSinksObserver> observer( 90 std::unique_ptr<CastModeMediaSinksObserver> observer(
91 new CastModeMediaSinksObserver(cast_mode, source, origin, router_, this)); 91 new CastModeMediaSinksObserver(cast_mode, source, origin, router_, this));
92 observer->Init(); 92 observer->Init();
93 auto result = 93 auto result =
94 sinks_observers_.insert(std::make_pair(cast_mode, std::move(observer))); 94 sinks_observers_.insert(std::make_pair(cast_mode, std::move(observer)));
95 DCHECK(result.second); 95 DCHECK(result.second);
96 NotifyOnResultsUpdated(); 96 NotifyOnResultsUpdated();
97 } 97 }
98 98
99 void QueryResultManager::StopSinksQuery(MediaCastMode cast_mode) { 99 void QueryResultManager::StopSinksQuery(MediaCastMode cast_mode) {
100 DCHECK(thread_checker_.CalledOnValidThread()); 100 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 void QueryResultManager::NotifyOnResultsUpdated() { 170 void QueryResultManager::NotifyOnResultsUpdated() {
171 std::vector<MediaSinkWithCastModes> sinks; 171 std::vector<MediaSinkWithCastModes> sinks;
172 for (const auto& sink_pair : all_sinks_) { 172 for (const auto& sink_pair : all_sinks_) {
173 sinks.push_back(sink_pair.second); 173 sinks.push_back(sink_pair.second);
174 } 174 }
175 FOR_EACH_OBSERVER(QueryResultManager::Observer, observers_, 175 FOR_EACH_OBSERVER(QueryResultManager::Observer, observers_,
176 OnResultsUpdated(sinks)); 176 OnResultsUpdated(sinks));
177 } 177 }
178 178
179 } // namespace media_router 179 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/media_router/query_result_manager.h ('k') | chrome/browser/ui/webui/mojo_web_ui_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698