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

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

Issue 10391080: No longer keep a lingering reference to TypedUrlDataTypeController after PSS exits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak. Created 8 years, 7 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.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (channel == chrome::VersionInfo::CHANNEL_STABLE || 149 if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
150 channel == chrome::VersionInfo::CHANNEL_BETA) { 150 channel == chrome::VersionInfo::CHANNEL_BETA) {
151 sync_service_url_ = GURL(kSyncServerUrl); 151 sync_service_url_ = GURL(kSyncServerUrl);
152 } 152 }
153 #endif 153 #endif
154 } 154 }
155 155
156 ProfileSyncService::~ProfileSyncService() { 156 ProfileSyncService::~ProfileSyncService() {
157 sync_prefs_.RemoveSyncPrefObserver(this); 157 sync_prefs_.RemoveSyncPrefObserver(this);
158 Shutdown(); 158 Shutdown();
159 #if defined(NDEBUG)
160 // Make sure there are no dangling references to the DataTypeControllers.
161 for (browser_sync::DataTypeController::TypeMap::const_iterator iter =
162 data_type_controllers_.begin(); iter != data_type_controllers_.end();
163 ++iter) {
164 DCHECK(iter->second->HasOneRef())
Nicolas Zea 2012/05/16 22:40:58 This does not hold true for non-UI thread datatype
165 << "DataTypeController will outlive ProfileSyncService: "
166 << iter->second->name();
167 }
168 #endif
159 } 169 }
160 170
161 bool ProfileSyncService::AreCredentialsAvailable() { 171 bool ProfileSyncService::AreCredentialsAvailable() {
162 if (IsManaged()) { 172 if (IsManaged()) {
163 return false; 173 return false;
164 } 174 }
165 175
166 // If we have start suppressed, then basically just act like we have no 176 // If we have start suppressed, then basically just act like we have no
167 // credentials (login is required to fix this, since we need the user's 177 // credentials (login is required to fix this, since we need the user's
168 // passphrase to encrypt/decrypt anyway). 178 // passphrase to encrypt/decrypt anyway).
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. 1677 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru.
1668 ProfileSyncService* old_this = this; 1678 ProfileSyncService* old_this = this;
1669 this->~ProfileSyncService(); 1679 this->~ProfileSyncService();
1670 new(old_this) ProfileSyncService( 1680 new(old_this) ProfileSyncService(
1671 new ProfileSyncComponentsFactoryImpl(profile, 1681 new ProfileSyncComponentsFactoryImpl(profile,
1672 CommandLine::ForCurrentProcess()), 1682 CommandLine::ForCurrentProcess()),
1673 profile, 1683 profile,
1674 signin, 1684 signin,
1675 behavior); 1685 behavior);
1676 } 1686 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698