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

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

Issue 8298016: Making some CHECK statements to NOTREACHED. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 2 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) 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/engine/process_commit_response_command.h" 5 #include "chrome/browser/sync/engine/process_commit_response_command.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 // position that it returns. 432 // position that it returns.
433 if (entry_response.has_position_in_parent()) { 433 if (entry_response.has_position_in_parent()) {
434 // The SERVER_ field should already have been written. 434 // The SERVER_ field should already have been written.
435 DCHECK_EQ(entry_response.position_in_parent(), 435 DCHECK_EQ(entry_response.position_in_parent(),
436 local_entry->Get(SERVER_POSITION_IN_PARENT)); 436 local_entry->Get(SERVER_POSITION_IN_PARENT));
437 437
438 // We just committed successfully, so we assume that the position 438 // We just committed successfully, so we assume that the position
439 // value we got applies to the PARENT_ID we submitted. 439 // value we got applies to the PARENT_ID we submitted.
440 syncable::Id new_prev = local_entry->ComputePrevIdFromServerPosition( 440 syncable::Id new_prev = local_entry->ComputePrevIdFromServerPosition(
441 local_entry->Get(PARENT_ID)); 441 local_entry->Get(PARENT_ID));
442 CHECK(local_entry->PutPredecessor(new_prev)); 442 if (!local_entry->PutPredecessor(new_prev)) {
akalin 2011/10/15 01:19:44 add TODO to propagate error up, refer a bug
443 LOG(WARNING) << "PutPredecessor failed after successful commit";
444 NOTREACHED();
akalin 2011/10/15 01:19:44 just do NOTREACHED() << "..."
445 }
443 } 446 }
444 } 447 }
445 448
446 void ProcessCommitResponseCommand::ProcessSuccessfulCommitResponse( 449 void ProcessCommitResponseCommand::ProcessSuccessfulCommitResponse(
447 const sync_pb::SyncEntity& committed_entry, 450 const sync_pb::SyncEntity& committed_entry,
448 const CommitResponse_EntryResponse& entry_response, 451 const CommitResponse_EntryResponse& entry_response,
449 const syncable::Id& pre_commit_id, syncable::MutableEntry* local_entry, 452 const syncable::Id& pre_commit_id, syncable::MutableEntry* local_entry,
450 bool syncing_was_set, set<syncable::Id>* deleted_folders) { 453 bool syncing_was_set, set<syncable::Id>* deleted_folders) {
451 DCHECK(local_entry->Get(IS_UNSYNCED)); 454 DCHECK(local_entry->Get(IS_UNSYNCED));
452 455
(...skipping 29 matching lines...) Expand all
482 // been recursively deleted. 485 // been recursively deleted.
483 // TODO(nick): Here, commit_message.deleted() would be more correct than 486 // TODO(nick): Here, commit_message.deleted() would be more correct than
484 // local_entry->Get(IS_DEL). For example, an item could be renamed, and then 487 // local_entry->Get(IS_DEL). For example, an item could be renamed, and then
485 // deleted during the commit of the rename. Unit test & fix. 488 // deleted during the commit of the rename. Unit test & fix.
486 if (local_entry->Get(IS_DIR) && local_entry->Get(IS_DEL)) { 489 if (local_entry->Get(IS_DIR) && local_entry->Get(IS_DEL)) {
487 deleted_folders->insert(local_entry->Get(ID)); 490 deleted_folders->insert(local_entry->Get(ID));
488 } 491 }
489 } 492 }
490 493
491 } // namespace browser_sync 494 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698