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

Side by Side Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 11886079: Revert 177136 due to memory error on Mac ASAN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync/profile_sync_service_harness.h" 5 #include "chrome/browser/sync/profile_sync_service_harness.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <iterator> 8 #include <iterator>
9 #include <ostream> 9 #include <ostream>
10 #include <set> 10 #include <set>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 waiting_for_status_change_(false) { 114 waiting_for_status_change_(false) {
115 if (IsSyncAlreadySetup()) { 115 if (IsSyncAlreadySetup()) {
116 service_ = ProfileSyncServiceFactory::GetInstance()->GetForProfile( 116 service_ = ProfileSyncServiceFactory::GetInstance()->GetForProfile(
117 profile_); 117 profile_);
118 service_->AddObserver(this); 118 service_->AddObserver(this);
119 ignore_result(TryListeningToMigrationEvents()); 119 ignore_result(TryListeningToMigrationEvents());
120 wait_state_ = FULLY_SYNCED; 120 wait_state_ = FULLY_SYNCED;
121 } 121 }
122 } 122 }
123 123
124 ProfileSyncServiceHarness::~ProfileSyncServiceHarness() { 124 ProfileSyncServiceHarness::~ProfileSyncServiceHarness() {}
125 if (service_->HasObserver(this))
126 service_->RemoveObserver(this);
127 }
128 125
129 // static 126 // static
130 ProfileSyncServiceHarness* ProfileSyncServiceHarness::CreateAndAttach( 127 ProfileSyncServiceHarness* ProfileSyncServiceHarness::CreateAndAttach(
131 Profile* profile) { 128 Profile* profile) {
132 ProfileSyncServiceFactory* f = ProfileSyncServiceFactory::GetInstance(); 129 ProfileSyncServiceFactory* f = ProfileSyncServiceFactory::GetInstance();
133 if (!f->HasProfileSyncService(profile)) { 130 if (!f->HasProfileSyncService(profile)) {
134 NOTREACHED() << "Profile has never signed into sync."; 131 NOTREACHED() << "Profile has never signed into sync.";
135 return NULL; 132 return NULL;
136 } 133 }
137 return new ProfileSyncServiceHarness(profile, "", ""); 134 return new ProfileSyncServiceHarness(profile, "", "");
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 1122
1126 std::string ProfileSyncServiceHarness::GetServiceStatus() { 1123 std::string ProfileSyncServiceHarness::GetServiceStatus() {
1127 scoped_ptr<DictionaryValue> value( 1124 scoped_ptr<DictionaryValue> value(
1128 sync_ui_util::ConstructAboutInformation(service_)); 1125 sync_ui_util::ConstructAboutInformation(service_));
1129 std::string service_status; 1126 std::string service_status;
1130 base::JSONWriter::WriteWithOptions(value.get(), 1127 base::JSONWriter::WriteWithOptions(value.get(),
1131 base::JSONWriter::OPTIONS_PRETTY_PRINT, 1128 base::JSONWriter::OPTIONS_PRETTY_PRINT,
1132 &service_status); 1129 &service_status);
1133 return service_status; 1130 return service_status;
1134 } 1131 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698