OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/history/in_memory_database.h" | 5 #include "chrome/browser/history/in_memory_database.h" |
6 | 6 |
7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 | 11 |
12 namespace history { | 12 namespace history { |
13 | 13 |
14 InMemoryDatabase::InMemoryDatabase() : URLDatabase(), db_(NULL) { | 14 InMemoryDatabase::InMemoryDatabase() |
| 15 : URLDatabase(), |
| 16 db_(NULL), |
| 17 statement_cache_(NULL) { |
15 } | 18 } |
16 | 19 |
17 InMemoryDatabase::~InMemoryDatabase() { | 20 InMemoryDatabase::~InMemoryDatabase() { |
18 } | 21 } |
19 | 22 |
20 bool InMemoryDatabase::InitDB() { | 23 bool InMemoryDatabase::InitDB() { |
21 DCHECK(!db_) << "Already initialized!"; | 24 DCHECK(!db_) << "Already initialized!"; |
22 if (sqlite3_open(":memory:", &db_) != SQLITE_OK) { | 25 if (sqlite3_open(":memory:", &db_) != SQLITE_OK) { |
23 NOTREACHED() << "Cannot open memory database"; | 26 NOTREACHED() << "Cannot open memory database"; |
24 return false; | 27 return false; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 103 |
101 sqlite3* InMemoryDatabase::GetDB() { | 104 sqlite3* InMemoryDatabase::GetDB() { |
102 return db_; | 105 return db_; |
103 } | 106 } |
104 | 107 |
105 SqliteStatementCache& InMemoryDatabase::GetStatementCache() { | 108 SqliteStatementCache& InMemoryDatabase::GetStatementCache() { |
106 return *statement_cache_; | 109 return *statement_cache_; |
107 } | 110 } |
108 | 111 |
109 } // namespace history | 112 } // namespace history |
OLD | NEW |