OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/appcache/appcache_database.h" | 5 #include "webkit/appcache/appcache_database.h" |
6 | 6 |
7 #include "app/sql/connection.h" | 7 #include "app/sql/connection.h" |
8 #include "app/sql/diagnostic_error_delegate.h" | 8 #include "app/sql/diagnostic_error_delegate.h" |
9 #include "app/sql/meta_table.h" | 9 #include "app/sql/meta_table.h" |
10 #include "app/sql/statement.h" | 10 #include "app/sql/statement.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 public: | 138 public: |
139 static const char* name() { return "Sqlite.AppCache.Error"; } | 139 static const char* name() { return "Sqlite.AppCache.Error"; } |
140 }; | 140 }; |
141 | 141 |
142 sql::ErrorDelegate* GetErrorHandlerForAppCacheDb() { | 142 sql::ErrorDelegate* GetErrorHandlerForAppCacheDb() { |
143 return new sql::DiagnosticErrorDelegate<HistogramUniquifier>(); | 143 return new sql::DiagnosticErrorDelegate<HistogramUniquifier>(); |
144 } | 144 } |
145 | 145 |
146 } // anon namespace | 146 } // anon namespace |
147 | 147 |
148 | |
149 // AppCacheDatabase ---------------------------------------------------------- | 148 // AppCacheDatabase ---------------------------------------------------------- |
150 namespace appcache { | 149 namespace appcache { |
151 | 150 |
| 151 AppCacheDatabase::GroupRecord::GroupRecord() |
| 152 : group_id(0) { |
| 153 } |
| 154 |
| 155 AppCacheDatabase::GroupRecord::~GroupRecord() { |
| 156 } |
| 157 |
| 158 AppCacheDatabase::FallbackNameSpaceRecord::FallbackNameSpaceRecord() |
| 159 : cache_id(0) { |
| 160 } |
| 161 |
| 162 AppCacheDatabase::FallbackNameSpaceRecord::~FallbackNameSpaceRecord() { |
| 163 } |
| 164 |
152 AppCacheDatabase::AppCacheDatabase(const FilePath& path) | 165 AppCacheDatabase::AppCacheDatabase(const FilePath& path) |
153 : db_file_path_(path), is_disabled_(false), is_recreating_(false) { | 166 : db_file_path_(path), is_disabled_(false), is_recreating_(false) { |
154 } | 167 } |
155 | 168 |
156 AppCacheDatabase::~AppCacheDatabase() { | 169 AppCacheDatabase::~AppCacheDatabase() { |
157 } | 170 } |
158 | 171 |
159 void AppCacheDatabase::CloseConnection() { | 172 void AppCacheDatabase::CloseConnection() { |
160 // We can't close the connection for an in-memory database w/o | 173 // We can't close the connection for an in-memory database w/o |
161 // losing all of the data, so we don't do that. | 174 // losing all of the data, so we don't do that. |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 | 1133 |
1121 // So we can't go recursive. | 1134 // So we can't go recursive. |
1122 if (is_recreating_) | 1135 if (is_recreating_) |
1123 return false; | 1136 return false; |
1124 | 1137 |
1125 AutoReset<bool> auto_reset(&is_recreating_, true); | 1138 AutoReset<bool> auto_reset(&is_recreating_, true); |
1126 return LazyOpen(true); | 1139 return LazyOpen(true); |
1127 } | 1140 } |
1128 | 1141 |
1129 } // namespace appcache | 1142 } // namespace appcache |
OLD | NEW |