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

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: dcheck Created 9 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 | 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) {
1292 DCHECK(thread_checker_.CalledOnValidThread());
1291 allstatus_.HandleServerConnectionEvent(event); 1293 allstatus_.HandleServerConnectionEvent(event);
1292 if (event.connection_code == 1294 if (event.connection_code ==
1293 browser_sync::HttpResponse::SERVER_CONNECTION_OK) { 1295 browser_sync::HttpResponse::SERVER_CONNECTION_OK) {
1294 ObserverList<SyncManager::Observer> temp_obs_list; 1296 ObserverList<SyncManager::Observer> temp_obs_list;
1295 CopyObservers(&temp_obs_list); 1297 CopyObservers(&temp_obs_list);
1296 FOR_EACH_OBSERVER(SyncManager::Observer, temp_obs_list, 1298 FOR_EACH_OBSERVER(SyncManager::Observer, temp_obs_list,
1297 OnAuthError(AuthError::None())); 1299 OnAuthError(AuthError::None()));
1298 } 1300 }
1299 1301
1300 if (event.connection_code == browser_sync::HttpResponse::SYNC_AUTH_ERROR) { 1302 if (event.connection_code == browser_sync::HttpResponse::SYNC_AUTH_ERROR) {
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
2039 2041
2040 for (syncable::ModelTypeSet::const_iterator i = types.begin(); 2042 for (syncable::ModelTypeSet::const_iterator i = types.begin();
2041 i != types.end(); ++i) { 2043 i != types.end(); ++i) {
2042 if (!lookup->initial_sync_ended_for_type(*i)) 2044 if (!lookup->initial_sync_ended_for_type(*i))
2043 return false; 2045 return false;
2044 } 2046 }
2045 return true; 2047 return true;
2046 } 2048 }
2047 2049
2048 } // namespace sync_api 2050 } // namespace sync_api
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/net/server_connection_manager.cc ('k') | chrome/test/sync/engine/mock_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698