| OLD | NEW |
| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // We're safe to use this value here because we don't call into the syncer | 200 // We're safe to use this value here because we don't call into the syncer |
| 201 // or block on any processes. | 201 // or block on any processes. |
| 202 lock.set_notify_plan(DONT_NOTIFY); | 202 lock.set_notify_plan(DONT_NOTIFY); |
| 203 syncer_thread_hookup_.reset(); | 203 syncer_thread_hookup_.reset(); |
| 204 break; | 204 break; |
| 205 case SyncerEvent::OVER_QUOTA: | 205 case SyncerEvent::OVER_QUOTA: |
| 206 LOG(WARNING) << "User has gone over quota."; | 206 LOG(WARNING) << "User has gone over quota."; |
| 207 lock.NotifyOverQuota(); | 207 lock.NotifyOverQuota(); |
| 208 break; | 208 break; |
| 209 case SyncerEvent::REQUEST_SYNC_NUDGE: | 209 case SyncerEvent::REQUEST_SYNC_NUDGE: |
| 210 lock.set_notify_plan(DONT_NOTIFY); | |
| 211 break; | |
| 212 case SyncerEvent::PAUSED: | 210 case SyncerEvent::PAUSED: |
| 213 lock.set_notify_plan(DONT_NOTIFY); | |
| 214 break; | |
| 215 case SyncerEvent::RESUMED: | 211 case SyncerEvent::RESUMED: |
| 216 lock.set_notify_plan(DONT_NOTIFY); | |
| 217 break; | |
| 218 case SyncerEvent::WAITING_FOR_CONNECTION: | 212 case SyncerEvent::WAITING_FOR_CONNECTION: |
| 219 lock.set_notify_plan(DONT_NOTIFY); | |
| 220 break; | |
| 221 case SyncerEvent::CONNECTED: | 213 case SyncerEvent::CONNECTED: |
| 222 lock.set_notify_plan(DONT_NOTIFY); | 214 case SyncerEvent::STOP_SYNCING_PERMANENTLY: |
| 223 break; | 215 case SyncerEvent::SYNCER_THREAD_EXITING: |
| 216 lock.set_notify_plan(DONT_NOTIFY); |
| 217 break; |
| 224 default: | 218 default: |
| 225 LOG(ERROR) << "Unrecognized Syncer Event: " << event.what_happened; | 219 LOG(ERROR) << "Unrecognized Syncer Event: " << event.what_happened; |
| 226 lock.set_notify_plan(DONT_NOTIFY); | 220 lock.set_notify_plan(DONT_NOTIFY); |
| 227 break; | 221 break; |
| 228 } | 222 } |
| 229 } | 223 } |
| 230 | 224 |
| 231 void AllStatus::HandleServerConnectionEvent( | 225 void AllStatus::HandleServerConnectionEvent( |
| 232 const ServerConnectionEvent& event) { | 226 const ServerConnectionEvent& event) { |
| 233 if (ServerConnectionEvent::STATUS_CHANGED == event.what_happened) { | 227 if (ServerConnectionEvent::STATUS_CHANGED == event.what_happened) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 allstatus_->mutex_.Release(); | 292 allstatus_->mutex_.Release(); |
| 299 if (event_.what_changed) | 293 if (event_.what_changed) |
| 300 allstatus_->channel()->NotifyListeners(event_); | 294 allstatus_->channel()->NotifyListeners(event_); |
| 301 } | 295 } |
| 302 | 296 |
| 303 void ScopedStatusLockWithNotify::NotifyOverQuota() { | 297 void ScopedStatusLockWithNotify::NotifyOverQuota() { |
| 304 event_.what_changed |= AllStatusEvent::OVER_QUOTA; | 298 event_.what_changed |= AllStatusEvent::OVER_QUOTA; |
| 305 } | 299 } |
| 306 | 300 |
| 307 } // namespace browser_sync | 301 } // namespace browser_sync |
| OLD | NEW |