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_; |