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

Unified Diff: chrome/browser/sync/test/integration/profile_sync_service_harness.cc

Issue 2767893002: Remove ScopedVector from chrome/browser/. (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/profile_sync_service_harness.cc
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
index cd187f3b11ec17e29e82f6c00c4c74da98a5739f..ff4bbf11c7b643f3482cb44f3cbd33946ab441a3 100644
--- a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
@@ -11,6 +11,7 @@
#include "base/json/json_writer.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
@@ -98,15 +99,13 @@ class SyncSetupChecker : public SingleClientStatusChangeChecker {
} // namespace
// static
-ProfileSyncServiceHarness* ProfileSyncServiceHarness::Create(
+std::unique_ptr<ProfileSyncServiceHarness> ProfileSyncServiceHarness::Create(
Profile* profile,
const std::string& username,
const std::string& password,
SigninType signin_type) {
- return new ProfileSyncServiceHarness(profile,
- username,
- password,
- signin_type);
+ return base::WrapUnique(
+ new ProfileSyncServiceHarness(profile, username, password, signin_type));
}
ProfileSyncServiceHarness::ProfileSyncServiceHarness(
@@ -290,17 +289,17 @@ bool ProfileSyncServiceHarness::AwaitMutualSyncCycleCompletion(
std::vector<ProfileSyncServiceHarness*> harnesses;
harnesses.push_back(this);
harnesses.push_back(partner);
- return AwaitQuiescence(harnesses);
+ return AwaitQuiescence(std::move(harnesses));
}
bool ProfileSyncServiceHarness::AwaitGroupSyncCycleCompletion(
- const std::vector<ProfileSyncServiceHarness*>& partners) {
- return AwaitQuiescence(partners);
+ std::vector<ProfileSyncServiceHarness*> partners) {
+ return AwaitQuiescence(std::move(partners));
}
// static
bool ProfileSyncServiceHarness::AwaitQuiescence(
- const std::vector<ProfileSyncServiceHarness*>& clients) {
+ std::vector<ProfileSyncServiceHarness*> clients) {
Lei Zhang 2017/03/23 02:59:26 Should this remain a const-ref?
leonhsl(Using Gerrit) 2017/03/23 15:03:17 This function is called by SyncTest::AwaitQuiescen
Nicolas Zea 2017/03/23 23:10:07 Isn't GetSyncClients good enough to access a vecto
leonhsl(Using Gerrit) 2017/03/24 02:23:12 Sorry if I'm misunderstanding the question, do you
Nicolas Zea 2017/03/24 16:48:03 Why do you need to keep a vector member in SyncTes
leonhsl(Using Gerrit) 2017/03/25 14:41:13 Ah,, I see, Thank you! Done.
std::vector<ProfileSyncService*> services;
if (clients.empty()) {
return true;

Powered by Google App Engine
This is Rietveld 408576698