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

Side by Side Diff: components/history/core/test/history_service_test_util.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/history/core/test/history_service_test_util.h" 5 #include "components/history/core/test/history_service_test_util.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "components/history/core/browser/history_backend.h" 10 #include "components/history/core/browser/history_backend.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (create_db) 52 if (create_db)
53 BlockUntilHistoryProcessesPendingRequests(history_service.get()); 53 BlockUntilHistoryProcessesPendingRequests(history_service.get());
54 return history_service; 54 return history_service;
55 } 55 }
56 56
57 void BlockUntilHistoryProcessesPendingRequests( 57 void BlockUntilHistoryProcessesPendingRequests(
58 HistoryService* history_service) { 58 HistoryService* history_service) {
59 base::RunLoop run_loop; 59 base::RunLoop run_loop;
60 base::CancelableTaskTracker tracker; 60 base::CancelableTaskTracker tracker;
61 history_service->ScheduleDBTask( 61 history_service->ScheduleDBTask(
62 base::WrapUnique(new QuitTask(run_loop.QuitClosure())), &tracker); 62 base::MakeUnique<QuitTask>(run_loop.QuitClosure()), &tracker);
63 run_loop.Run(); 63 run_loop.Run();
64 64
65 // Spin the runloop again until idle. The QuitTask above is destroyed via a 65 // Spin the runloop again until idle. The QuitTask above is destroyed via a
66 // task posted to the current message loop, so spinning allows the task to be 66 // task posted to the current message loop, so spinning allows the task to be
67 // properly destroyed. 67 // properly destroyed.
68 base::RunLoop().RunUntilIdle(); 68 base::RunLoop().RunUntilIdle();
69 } 69 }
70 70
71 } // namespace history 71 } // namespace history
OLDNEW
« no previous file with comments | « components/history/core/test/history_client_fake_bookmarks.cc ('k') | components/invalidation/impl/gcm_invalidation_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698