OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sync/engine/non_blocking_type_commit_contribution.h" | 5 #include "sync/engine/non_blocking_type_commit_contribution.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 CommitResponseDataList response_list; | 55 CommitResponseDataList response_list; |
56 | 56 |
57 for (size_t i = 0; i < sequence_numbers_.size(); ++i) { | 57 for (size_t i = 0; i < sequence_numbers_.size(); ++i) { |
58 const sync_pb::CommitResponse_EntryResponse& entry_response = | 58 const sync_pb::CommitResponse_EntryResponse& entry_response = |
59 commit_response.entryresponse(entries_start_index_ + i); | 59 commit_response.entryresponse(entries_start_index_ + i); |
60 | 60 |
61 switch (entry_response.response_type()) { | 61 switch (entry_response.response_type()) { |
62 case sync_pb::CommitResponse::INVALID_MESSAGE: | 62 case sync_pb::CommitResponse::INVALID_MESSAGE: |
63 LOG(ERROR) << "Server reports commit message is invalid."; | 63 LOG(ERROR) << "Server reports commit message is invalid."; |
64 DLOG(ERROR) << "Message was: " | 64 DLOG(ERROR) << "Message was: " |
65 << syncer::SyncEntityToValue(entities_.Get(i), false); | 65 << syncer::SyncEntityToValue(entities_.Get(i), false).get(); |
dcheng
2016/01/19 23:50:55
This seems pretty silly: we log out a pointer valu
| |
66 unknown_error = true; | 66 unknown_error = true; |
67 break; | 67 break; |
68 case sync_pb::CommitResponse::CONFLICT: | 68 case sync_pb::CommitResponse::CONFLICT: |
69 DVLOG(1) << "Server reports conflict for commit message."; | 69 DVLOG(1) << "Server reports conflict for commit message."; |
70 DVLOG(1) << "Message was: " | 70 DVLOG(1) << "Message was: " |
71 << syncer::SyncEntityToValue(entities_.Get(i), false); | 71 << syncer::SyncEntityToValue(entities_.Get(i), false).get(); |
72 commit_conflict = true; | 72 commit_conflict = true; |
73 break; | 73 break; |
74 case sync_pb::CommitResponse::SUCCESS: { | 74 case sync_pb::CommitResponse::SUCCESS: { |
75 CommitResponseData response_data; | 75 CommitResponseData response_data; |
76 response_data.id = entry_response.id_string(); | 76 response_data.id = entry_response.id_string(); |
77 response_data.client_tag_hash = | 77 response_data.client_tag_hash = |
78 entities_.Get(i).client_defined_unique_tag(); | 78 entities_.Get(i).client_defined_unique_tag(); |
79 response_data.sequence_number = sequence_numbers_[i]; | 79 response_data.sequence_number = sequence_numbers_[i]; |
80 response_data.response_version = entry_response.version(); | 80 response_data.response_version = entry_response.version(); |
81 response_list.push_back(response_data); | 81 response_list.push_back(response_data); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 // We could inform our parent NonBlockingCommitContributor that a commit is | 115 // We could inform our parent NonBlockingCommitContributor that a commit is |
116 // no longer in progress. The current implementation doesn't really care | 116 // no longer in progress. The current implementation doesn't really care |
117 // either way, so we don't bother sending the signal. | 117 // either way, so we don't bother sending the signal. |
118 } | 118 } |
119 | 119 |
120 size_t NonBlockingTypeCommitContribution::GetNumEntries() const { | 120 size_t NonBlockingTypeCommitContribution::GetNumEntries() const { |
121 return sequence_numbers_.size(); | 121 return sequence_numbers_.size(); |
122 } | 122 } |
123 | 123 |
124 } // namespace syncer_v2 | 124 } // namespace syncer_v2 |
OLD | NEW |