| 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 "webkit/browser/quota/quota_database.h" | 5 #include "webkit/browser/quota/quota_database.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 } | 445 } |
| 446 | 446 |
| 447 db_.reset(new sql::Connection); | 447 db_.reset(new sql::Connection); |
| 448 meta_table_.reset(new sql::MetaTable); | 448 meta_table_.reset(new sql::MetaTable); |
| 449 | 449 |
| 450 db_->set_histogram_tag("Quota"); | 450 db_->set_histogram_tag("Quota"); |
| 451 | 451 |
| 452 bool opened = false; | 452 bool opened = false; |
| 453 if (in_memory_only) { | 453 if (in_memory_only) { |
| 454 opened = db_->OpenInMemory(); | 454 opened = db_->OpenInMemory(); |
| 455 } else if (!file_util::CreateDirectory(db_file_path_.DirName())) { | 455 } else if (!base::CreateDirectory(db_file_path_.DirName())) { |
| 456 LOG(ERROR) << "Failed to create quota database directory."; | 456 LOG(ERROR) << "Failed to create quota database directory."; |
| 457 } else { | 457 } else { |
| 458 opened = db_->Open(db_file_path_); | 458 opened = db_->Open(db_file_path_); |
| 459 if (opened) | 459 if (opened) |
| 460 db_->Preload(); | 460 db_->Preload(); |
| 461 } | 461 } |
| 462 | 462 |
| 463 if (!opened || !EnsureDatabaseVersion()) { | 463 if (!opened || !EnsureDatabaseVersion()) { |
| 464 LOG(ERROR) << "Failed to open the quota database."; | 464 LOG(ERROR) << "Failed to open the quota database."; |
| 465 is_disabled_ = true; | 465 is_disabled_ = true; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 if (lhs.origin < rhs.origin) return true; | 648 if (lhs.origin < rhs.origin) return true; |
| 649 if (rhs.origin < lhs.origin) return false; | 649 if (rhs.origin < lhs.origin) return false; |
| 650 if (lhs.type < rhs.type) return true; | 650 if (lhs.type < rhs.type) return true; |
| 651 if (rhs.type < lhs.type) return false; | 651 if (rhs.type < lhs.type) return false; |
| 652 if (lhs.used_count < rhs.used_count) return true; | 652 if (lhs.used_count < rhs.used_count) return true; |
| 653 if (rhs.used_count < lhs.used_count) return false; | 653 if (rhs.used_count < lhs.used_count) return false; |
| 654 return lhs.last_access_time < rhs.last_access_time; | 654 return lhs.last_access_time < rhs.last_access_time; |
| 655 } | 655 } |
| 656 | 656 |
| 657 } // quota namespace | 657 } // quota namespace |
| OLD | NEW |