| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "webkit/browser/quota/storage_observer.h" | 5 #include "storage/browser/quota/storage_observer.h" |
| 6 | 6 |
| 7 namespace quota { | 7 namespace quota { |
| 8 | 8 |
| 9 // StorageObserver::Filter | 9 // StorageObserver::Filter |
| 10 | 10 |
| 11 StorageObserver::Filter::Filter() | 11 StorageObserver::Filter::Filter() : storage_type(kStorageTypeUnknown) { |
| 12 : storage_type(kStorageTypeUnknown) { | |
| 13 } | 12 } |
| 14 | 13 |
| 15 StorageObserver::Filter::Filter(StorageType storage_type, const GURL& origin) | 14 StorageObserver::Filter::Filter(StorageType storage_type, const GURL& origin) |
| 16 : storage_type(storage_type), origin(origin) { | 15 : storage_type(storage_type), origin(origin) { |
| 17 } | 16 } |
| 18 | 17 |
| 19 bool StorageObserver::Filter::operator==(const Filter& other) const { | 18 bool StorageObserver::Filter::operator==(const Filter& other) const { |
| 20 return storage_type == other.storage_type && | 19 return storage_type == other.storage_type && origin == other.origin; |
| 21 origin == other.origin; | |
| 22 } | 20 } |
| 23 | 21 |
| 24 // StorageObserver::MonitorParams | 22 // StorageObserver::MonitorParams |
| 25 | 23 |
| 26 StorageObserver::MonitorParams::MonitorParams() | 24 StorageObserver::MonitorParams::MonitorParams() |
| 27 : dispatch_initial_state(false) { | 25 : dispatch_initial_state(false) { |
| 28 } | 26 } |
| 29 | 27 |
| 30 StorageObserver::MonitorParams::MonitorParams( | 28 StorageObserver::MonitorParams::MonitorParams(StorageType storage_type, |
| 31 StorageType storage_type, | 29 const GURL& origin, |
| 32 const GURL& origin, | 30 const base::TimeDelta& rate, |
| 33 const base::TimeDelta& rate, | 31 bool get_initial_state) |
| 34 bool get_initial_state) | 32 : filter(storage_type, origin), |
| 35 : filter(storage_type, origin), | 33 rate(rate), |
| 36 rate(rate), | 34 dispatch_initial_state(get_initial_state) { |
| 37 dispatch_initial_state(get_initial_state) { | |
| 38 } | 35 } |
| 39 | 36 |
| 40 StorageObserver::MonitorParams::MonitorParams( | 37 StorageObserver::MonitorParams::MonitorParams(const Filter& filter, |
| 41 const Filter& filter, | 38 const base::TimeDelta& rate, |
| 42 const base::TimeDelta& rate, | 39 bool get_initial_state) |
| 43 bool get_initial_state) | 40 : filter(filter), rate(rate), dispatch_initial_state(get_initial_state) { |
| 44 : filter(filter), | |
| 45 rate(rate), | |
| 46 dispatch_initial_state(get_initial_state) { | |
| 47 } | 41 } |
| 48 | 42 |
| 49 // StorageObserver::Event | 43 // StorageObserver::Event |
| 50 | 44 |
| 51 StorageObserver::Event::Event() | 45 StorageObserver::Event::Event() : usage(0), quota(0) { |
| 52 : usage(0), quota(0) { | |
| 53 } | 46 } |
| 54 | 47 |
| 55 StorageObserver::Event::Event(const Filter& filter, int64 usage, int64 quota) | 48 StorageObserver::Event::Event(const Filter& filter, int64 usage, int64 quota) |
| 56 : filter(filter), usage(usage), quota(quota) { | 49 : filter(filter), usage(usage), quota(quota) { |
| 57 } | 50 } |
| 58 | 51 |
| 59 bool StorageObserver::Event::operator==(const Event& other) const { | 52 bool StorageObserver::Event::operator==(const Event& other) const { |
| 60 return filter == other.filter && | 53 return filter == other.filter && usage == other.usage && quota == other.quota; |
| 61 usage == other.usage && | |
| 62 quota == other.quota; | |
| 63 } | 54 } |
| 64 | 55 |
| 65 } // namespace quota | 56 } // namespace quota |
| OLD | NEW |