OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/dom_storage/dom_storage_database.h" | 5 #include "content/browser/dom_storage/dom_storage_database.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "sql/statement.h" | 10 #include "sql/statement.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 return INVALID; | 222 return INVALID; |
223 | 223 |
224 switch (statement.DeclaredColumnType(1)) { | 224 switch (statement.DeclaredColumnType(1)) { |
225 case sql::COLUMN_TYPE_BLOB: | 225 case sql::COLUMN_TYPE_BLOB: |
226 return V2; | 226 return V2; |
227 case sql::COLUMN_TYPE_TEXT: | 227 case sql::COLUMN_TYPE_TEXT: |
228 return V1; | 228 return V1; |
229 default: | 229 default: |
230 return INVALID; | 230 return INVALID; |
231 } | 231 } |
232 NOTREACHED(); | |
233 return INVALID; | |
234 } | 232 } |
235 | 233 |
236 bool DOMStorageDatabase::CreateTableV2() { | 234 bool DOMStorageDatabase::CreateTableV2() { |
237 DCHECK(IsOpen()); | 235 DCHECK(IsOpen()); |
238 | 236 |
239 return db_->Execute( | 237 return db_->Execute( |
240 "CREATE TABLE ItemTable (" | 238 "CREATE TABLE ItemTable (" |
241 "key TEXT UNIQUE ON CONFLICT REPLACE, " | 239 "key TEXT UNIQUE ON CONFLICT REPLACE, " |
242 "value BLOB NOT NULL ON CONFLICT FAIL)"); | 240 "value BLOB NOT NULL ON CONFLICT FAIL)"); |
243 } | 241 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 CreateTableV2() && | 284 CreateTableV2() && |
287 CommitChanges(false, values) && | 285 CommitChanges(false, values) && |
288 migration.Commit(); | 286 migration.Commit(); |
289 } | 287 } |
290 | 288 |
291 void DOMStorageDatabase::Close() { | 289 void DOMStorageDatabase::Close() { |
292 db_.reset(NULL); | 290 db_.reset(NULL); |
293 } | 291 } |
294 | 292 |
295 } // namespace content | 293 } // namespace content |
OLD | NEW |