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

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

Issue 6874018: make new syncer thread the default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Send for CR. Created 9 years, 8 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/engine/net/server_connection_manager.cc » ('j') | chrome/browser/sync/engine/nudge_source.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698