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

Side by Side Diff: chrome/browser/sync/internal_api/sync_manager.cc

Issue 8402014: [Sync] Make GetFirstChildId return a flag indicating success (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup comments Created 9 years, 1 month 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) 2011 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/internal_api/sync_manager.h" 5 #include "chrome/browser/sync/internal_api/sync_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 // underlying transaction. 1394 // underlying transaction.
1395 ReadTransaction read_trans(GetUserShare(), trans); 1395 ReadTransaction read_trans(GetUserShare(), trans);
1396 1396
1397 syncable::ModelTypeBitSet models_with_changes; 1397 syncable::ModelTypeBitSet models_with_changes;
1398 for (int i = syncable::FIRST_REAL_MODEL_TYPE; 1398 for (int i = syncable::FIRST_REAL_MODEL_TYPE;
1399 i < syncable::MODEL_TYPE_COUNT; ++i) { 1399 i < syncable::MODEL_TYPE_COUNT; ++i) {
1400 const syncable::ModelType type = syncable::ModelTypeFromInt(i); 1400 const syncable::ModelType type = syncable::ModelTypeFromInt(i);
1401 if (change_buffers_[type].IsEmpty()) 1401 if (change_buffers_[type].IsEmpty())
1402 continue; 1402 continue;
1403 1403
1404 ImmutableChangeRecordList ordered_changes = 1404 ImmutableChangeRecordList ordered_changes;
1405 change_buffers_[type].GetAllChangesInTreeOrder(&read_trans); 1405 // TODO(akalin): Propagate up the error further (see
1406 // http://crbug.com/100907).
1407 CHECK(change_buffers_[type].GetAllChangesInTreeOrder(&read_trans,
1408 &ordered_changes));
1406 if (!ordered_changes.Get().empty()) { 1409 if (!ordered_changes.Get().empty()) {
1407 change_delegate_-> 1410 change_delegate_->
1408 OnChangesApplied(type, &read_trans, ordered_changes); 1411 OnChangesApplied(type, &read_trans, ordered_changes);
1409 change_observers_->Notify( 1412 change_observers_->Notify(
1410 &SyncManager::ChangeObserver::OnChangesApplied, 1413 &SyncManager::ChangeObserver::OnChangesApplied,
1411 type, write_transaction_info.Get().id, ordered_changes); 1414 type, write_transaction_info.Get().id, ordered_changes);
1412 models_with_changes.set(i, true); 1415 models_with_changes.set(i, true);
1413 } 1416 }
1414 change_buffers_[i].Clear(); 1417 change_buffers_[i].Clear();
1415 } 1418 }
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 2076
2074 for (syncable::ModelTypeSet::const_iterator i = types.begin(); 2077 for (syncable::ModelTypeSet::const_iterator i = types.begin();
2075 i != types.end(); ++i) { 2078 i != types.end(); ++i) {
2076 if (!lookup->initial_sync_ended_for_type(*i)) 2079 if (!lookup->initial_sync_ended_for_type(*i))
2077 return false; 2080 return false;
2078 } 2081 }
2079 return true; 2082 return true;
2080 } 2083 }
2081 2084
2082 } // namespace sync_api 2085 } // namespace sync_api
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698