1 // Copyright 2014 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 "storage/browser/quota/storage_observer.h"
9 // StorageObserver::Filter
11 StorageObserver::Filter::Filter()
12 : storage_type(kStorageTypeUnknown
) {
15 StorageObserver::Filter::Filter(StorageType storage_type
, const GURL
& origin
)
16 : storage_type(storage_type
), origin(origin
) {
19 bool StorageObserver::Filter::operator==(const Filter
& other
) const {
20 return storage_type
== other
.storage_type
&&
21 origin
== other
.origin
;
24 // StorageObserver::MonitorParams
26 StorageObserver::MonitorParams::MonitorParams()
27 : dispatch_initial_state(false) {
30 StorageObserver::MonitorParams::MonitorParams(
31 StorageType storage_type
,
33 const base::TimeDelta
& rate
,
34 bool get_initial_state
)
35 : filter(storage_type
, origin
),
37 dispatch_initial_state(get_initial_state
) {
40 StorageObserver::MonitorParams::MonitorParams(
42 const base::TimeDelta
& rate
,
43 bool get_initial_state
)
46 dispatch_initial_state(get_initial_state
) {
49 // StorageObserver::Event
51 StorageObserver::Event::Event()
52 : usage(0), quota(0) {
55 StorageObserver::Event::Event(const Filter
& filter
, int64 usage
, int64 quota
)
56 : filter(filter
), usage(usage
), quota(quota
) {
59 bool StorageObserver::Event::operator==(const Event
& other
) const {
60 return filter
== other
.filter
&&
61 usage
== other
.usage
&&
65 } // namespace storage