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

Side by Side Diff: chrome/browser/sync/engine/all_status.cc

Issue 6690020: sync: hook up ServerConnectionManager <> SyncerThread2 and tie up more loose ends (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/debug
Patch Set: fix Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync/engine/cleanup_disabled_types_command_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/engine/all_status.h" 5 #include "chrome/browser/sync/engine/all_status.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/port.h" 10 #include "base/port.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 void AllStatus::HandleServerConnectionEvent( 122 void AllStatus::HandleServerConnectionEvent(
123 const ServerConnectionEvent& event) { 123 const ServerConnectionEvent& event) {
124 if (ServerConnectionEvent::STATUS_CHANGED == event.what_happened) { 124 if (ServerConnectionEvent::STATUS_CHANGED == event.what_happened) {
125 ScopedStatusLock lock(this); 125 ScopedStatusLock lock(this);
126 status_.server_up = IsGoodReplyFromServer(event.connection_code); 126 status_.server_up = IsGoodReplyFromServer(event.connection_code);
127 status_.server_reachable = event.server_reachable; 127 status_.server_reachable = event.server_reachable;
128 128
129 if (event.connection_code == HttpResponse::SERVER_CONNECTION_OK) { 129 if (event.connection_code == HttpResponse::SERVER_CONNECTION_OK) {
130 if (!status_.authenticated) {
131 status_ = CreateBlankStatus();
132 }
133 status_.authenticated = true; 130 status_.authenticated = true;
134 } else { 131 } else {
135 status_.authenticated = false; 132 status_.authenticated = false;
136 } 133 }
137 } 134 }
138 } 135 }
139 136
140 sync_api::SyncManager::Status AllStatus::status() const { 137 sync_api::SyncManager::Status AllStatus::status() const {
141 base::AutoLock lock(mutex_); 138 base::AutoLock lock(mutex_);
142 return status_; 139 return status_;
(...skipping 18 matching lines...) Expand all
161 : allstatus_(allstatus) { 158 : allstatus_(allstatus) {
162 allstatus->mutex_.Acquire(); 159 allstatus->mutex_.Acquire();
163 } 160 }
164 161
165 ScopedStatusLock::~ScopedStatusLock() { 162 ScopedStatusLock::~ScopedStatusLock() {
166 allstatus_->CalcStatusChanges(); 163 allstatus_->CalcStatusChanges();
167 allstatus_->mutex_.Release(); 164 allstatus_->mutex_.Release();
168 } 165 }
169 166
170 } // namespace browser_sync 167 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/engine/cleanup_disabled_types_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698