| 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 "chrome/browser/browsing_data/browsing_data_quota_helper.h" | 5 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/single_thread_task_runner.h" |
| 8 | 9 |
| 9 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo() | 10 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo() |
| 10 : temporary_usage(0), | 11 : temporary_usage(0), |
| 11 persistent_usage(0), | 12 persistent_usage(0), |
| 12 syncable_usage(0) {} | 13 syncable_usage(0) {} |
| 13 | 14 |
| 14 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host) | 15 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host) |
| 15 : host(host), | 16 : host(host), |
| 16 temporary_usage(0), | 17 temporary_usage(0), |
| 17 persistent_usage(0), | 18 persistent_usage(0), |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 | 29 |
| 29 BrowsingDataQuotaHelper::QuotaInfo::~QuotaInfo() {} | 30 BrowsingDataQuotaHelper::QuotaInfo::~QuotaInfo() {} |
| 30 | 31 |
| 31 // static | 32 // static |
| 32 void BrowsingDataQuotaHelperDeleter::Destruct( | 33 void BrowsingDataQuotaHelperDeleter::Destruct( |
| 33 const BrowsingDataQuotaHelper* helper) { | 34 const BrowsingDataQuotaHelper* helper) { |
| 34 helper->io_thread_->DeleteSoon(FROM_HERE, helper); | 35 helper->io_thread_->DeleteSoon(FROM_HERE, helper); |
| 35 } | 36 } |
| 36 | 37 |
| 37 BrowsingDataQuotaHelper::BrowsingDataQuotaHelper( | 38 BrowsingDataQuotaHelper::BrowsingDataQuotaHelper( |
| 38 base::MessageLoopProxy* io_thread) | 39 base::SingleThreadTaskRunner* io_thread) |
| 39 : io_thread_(io_thread) { | 40 : io_thread_(io_thread) { |
| 40 } | 41 } |
| 41 | 42 |
| 42 BrowsingDataQuotaHelper::~BrowsingDataQuotaHelper() { | 43 BrowsingDataQuotaHelper::~BrowsingDataQuotaHelper() { |
| 43 } | 44 } |
| 44 | 45 |
| 45 bool BrowsingDataQuotaHelper::QuotaInfo::operator <( | 46 bool BrowsingDataQuotaHelper::QuotaInfo::operator <( |
| 46 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const { | 47 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const { |
| 47 if (this->host != rhs.host) | 48 if (this->host != rhs.host) |
| 48 return this->host < rhs.host; | 49 return this->host < rhs.host; |
| 49 if (this->temporary_usage != rhs.temporary_usage) | 50 if (this->temporary_usage != rhs.temporary_usage) |
| 50 return this->temporary_usage < rhs.temporary_usage; | 51 return this->temporary_usage < rhs.temporary_usage; |
| 51 if (this->syncable_usage != rhs.syncable_usage) | 52 if (this->syncable_usage != rhs.syncable_usage) |
| 52 return this->syncable_usage < rhs.syncable_usage; | 53 return this->syncable_usage < rhs.syncable_usage; |
| 53 return this->persistent_usage < rhs.persistent_usage; | 54 return this->persistent_usage < rhs.persistent_usage; |
| 54 } | 55 } |
| 55 | 56 |
| 56 bool BrowsingDataQuotaHelper::QuotaInfo::operator ==( | 57 bool BrowsingDataQuotaHelper::QuotaInfo::operator ==( |
| 57 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const { | 58 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const { |
| 58 return this->host == rhs.host && | 59 return this->host == rhs.host && |
| 59 this->temporary_usage == rhs.temporary_usage && | 60 this->temporary_usage == rhs.temporary_usage && |
| 60 this->persistent_usage == rhs.persistent_usage && | 61 this->persistent_usage == rhs.persistent_usage && |
| 61 this->syncable_usage == rhs.syncable_usage; | 62 this->syncable_usage == rhs.syncable_usage; |
| 62 } | 63 } |
| OLD | NEW |