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 | 8 |
9 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo() | 9 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo() |
10 : temporary_usage(0), | 10 : temporary_usage(0), |
11 persistent_usage(0) {} | 11 persistent_usage(0), |
| 12 syncable_usage(0) {} |
12 | 13 |
13 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host) | 14 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host) |
14 : host(host), | 15 : host(host), |
15 temporary_usage(0), | 16 temporary_usage(0), |
16 persistent_usage(0) {} | 17 persistent_usage(0), |
| 18 syncable_usage(0) {} |
17 | 19 |
18 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host, | 20 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host, |
19 int64 temporary_usage, | 21 int64 temporary_usage, |
20 int64 persistent_usage) | 22 int64 persistent_usage, |
| 23 int64 syncable_usage) |
21 : host(host), | 24 : host(host), |
22 temporary_usage(temporary_usage), | 25 temporary_usage(temporary_usage), |
23 persistent_usage(persistent_usage) {} | 26 persistent_usage(persistent_usage), |
| 27 syncable_usage(syncable_usage) {} |
24 | 28 |
25 BrowsingDataQuotaHelper::QuotaInfo::~QuotaInfo() {} | 29 BrowsingDataQuotaHelper::QuotaInfo::~QuotaInfo() {} |
26 | 30 |
27 // static | 31 // static |
28 void BrowsingDataQuotaHelperDeleter::Destruct( | 32 void BrowsingDataQuotaHelperDeleter::Destruct( |
29 const BrowsingDataQuotaHelper* helper) { | 33 const BrowsingDataQuotaHelper* helper) { |
30 helper->io_thread_->DeleteSoon(FROM_HERE, helper); | 34 helper->io_thread_->DeleteSoon(FROM_HERE, helper); |
31 } | 35 } |
32 | 36 |
33 BrowsingDataQuotaHelper::BrowsingDataQuotaHelper( | 37 BrowsingDataQuotaHelper::BrowsingDataQuotaHelper( |
34 base::MessageLoopProxy* io_thread) | 38 base::MessageLoopProxy* io_thread) |
35 : io_thread_(io_thread) { | 39 : io_thread_(io_thread) { |
36 } | 40 } |
37 | 41 |
38 BrowsingDataQuotaHelper::~BrowsingDataQuotaHelper() { | 42 BrowsingDataQuotaHelper::~BrowsingDataQuotaHelper() { |
39 } | 43 } |
40 | 44 |
41 bool BrowsingDataQuotaHelper::QuotaInfo::operator <( | 45 bool BrowsingDataQuotaHelper::QuotaInfo::operator <( |
42 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const { | 46 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const { |
43 if (this->host != rhs.host) | 47 if (this->host != rhs.host) |
44 return this->host < rhs.host; | 48 return this->host < rhs.host; |
45 if (this->temporary_usage != rhs.temporary_usage) | 49 if (this->temporary_usage != rhs.temporary_usage) |
46 return this->temporary_usage < rhs.temporary_usage; | 50 return this->temporary_usage < rhs.temporary_usage; |
| 51 if (this->syncable_usage != rhs.syncable_usage) |
| 52 return this->syncable_usage < rhs.syncable_usage; |
47 return this->persistent_usage < rhs.persistent_usage; | 53 return this->persistent_usage < rhs.persistent_usage; |
48 } | 54 } |
49 | 55 |
50 bool BrowsingDataQuotaHelper::QuotaInfo::operator ==( | 56 bool BrowsingDataQuotaHelper::QuotaInfo::operator ==( |
51 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const { | 57 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const { |
52 return this->host == rhs.host && | 58 return this->host == rhs.host && |
53 this->temporary_usage == rhs.temporary_usage && | 59 this->temporary_usage == rhs.temporary_usage && |
54 this->persistent_usage == rhs.persistent_usage; | 60 this->persistent_usage == rhs.persistent_usage && |
| 61 this->syncable_usage == rhs.syncable_usage; |
55 } | 62 } |
OLD | NEW |