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

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

Issue 218623014: [Sync] Add context proto and directory support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add transaction param Created 6 years, 8 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
« no previous file with comments | « sync/syncable/directory.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ 5 #ifndef SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_
6 #define SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ 6 #define SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // is_temporary. Returns an sqlite 81 // is_temporary. Returns an sqlite
82 bool CreateShareInfoTable(bool is_temporary); 82 bool CreateShareInfoTable(bool is_temporary);
83 83
84 bool CreateShareInfoTableVersion71(bool is_temporary); 84 bool CreateShareInfoTableVersion71(bool is_temporary);
85 // Create 'metas' or 'temp_metas' depending on value of is_temporary. Also 85 // Create 'metas' or 'temp_metas' depending on value of is_temporary. Also
86 // create a 'deleted_metas' table using same schema. 86 // create a 'deleted_metas' table using same schema.
87 bool CreateMetasTable(bool is_temporary); 87 bool CreateMetasTable(bool is_temporary);
88 bool CreateModelsTable(); 88 bool CreateModelsTable();
89 bool CreateV71ModelsTable(); 89 bool CreateV71ModelsTable();
90 bool CreateV75ModelsTable(); 90 bool CreateV75ModelsTable();
91 bool CreateV81ModelsTable();
91 92
92 // We don't need to load any synced and applied deleted entries, we can 93 // We don't need to load any synced and applied deleted entries, we can
93 // in fact just purge them forever on startup. 94 // in fact just purge them forever on startup.
94 bool DropDeletedEntries(); 95 bool DropDeletedEntries();
95 // Drops a table if it exists, harmless if the table did not already exist. 96 // Drops a table if it exists, harmless if the table did not already exist.
96 bool SafeDropTable(const char* table_name); 97 bool SafeDropTable(const char* table_name);
97 98
98 // Load helpers for entries and attributes. 99 // Load helpers for entries and attributes.
99 bool LoadEntries(Directory::MetahandlesMap* handles_map); 100 bool LoadEntries(Directory::MetahandlesMap* handles_map);
100 bool LoadDeleteJournals(JournalIndex* delete_journals); 101 bool LoadDeleteJournals(JournalIndex* delete_journals);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 bool MigrateVersion77To78(); 165 bool MigrateVersion77To78();
165 bool MigrateVersion78To79(); 166 bool MigrateVersion78To79();
166 bool MigrateVersion79To80(); 167 bool MigrateVersion79To80();
167 bool MigrateVersion80To81(); 168 bool MigrateVersion80To81();
168 bool MigrateVersion81To82(); 169 bool MigrateVersion81To82();
169 bool MigrateVersion82To83(); 170 bool MigrateVersion82To83();
170 bool MigrateVersion83To84(); 171 bool MigrateVersion83To84();
171 bool MigrateVersion84To85(); 172 bool MigrateVersion84To85();
172 bool MigrateVersion85To86(); 173 bool MigrateVersion85To86();
173 bool MigrateVersion86To87(); 174 bool MigrateVersion86To87();
175 bool MigrateVersion87To88();
174 176
175 scoped_ptr<sql::Connection> db_; 177 scoped_ptr<sql::Connection> db_;
176 sql::Statement save_meta_statment_; 178 sql::Statement save_meta_statment_;
177 sql::Statement save_delete_journal_statment_; 179 sql::Statement save_delete_journal_statment_;
178 std::string dir_name_; 180 std::string dir_name_;
179 181
180 // Set to true if migration left some old columns around that need to be 182 // Set to true if migration left some old columns around that need to be
181 // discarded. 183 // discarded.
182 bool needs_column_refresh_; 184 bool needs_column_refresh_;
183 185
184 private: 186 private:
185 // Prepares |save_statement| for saving entries in |table|. 187 // Prepares |save_statement| for saving entries in |table|.
186 void PrepareSaveEntryStatement(EntryTable table, 188 void PrepareSaveEntryStatement(EntryTable table,
187 sql::Statement* save_statement); 189 sql::Statement* save_statement);
188 190
189 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); 191 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore);
190 }; 192 };
191 193
192 } // namespace syncable 194 } // namespace syncable
193 } // namespace syncer 195 } // namespace syncer
194 196
195 #endif // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ 197 #endif // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_
OLDNEW
« no previous file with comments | « sync/syncable/directory.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698