Chromium Code Reviews| Index: webkit/dom_storage/dom_storage_area.cc |
| diff --git a/webkit/dom_storage/dom_storage_area.cc b/webkit/dom_storage/dom_storage_area.cc |
| index ab4d5f837b282f2a1b17b4fdebf9e1ced50dfed6..5e027ea28e6caaaca1a608971f1fc81141ad4ae2 100644 |
| --- a/webkit/dom_storage/dom_storage_area.cc |
| +++ b/webkit/dom_storage/dom_storage_area.cc |
| @@ -5,7 +5,6 @@ |
| #include "webkit/dom_storage/dom_storage_area.h" |
| #include "base/bind.h" |
| -#include "base/file_util.h" |
| #include "base/location.h" |
| #include "base/logging.h" |
| #include "base/time.h" |
| @@ -15,6 +14,7 @@ |
| #include "webkit/dom_storage/dom_storage_namespace.h" |
| #include "webkit/dom_storage/dom_storage_task_runner.h" |
| #include "webkit/dom_storage/dom_storage_types.h" |
| +#include "webkit/dom_storage/local_storage_database_adapter.h" |
|
michaeln
2012/06/15 19:02:43
depending on what happens in the .h file, this may
marja
2012/06/19 10:43:30
Include removed from the .h -> kept this.
|
| #include "webkit/fileapi/file_system_util.h" |
| #include "webkit/glue/webkit_glue.h" |
| @@ -53,8 +53,8 @@ GURL DomStorageArea::OriginFromDatabaseFileName(const FilePath& name) { |
| } |
| DomStorageArea::DomStorageArea( |
| - int64 namespace_id, const GURL& origin, |
| - const FilePath& directory, DomStorageTaskRunner* task_runner) |
| + int64 namespace_id, const GURL& origin, const FilePath& directory, |
| + DomStorageTaskRunner* task_runner) |
| : namespace_id_(namespace_id), origin_(origin), |
| directory_(directory), |
| task_runner_(task_runner), |
| @@ -64,7 +64,7 @@ DomStorageArea::DomStorageArea( |
| commit_batches_in_flight_(0) { |
| if (namespace_id == kLocalStorageNamespaceId && !directory.empty()) { |
| FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_)); |
| - backing_.reset(new DomStorageDatabase(path)); |
| + backing_.reset(new LocalStorageDatabaseAdapter(path)); |
| is_initial_import_done_ = false; |
| } |
| } |
| @@ -179,10 +179,8 @@ void DomStorageArea::DeleteOrigin() { |
| map_ = new DomStorageMap(kPerAreaQuota + kPerAreaOverQuotaAllowance); |
| if (backing_.get()) { |
| is_initial_import_done_ = false; |
| - backing_.reset(new DomStorageDatabase(backing_->file_path())); |
| - file_util::Delete(backing_->file_path(), false); |
| - file_util::Delete( |
| - DomStorageDatabase::GetJournalFilePath(backing_->file_path()), false); |
| + backing_->Reset(); |
| + backing_->DeleteFiles(); |
| } |
| } |
| @@ -199,7 +197,7 @@ void DomStorageArea::PurgeMemory() { |
| // Recreate the database object, this frees up the open sqlite connection |
| // and its page cache. |
| - backing_.reset(new DomStorageDatabase(backing_->file_path())); |
| + backing_->Reset(); |
| } |
| void DomStorageArea::Shutdown() { |