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

Side by Side Diff: mash/task_viewer/task_viewer.cc

Issue 2260443002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « mash/browser/browser.cc ('k') | no next file » | 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 "mash/task_viewer/task_viewer.h" 5 #include "mash/task_viewer/task_viewer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 bool ContainsIdentity(const shell::Identity& identity) const { 200 bool ContainsIdentity(const shell::Identity& identity) const {
201 for (auto& it : instances_) { 201 for (auto& it : instances_) {
202 if (it->identity == identity) 202 if (it->identity == identity)
203 return true; 203 return true;
204 } 204 }
205 return false; 205 return false;
206 } 206 }
207 207
208 void InsertInstance(const shell::Identity& identity, uint32_t pid) { 208 void InsertInstance(const shell::Identity& identity, uint32_t pid) {
209 instances_.push_back( 209 instances_.push_back(base::MakeUnique<InstanceInfo>(identity, pid));
210 base::WrapUnique(new InstanceInfo(identity, pid)));
211 } 210 }
212 211
213 void OnGotCatalogEntries(std::vector<catalog::mojom::EntryPtr> entries) { 212 void OnGotCatalogEntries(std::vector<catalog::mojom::EntryPtr> entries) {
214 for (auto it = instances_.begin(); it != instances_.end(); ++it) { 213 for (auto it = instances_.begin(); it != instances_.end(); ++it) {
215 for (auto& entry : entries) { 214 for (auto& entry : entries) {
216 if (entry->name == (*it)->identity.name()) { 215 if (entry->name == (*it)->identity.name()) {
217 (*it)->display_name = entry->display_name; 216 (*it)->display_name = entry->display_name;
218 observer_->OnItemsChanged( 217 observer_->OnItemsChanged(
219 static_cast<int>(it - instances_.begin()), 1); 218 static_cast<int>(it - instances_.begin()), 1);
220 break; 219 break;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 windows_.push_back(window); 324 windows_.push_back(window);
326 } 325 }
327 326
328 void TaskViewer::Create(const shell::Identity& remote_identity, 327 void TaskViewer::Create(const shell::Identity& remote_identity,
329 mojom::LaunchableRequest request) { 328 mojom::LaunchableRequest request) {
330 bindings_.AddBinding(this, std::move(request)); 329 bindings_.AddBinding(this, std::move(request));
331 } 330 }
332 331
333 } // namespace task_viewer 332 } // namespace task_viewer
334 } // namespace main 333 } // namespace main
OLDNEW
« no previous file with comments | « mash/browser/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698