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

Side by Side Diff: sync/syncable/directory_backing_store.cc

Issue 11624037: [sync] Componentize sync: Part 6: Add more SYNC_EXPORTs to files in src/sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase (no code changes) Created 7 years, 11 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) 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
11 #include "base/base64.h" 11 #include "base/base64.h"
(...skipping 20 matching lines...) Expand all
32 using std::string; 32 using std::string;
33 33
34 namespace syncer { 34 namespace syncer {
35 namespace syncable { 35 namespace syncable {
36 36
37 // This just has to be big enough to hold an UPDATE or INSERT statement that 37 // This just has to be big enough to hold an UPDATE or INSERT statement that
38 // modifies all the columns in the entry table. 38 // modifies all the columns in the entry table.
39 static const string::size_type kUpdateStatementBufferSize = 2048; 39 static const string::size_type kUpdateStatementBufferSize = 2048;
40 40
41 // Increment this version whenever updating DB tables. 41 // Increment this version whenever updating DB tables.
42 extern const int32 kCurrentDBVersion; // Global visibility for our unittest.
43 const int32 kCurrentDBVersion = 85; 42 const int32 kCurrentDBVersion = 85;
44 43
45 // Iterate over the fields of |entry| and bind each to |statement| for 44 // Iterate over the fields of |entry| and bind each to |statement| for
46 // updating. Returns the number of args bound. 45 // updating. Returns the number of args bound.
47 void BindFields(const EntryKernel& entry, 46 void BindFields(const EntryKernel& entry,
48 sql::Statement* statement) { 47 sql::Statement* statement) {
49 int index = 0; 48 int index = 0;
50 int i = 0; 49 int i = 0;
51 for (i = BEGIN_FIELDS; i < INT64_FIELDS_END; ++i) { 50 for (i = BEGIN_FIELDS; i < INT64_FIELDS_END; ++i) {
52 statement->BindInt64(index++, entry.ref(static_cast<Int64Field>(i))); 51 statement->BindInt64(index++, entry.ref(static_cast<Int64Field>(i)));
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 bool prev_exists = (ids_set.find(entry->ref(PREV_ID).value()) != end); 1309 bool prev_exists = (ids_set.find(entry->ref(PREV_ID).value()) != end);
1311 bool parent_exists = (ids_set.find(entry->ref(PARENT_ID).value()) != end); 1310 bool parent_exists = (ids_set.find(entry->ref(PARENT_ID).value()) != end);
1312 bool next_exists = (ids_set.find(entry->ref(NEXT_ID).value()) != end); 1311 bool next_exists = (ids_set.find(entry->ref(NEXT_ID).value()) != end);
1313 is_ok = is_ok && prev_exists && parent_exists && next_exists; 1312 is_ok = is_ok && prev_exists && parent_exists && next_exists;
1314 } 1313 }
1315 return is_ok; 1314 return is_ok;
1316 } 1315 }
1317 1316
1318 } // namespace syncable 1317 } // namespace syncable
1319 } // namespace syncer 1318 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/directory_backing_store.h ('k') | sync/syncable/directory_backing_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698