OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "sync/syncable/directory_backing_store.h" | 5 #include "sync/syncable/directory_backing_store.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 kernel->mutable_ref(static_cast<ProtoField>(i)).ParseFromArray( | 101 kernel->mutable_ref(static_cast<ProtoField>(i)).ParseFromArray( |
102 statement->ColumnBlob(i), statement->ColumnByteLength(i)); | 102 statement->ColumnBlob(i), statement->ColumnByteLength(i)); |
103 } | 103 } |
104 for ( ; i < UNIQUE_POSITION_FIELDS_END; ++i) { | 104 for ( ; i < UNIQUE_POSITION_FIELDS_END; ++i) { |
105 std::string temp; | 105 std::string temp; |
106 statement->ColumnBlobAsString(i, &temp); | 106 statement->ColumnBlobAsString(i, &temp); |
107 | 107 |
108 sync_pb::UniquePosition proto; | 108 sync_pb::UniquePosition proto; |
109 if (!proto.ParseFromString(temp)) { | 109 if (!proto.ParseFromString(temp)) { |
110 DVLOG(1) << "Unpacked invalid position. Assuming the DB is corrupt"; | 110 DVLOG(1) << "Unpacked invalid position. Assuming the DB is corrupt"; |
111 return scoped_ptr<EntryKernel>(NULL); | 111 return scoped_ptr<EntryKernel>(); |
112 } | 112 } |
113 | 113 |
114 kernel->mutable_ref(static_cast<UniquePositionField>(i)) = | 114 kernel->mutable_ref(static_cast<UniquePositionField>(i)) = |
115 UniquePosition::FromProto(proto); | 115 UniquePosition::FromProto(proto); |
116 } | 116 } |
117 return kernel.Pass(); | 117 return kernel.Pass(); |
118 } | 118 } |
119 | 119 |
120 namespace { | 120 namespace { |
121 | 121 |
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 } | 1492 } |
1493 query.append(" ) "); | 1493 query.append(" ) "); |
1494 values.append(" )"); | 1494 values.append(" )"); |
1495 query.append(values); | 1495 query.append(values); |
1496 save_statement->Assign(db_->GetUniqueStatement( | 1496 save_statement->Assign(db_->GetUniqueStatement( |
1497 base::StringPrintf(query.c_str(), "metas").c_str())); | 1497 base::StringPrintf(query.c_str(), "metas").c_str())); |
1498 } | 1498 } |
1499 | 1499 |
1500 } // namespace syncable | 1500 } // namespace syncable |
1501 } // namespace syncer | 1501 } // namespace syncer |
OLD | NEW |