OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/glue/session_change_processor.h" | 5 #include "chrome/browser/sync/glue/session_change_processor.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 const sync_api::ImmutableChangeRecordList& changes) { | 256 const sync_api::ImmutableChangeRecordList& changes) { |
257 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 257 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
258 if (!running()) { | 258 if (!running()) { |
259 return; | 259 return; |
260 } | 260 } |
261 | 261 |
262 ScopedStopObserving<SessionChangeProcessor> stop_observing(this); | 262 ScopedStopObserving<SessionChangeProcessor> stop_observing(this); |
263 | 263 |
264 sync_api::ReadNode root(trans); | 264 sync_api::ReadNode root(trans); |
265 if (root.InitByTagLookup(kSessionsTag) != sync_api::BaseNode::INIT_OK) { | 265 if (root.InitByTagLookup(kSessionsTag) != sync_api::BaseNode::INIT_OK) { |
266 error_handler()->OnUnrecoverableError(FROM_HERE, | 266 error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE, |
267 "Sessions root node lookup failed."); | 267 "Sessions root node lookup failed."); |
268 return; | 268 return; |
269 } | 269 } |
270 | 270 |
271 std::string local_tag = session_model_associator_->GetCurrentMachineTag(); | 271 std::string local_tag = session_model_associator_->GetCurrentMachineTag(); |
272 for (sync_api::ChangeRecordList::const_iterator it = | 272 for (sync_api::ChangeRecordList::const_iterator it = |
273 changes.Get().begin(); it != changes.Get().end(); ++it) { | 273 changes.Get().begin(); it != changes.Get().end(); ++it) { |
274 const sync_api::ChangeRecord& change = *it; | 274 const sync_api::ChangeRecord& change = *it; |
275 sync_api::ChangeRecord::Action action(change.action); | 275 sync_api::ChangeRecord::Action action(change.action); |
276 if (sync_api::ChangeRecord::ACTION_DELETE == action) { | 276 if (sync_api::ChangeRecord::ACTION_DELETE == action) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 notification_registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED, | 366 notification_registrar_.Add(this, chrome::NOTIFICATION_FAVICON_CHANGED, |
367 content::Source<Profile>(profile_)); | 367 content::Source<Profile>(profile_)); |
368 } | 368 } |
369 | 369 |
370 void SessionChangeProcessor::StopObserving() { | 370 void SessionChangeProcessor::StopObserving() { |
371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
372 notification_registrar_.RemoveAll(); | 372 notification_registrar_.RemoveAll(); |
373 } | 373 } |
374 | 374 |
375 } // namespace browser_sync | 375 } // namespace browser_sync |
OLD | NEW |