| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/browsing_data_quota_helper.h" | |
| 6 | |
| 7 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo() | |
| 8 : temporary_usage(0), | |
| 9 persistent_usage(0) {} | |
| 10 | |
| 11 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host) | |
| 12 : host(host), | |
| 13 temporary_usage(0), | |
| 14 persistent_usage(0) {} | |
| 15 | |
| 16 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host, | |
| 17 int64 temporary_usage, | |
| 18 int64 persistent_usage) | |
| 19 : host(host), | |
| 20 temporary_usage(temporary_usage), | |
| 21 persistent_usage(persistent_usage) {} | |
| 22 | |
| 23 BrowsingDataQuotaHelper::QuotaInfo::~QuotaInfo() {} | |
| 24 | |
| 25 // static | |
| 26 void BrowsingDataQuotaHelperDeleter::Destruct( | |
| 27 const BrowsingDataQuotaHelper* helper) { | |
| 28 helper->io_thread_->DeleteSoon(FROM_HERE, helper); | |
| 29 } | |
| 30 | |
| 31 BrowsingDataQuotaHelper::BrowsingDataQuotaHelper( | |
| 32 base::MessageLoopProxy* io_thread) | |
| 33 : io_thread_(io_thread) { | |
| 34 } | |
| 35 | |
| 36 BrowsingDataQuotaHelper::~BrowsingDataQuotaHelper() { | |
| 37 } | |
| 38 | |
| 39 bool operator <(const BrowsingDataQuotaHelper::QuotaInfo& lhs, | |
| 40 const BrowsingDataQuotaHelper::QuotaInfo& rhs) { | |
| 41 if (lhs.host != rhs.host) | |
| 42 return lhs.host < rhs.host; | |
| 43 if (lhs.temporary_usage != rhs.temporary_usage) | |
| 44 return lhs.temporary_usage < rhs.temporary_usage; | |
| 45 return lhs.persistent_usage < rhs.persistent_usage; | |
| 46 } | |
| 47 | |
| 48 bool operator ==(const BrowsingDataQuotaHelper::QuotaInfo& lhs, | |
| 49 const BrowsingDataQuotaHelper::QuotaInfo& rhs) { | |
| 50 return lhs.host == rhs.host && | |
| 51 lhs.temporary_usage == rhs.temporary_usage && | |
| 52 lhs.persistent_usage == rhs.persistent_usage; | |
| 53 } | |
| OLD | NEW |