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

Unified Diff: sync/syncable/directory_backing_store.h

Issue 1082423002: [Sync] Make DirectoryBackingStore's db_ private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/syncable/deferred_on_disk_directory_backing_store.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory_backing_store.h
diff --git a/sync/syncable/directory_backing_store.h b/sync/syncable/directory_backing_store.h
index bb3641f49c876e1bd80f1170e7ec15fffa3956cb..b3168aa9f00705193ecc4caf103098c03c7bd29d 100644
--- a/sync/syncable/directory_backing_store.h
+++ b/sync/syncable/directory_backing_store.h
@@ -44,6 +44,7 @@ struct ColumnSpec;
// in tests. The concrete class used in non-test scenarios is
// OnDiskDirectoryBackingStore.
class SYNC_EXPORT_PRIVATE DirectoryBackingStore : public base::NonThreadSafe {
+ friend class TestDirectoryBackingStore;
maniscalco 2015/04/15 18:10:43 TestDirectoryBackingStore is friend so it can .rel
Nicolas Zea 2015/04/16 15:56:33 nit: these should all be within the private: secti
maniscalco 2015/04/16 16:03:45 Done.
friend class DirectoryBackingStoreTest;
FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest,
IncreaseDatabasePageSizeFrom4KTo32K);
@@ -106,6 +107,21 @@ class SYNC_EXPORT_PRIVATE DirectoryBackingStore : public base::NonThreadSafe {
DirectoryBackingStore(const std::string& dir_name,
sql::Connection* connection);
+ // An accessor for the underlying sql::Connection. Avoid using outside of
+ // tests.
+ sql::Connection* db();
+
+ // Return true if the DB is open.
+ bool IsOpen() const;
+
+ // Open the DB at |path|.
+ // Return true on success, false on failure.
+ bool Open(const base::FilePath& path);
+
+ // Open an in memory DB.
+ // Return true on success, false on failure.
+ bool OpenInMemory();
+
// General Directory initialization and load helpers.
bool InitializeTables();
bool CreateTables();
@@ -213,8 +229,6 @@ class SYNC_EXPORT_PRIVATE DirectoryBackingStore : public base::NonThreadSafe {
// Destroys the existing Connection and creates a new one.
void ResetAndCreateConnection();
- scoped_ptr<sql::Connection> db_;
-
private:
bool Vacuum();
bool IncreasePageSizeTo32K();
@@ -226,6 +240,8 @@ class SYNC_EXPORT_PRIVATE DirectoryBackingStore : public base::NonThreadSafe {
const std::string dir_name_;
const int database_page_size_;
+
+ scoped_ptr<sql::Connection> db_;
sql::Statement save_meta_statement_;
sql::Statement save_delete_journal_statement_;
« no previous file with comments | « sync/syncable/deferred_on_disk_directory_backing_store.cc ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698