Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / browsing_data / browsing_data_quota_helper.cc
blob8e7ac84cf1a5550acfe63f4ccad03826f8d647fb
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
3 // found in the LICENSE file.
5 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h"
7 #include "base/location.h"
8 #include "content/public/browser/browser_thread.h"
10 using content::BrowserThread;
12 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo() {}
14 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host)
15 : host(host) {}
17 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host,
18 int64 temporary_usage,
19 int64 persistent_usage,
20 int64 syncable_usage)
21 : host(host),
22 temporary_usage(temporary_usage),
23 persistent_usage(persistent_usage),
24 syncable_usage(syncable_usage) {}
26 BrowsingDataQuotaHelper::QuotaInfo::~QuotaInfo() {}
28 // static
29 void BrowsingDataQuotaHelperDeleter::Destruct(
30 const BrowsingDataQuotaHelper* helper) {
31 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, helper);
34 BrowsingDataQuotaHelper::BrowsingDataQuotaHelper() {}
36 BrowsingDataQuotaHelper::~BrowsingDataQuotaHelper() {
39 bool BrowsingDataQuotaHelper::QuotaInfo::operator <(
40 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const {
41 if (this->host != rhs.host)
42 return this->host < rhs.host;
43 if (this->temporary_usage != rhs.temporary_usage)
44 return this->temporary_usage < rhs.temporary_usage;
45 if (this->syncable_usage != rhs.syncable_usage)
46 return this->syncable_usage < rhs.syncable_usage;
47 return this->persistent_usage < rhs.persistent_usage;
50 bool BrowsingDataQuotaHelper::QuotaInfo::operator ==(
51 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const {
52 return this->host == rhs.host &&
53 this->temporary_usage == rhs.temporary_usage &&
54 this->persistent_usage == rhs.persistent_usage &&
55 this->syncable_usage == rhs.syncable_usage;