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

Side by Side Diff: chrome/browser/sync/internal_api/sync_manager.cc

Issue 7731002: sync: make ServerConnectionManager explicitly NonThreadSafe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initial Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/internal_api/sync_manager.h" 5 #include "chrome/browser/sync/internal_api/sync_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 FROM_HERE, 1274 FROM_HERE,
1275 base::Bind(&SyncInternal::OnIPAddressChangedImpl, 1275 base::Bind(&SyncInternal::OnIPAddressChangedImpl,
1276 weak_ptr_factory_.GetWeakPtr()), 1276 weak_ptr_factory_.GetWeakPtr()),
1277 kChromeOSNetworkChangeReactionDelayHackMsec); 1277 kChromeOSNetworkChangeReactionDelayHackMsec);
1278 #else 1278 #else
1279 OnIPAddressChangedImpl(); 1279 OnIPAddressChangedImpl();
1280 #endif // defined(OS_CHROMEOS) 1280 #endif // defined(OS_CHROMEOS)
1281 } 1281 }
1282 1282
1283 void SyncManager::SyncInternal::OnIPAddressChangedImpl() { 1283 void SyncManager::SyncInternal::OnIPAddressChangedImpl() {
1284 DCHECK(thread_checker_.CalledOnValidThread());
1284 // TODO(akalin): CheckServerReachable() can block, which may cause 1285 // TODO(akalin): CheckServerReachable() can block, which may cause
1285 // jank if we try to shut down sync. Fix this. 1286 // jank if we try to shut down sync. Fix this.
1286 connection_manager()->CheckServerReachable(); 1287 connection_manager()->CheckServerReachable();
1287 } 1288 }
1288 1289
1289 void SyncManager::SyncInternal::OnServerConnectionEvent( 1290 void SyncManager::SyncInternal::OnServerConnectionEvent(
1290 const ServerConnectionEvent& event) { 1291 const ServerConnectionEvent& event) {
lipalani1 2011/08/24 20:35:28 You can add a dcheck here too to be on parity with
1291 allstatus_.HandleServerConnectionEvent(event); 1292 allstatus_.HandleServerConnectionEvent(event);
1292 if (event.connection_code == 1293 if (event.connection_code ==
1293 browser_sync::HttpResponse::SERVER_CONNECTION_OK) { 1294 browser_sync::HttpResponse::SERVER_CONNECTION_OK) {
1294 ObserverList<SyncManager::Observer> temp_obs_list; 1295 ObserverList<SyncManager::Observer> temp_obs_list;
1295 CopyObservers(&temp_obs_list); 1296 CopyObservers(&temp_obs_list);
1296 FOR_EACH_OBSERVER(SyncManager::Observer, temp_obs_list, 1297 FOR_EACH_OBSERVER(SyncManager::Observer, temp_obs_list,
1297 OnAuthError(AuthError::None())); 1298 OnAuthError(AuthError::None()));
1298 } 1299 }
1299 1300
1300 if (event.connection_code == browser_sync::HttpResponse::SYNC_AUTH_ERROR) { 1301 if (event.connection_code == browser_sync::HttpResponse::SYNC_AUTH_ERROR) {
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
2039 2040
2040 for (syncable::ModelTypeSet::const_iterator i = types.begin(); 2041 for (syncable::ModelTypeSet::const_iterator i = types.begin();
2041 i != types.end(); ++i) { 2042 i != types.end(); ++i) {
2042 if (!lookup->initial_sync_ended_for_type(*i)) 2043 if (!lookup->initial_sync_ended_for_type(*i))
2043 return false; 2044 return false;
2044 } 2045 }
2045 return true; 2046 return true;
2046 } 2047 }
2047 2048
2048 } // namespace sync_api 2049 } // namespace sync_api
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698