| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/quota_manager.h" | 5 #include "webkit/browser/quota/quota_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <functional> | 9 #include <functional> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "webkit/browser/quota/quota_temporary_storage_evictor.h" | 28 #include "webkit/browser/quota/quota_temporary_storage_evictor.h" |
| 29 #include "webkit/browser/quota/storage_monitor.h" | 29 #include "webkit/browser/quota/storage_monitor.h" |
| 30 #include "webkit/browser/quota/usage_tracker.h" | 30 #include "webkit/browser/quota/usage_tracker.h" |
| 31 #include "webkit/common/quota/quota_types.h" | 31 #include "webkit/common/quota/quota_types.h" |
| 32 | 32 |
| 33 #define UMA_HISTOGRAM_MBYTES(name, sample) \ | 33 #define UMA_HISTOGRAM_MBYTES(name, sample) \ |
| 34 UMA_HISTOGRAM_CUSTOM_COUNTS( \ | 34 UMA_HISTOGRAM_CUSTOM_COUNTS( \ |
| 35 (name), static_cast<int>((sample) / kMBytes), \ | 35 (name), static_cast<int>((sample) / kMBytes), \ |
| 36 1, 10 * 1024 * 1024 /* 10TB */, 100) | 36 1, 10 * 1024 * 1024 /* 10TB */, 100) |
| 37 | 37 |
| 38 namespace quota { | 38 namespace storage { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 const int64 kMBytes = 1024 * 1024; | 42 const int64 kMBytes = 1024 * 1024; |
| 43 const int kMinutesInMilliSeconds = 60 * 1000; | 43 const int kMinutesInMilliSeconds = 60 * 1000; |
| 44 | 44 |
| 45 const int64 kReportHistogramInterval = 60 * 60 * 1000; // 1 hour | 45 const int64 kReportHistogramInterval = 60 * 60 * 1000; // 1 hour |
| 46 const double kTemporaryQuotaRatioToAvail = 1.0 / 3.0; // 33% | 46 const double kTemporaryQuotaRatioToAvail = 1.0 / 3.0; // 33% |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| (...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 // Deleting manager will post another task to DB thread to delete | 1621 // Deleting manager will post another task to DB thread to delete |
| 1622 // |database_|, therefore we can be sure that database_ is alive when this | 1622 // |database_|, therefore we can be sure that database_ is alive when this |
| 1623 // task runs. | 1623 // task runs. |
| 1624 base::PostTaskAndReplyWithResult( | 1624 base::PostTaskAndReplyWithResult( |
| 1625 db_thread_.get(), | 1625 db_thread_.get(), |
| 1626 from_here, | 1626 from_here, |
| 1627 base::Bind(task, base::Unretained(database_.get())), | 1627 base::Bind(task, base::Unretained(database_.get())), |
| 1628 reply); | 1628 reply); |
| 1629 } | 1629 } |
| 1630 | 1630 |
| 1631 } // namespace quota | 1631 } // namespace storage |
| OLD | NEW |