| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/net/sqlite_persistent_cookie_store.h" | 5 #include "content/browser/net/sqlite_persistent_cookie_store.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 538 |
| 539 if (initialized_ || corruption_detected_) { | 539 if (initialized_ || corruption_detected_) { |
| 540 // Return false if we were previously initialized but the DB has since been | 540 // Return false if we were previously initialized but the DB has since been |
| 541 // closed, or if corruption caused a database reset during initialization. | 541 // closed, or if corruption caused a database reset during initialization. |
| 542 return db_ != NULL; | 542 return db_ != NULL; |
| 543 } | 543 } |
| 544 | 544 |
| 545 base::Time start = base::Time::Now(); | 545 base::Time start = base::Time::Now(); |
| 546 | 546 |
| 547 const base::FilePath dir = path_.DirName(); | 547 const base::FilePath dir = path_.DirName(); |
| 548 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) { | 548 if (!base::PathExists(dir) && !file_util::CreateDirectory(dir)) { |
| 549 return false; | 549 return false; |
| 550 } | 550 } |
| 551 | 551 |
| 552 int64 db_size = 0; | 552 int64 db_size = 0; |
| 553 if (file_util::GetFileSize(path_, &db_size)) | 553 if (file_util::GetFileSize(path_, &db_size)) |
| 554 UMA_HISTOGRAM_COUNTS("Cookie.DBSizeInKB", db_size / 1024 ); | 554 UMA_HISTOGRAM_COUNTS("Cookie.DBSizeInKB", db_size / 1024 ); |
| 555 | 555 |
| 556 db_.reset(new sql::Connection); | 556 db_.reset(new sql::Connection); |
| 557 db_->set_histogram_tag("Cookie"); | 557 db_->set_histogram_tag("Cookie"); |
| 558 | 558 |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 | 1199 |
| 1200 const std::string cookie_priority_experiment_group = | 1200 const std::string cookie_priority_experiment_group = |
| 1201 base::FieldTrialList::FindFullName("CookieRetentionPriorityStudy"); | 1201 base::FieldTrialList::FindFullName("CookieRetentionPriorityStudy"); |
| 1202 cookie_monster->SetPriorityAwareGarbageCollection( | 1202 cookie_monster->SetPriorityAwareGarbageCollection( |
| 1203 cookie_priority_experiment_group == "ExperimentOn"); | 1203 cookie_priority_experiment_group == "ExperimentOn"); |
| 1204 | 1204 |
| 1205 return cookie_monster; | 1205 return cookie_monster; |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 } // namespace content | 1208 } // namespace content |
| OLD | NEW |