OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_HISTORY_IN_MEMORY_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_IN_MEMORY_DATABASE_H_ |
6 #define CHROME_BROWSER_HISTORY_IN_MEMORY_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_IN_MEMORY_DATABASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "chrome/browser/history/url_database.h" | 10 #include "chrome/browser/history/url_database.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 bool InitFromScratch(); | 26 bool InitFromScratch(); |
27 | 27 |
28 // Initializes the database by directly slurping the data from the given | 28 // Initializes the database by directly slurping the data from the given |
29 // file. Conceptually, the InMemoryHistoryBackend should do the populating | 29 // file. Conceptually, the InMemoryHistoryBackend should do the populating |
30 // after this object does some common initialization, but that would be | 30 // after this object does some common initialization, but that would be |
31 // much slower. | 31 // much slower. |
32 bool InitFromDisk(const FilePath& history_name); | 32 bool InitFromDisk(const FilePath& history_name); |
33 | 33 |
34 protected: | 34 protected: |
35 // Implemented for URLDatabase. | 35 // Implemented for URLDatabase. |
36 virtual sql::Connection& GetDB(); | 36 virtual sql::Connection& GetDB() OVERRIDE; |
37 | 37 |
38 private: | 38 private: |
39 // Initializes the database connection, this is the shared code between | 39 // Initializes the database connection, this is the shared code between |
40 // InitFromScratch() and InitFromDisk() above. Returns true on success. | 40 // InitFromScratch() and InitFromDisk() above. Returns true on success. |
41 bool InitDB(); | 41 bool InitDB(); |
42 | 42 |
43 sql::Connection db_; | 43 sql::Connection db_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(InMemoryDatabase); | 45 DISALLOW_COPY_AND_ASSIGN(InMemoryDatabase); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace history | 48 } // namespace history |
49 | 49 |
50 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_DATABASE_H_ | 50 #endif // CHROME_BROWSER_HISTORY_IN_MEMORY_DATABASE_H_ |
OLD | NEW |