| OLD | NEW |
| 1 // Copyright (c) 2006-2009 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/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" |
| 11 #include "chrome/browser/sync/engine/net/server_connection_manager.h" | 11 #include "chrome/browser/sync/engine/net/server_connection_manager.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 void AllStatus::OnSyncEngineEvent(const SyncEngineEvent& event) { | 102 void AllStatus::OnSyncEngineEvent(const SyncEngineEvent& event) { |
| 103 ScopedStatusLock lock(this); | 103 ScopedStatusLock lock(this); |
| 104 switch (event.what_happened) { | 104 switch (event.what_happened) { |
| 105 case SyncEngineEvent::SYNC_CYCLE_ENDED: | 105 case SyncEngineEvent::SYNC_CYCLE_ENDED: |
| 106 case SyncEngineEvent::STATUS_CHANGED: | 106 case SyncEngineEvent::STATUS_CHANGED: |
| 107 status_ = CalcSyncing(event); | 107 status_ = CalcSyncing(event); |
| 108 break; | 108 break; |
| 109 case SyncEngineEvent::SYNCER_THREAD_PAUSED: | |
| 110 case SyncEngineEvent::SYNCER_THREAD_RESUMED: | |
| 111 case SyncEngineEvent::SYNCER_THREAD_WAITING_FOR_CONNECTION: | |
| 112 case SyncEngineEvent::SYNCER_THREAD_CONNECTED: | |
| 113 case SyncEngineEvent::STOP_SYNCING_PERMANENTLY: | 109 case SyncEngineEvent::STOP_SYNCING_PERMANENTLY: |
| 114 case SyncEngineEvent::SYNCER_THREAD_EXITING: | |
| 115 break; | 110 break; |
| 116 default: | 111 default: |
| 117 LOG(ERROR) << "Unrecognized Syncer Event: " << event.what_happened; | 112 LOG(ERROR) << "Unrecognized Syncer Event: " << event.what_happened; |
| 118 break; | 113 break; |
| 119 } | 114 } |
| 120 } | 115 } |
| 121 | 116 |
| 122 void AllStatus::HandleServerConnectionEvent( | 117 void AllStatus::HandleServerConnectionEvent( |
| 123 const ServerConnectionEvent& event) { | 118 const ServerConnectionEvent& event) { |
| 124 if (ServerConnectionEvent::STATUS_CHANGED == event.what_happened) { | 119 if (ServerConnectionEvent::STATUS_CHANGED == event.what_happened) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 : allstatus_(allstatus) { | 153 : allstatus_(allstatus) { |
| 159 allstatus->mutex_.Acquire(); | 154 allstatus->mutex_.Acquire(); |
| 160 } | 155 } |
| 161 | 156 |
| 162 ScopedStatusLock::~ScopedStatusLock() { | 157 ScopedStatusLock::~ScopedStatusLock() { |
| 163 allstatus_->CalcStatusChanges(); | 158 allstatus_->CalcStatusChanges(); |
| 164 allstatus_->mutex_.Release(); | 159 allstatus_->mutex_.Release(); |
| 165 } | 160 } |
| 166 | 161 |
| 167 } // namespace browser_sync | 162 } // namespace browser_sync |
| OLD | NEW |