[sql] Remove _HAS_EXCEPTIONS=0 from build info.
[chromium-blink-merge.git] / chrome / browser / browsing_data / browsing_data_quota_helper.cc
bloba12281ebd236dcbe9d21e48238f078e49019dff2
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 "base/single_thread_task_runner.h"
10 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo()
11 : temporary_usage(0),
12 persistent_usage(0),
13 syncable_usage(0) {}
15 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host)
16 : host(host),
17 temporary_usage(0),
18 persistent_usage(0),
19 syncable_usage(0) {}
21 BrowsingDataQuotaHelper::QuotaInfo::QuotaInfo(const std::string& host,
22 int64 temporary_usage,
23 int64 persistent_usage,
24 int64 syncable_usage)
25 : host(host),
26 temporary_usage(temporary_usage),
27 persistent_usage(persistent_usage),
28 syncable_usage(syncable_usage) {}
30 BrowsingDataQuotaHelper::QuotaInfo::~QuotaInfo() {}
32 // static
33 void BrowsingDataQuotaHelperDeleter::Destruct(
34 const BrowsingDataQuotaHelper* helper) {
35 helper->io_thread_->DeleteSoon(FROM_HERE, helper);
38 BrowsingDataQuotaHelper::BrowsingDataQuotaHelper(
39 base::SingleThreadTaskRunner* io_thread)
40 : io_thread_(io_thread) {
43 BrowsingDataQuotaHelper::~BrowsingDataQuotaHelper() {
46 bool BrowsingDataQuotaHelper::QuotaInfo::operator <(
47 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const {
48 if (this->host != rhs.host)
49 return this->host < rhs.host;
50 if (this->temporary_usage != rhs.temporary_usage)
51 return this->temporary_usage < rhs.temporary_usage;
52 if (this->syncable_usage != rhs.syncable_usage)
53 return this->syncable_usage < rhs.syncable_usage;
54 return this->persistent_usage < rhs.persistent_usage;
57 bool BrowsingDataQuotaHelper::QuotaInfo::operator ==(
58 const BrowsingDataQuotaHelper::QuotaInfo& rhs) const {
59 return this->host == rhs.host &&
60 this->temporary_usage == rhs.temporary_usage &&
61 this->persistent_usage == rhs.persistent_usage &&
62 this->syncable_usage == rhs.syncable_usage;