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

Side by Side Diff: ui/app_list/search/mixer.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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
« no previous file with comments | « ui/app_list/search/history_data_store_unittest.cc ('k') | ui/app_list/search/mixer_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/app_list/search/mixer.h" 5 #include "ui/app_list/search/mixer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 UpdateResult(new_result, ui_result); 313 UpdateResult(new_result, ui_result);
314 ui_result->set_relevance(sort_data.score); 314 ui_result->set_relevance(sort_data.score);
315 315
316 // |ui_results| takes back ownership from |ui_results_map| here. 316 // |ui_results| takes back ownership from |ui_results_map| here.
317 ui_results->Add(ui_result); 317 ui_results->Add(ui_result);
318 318
319 // Remove the item from the map so that it ends up only with unused 319 // Remove the item from the map so that it ends up only with unused
320 // results. 320 // results.
321 ui_results_map.erase(ui_result->id()); 321 ui_results_map.erase(ui_result->id());
322 } else { 322 } else {
323 scoped_ptr<SearchResult> result_copy = new_result.Duplicate(); 323 std::unique_ptr<SearchResult> result_copy = new_result.Duplicate();
324 result_copy->set_relevance(sort_data.score); 324 result_copy->set_relevance(sort_data.score);
325 // Copy the result from |new_results| otherwise. 325 // Copy the result from |new_results| otherwise.
326 ui_results->Add(result_copy.release()); 326 ui_results->Add(result_copy.release());
327 } 327 }
328 } 328 }
329 329
330 // Delete the results remaining in the map as they are not in the new results. 330 // Delete the results remaining in the map as they are not in the new results.
331 for (const auto& ui_result : ui_results_map) { 331 for (const auto& ui_result : ui_results_map) {
332 delete ui_result.second; 332 delete ui_result.second;
333 } 333 }
(...skipping 16 matching lines...) Expand all
350 results->swap(final); 350 results->swap(final);
351 } 351 }
352 352
353 void Mixer::FetchResults(bool is_voice_query, 353 void Mixer::FetchResults(bool is_voice_query,
354 const KnownResults& known_results) { 354 const KnownResults& known_results) {
355 for (auto* group : groups_) 355 for (auto* group : groups_)
356 group->FetchResults(is_voice_query, known_results); 356 group->FetchResults(is_voice_query, known_results);
357 } 357 }
358 358
359 } // namespace app_list 359 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/search/history_data_store_unittest.cc ('k') | ui/app_list/search/mixer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698