| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/appcache/appcache_storage_impl.h" | 5 #include "content/browser/appcache/appcache_storage_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "content/browser/appcache/appcache.h" |
| 20 #include "content/browser/appcache/appcache_database.h" |
| 21 #include "content/browser/appcache/appcache_entry.h" |
| 22 #include "content/browser/appcache/appcache_group.h" |
| 23 #include "content/browser/appcache/appcache_histograms.h" |
| 24 #include "content/browser/appcache/appcache_quota_client.h" |
| 25 #include "content/browser/appcache/appcache_response.h" |
| 26 #include "content/browser/appcache/appcache_service_impl.h" |
| 19 #include "net/base/cache_type.h" | 27 #include "net/base/cache_type.h" |
| 20 #include "net/base/net_errors.h" | 28 #include "net/base/net_errors.h" |
| 21 #include "sql/connection.h" | 29 #include "sql/connection.h" |
| 22 #include "sql/transaction.h" | 30 #include "sql/transaction.h" |
| 23 #include "webkit/browser/appcache/appcache.h" | |
| 24 #include "webkit/browser/appcache/appcache_database.h" | |
| 25 #include "webkit/browser/appcache/appcache_entry.h" | |
| 26 #include "webkit/browser/appcache/appcache_group.h" | |
| 27 #include "webkit/browser/appcache/appcache_histograms.h" | |
| 28 #include "webkit/browser/appcache/appcache_quota_client.h" | |
| 29 #include "webkit/browser/appcache/appcache_response.h" | |
| 30 #include "webkit/browser/appcache/appcache_service_impl.h" | |
| 31 #include "webkit/browser/quota/quota_client.h" | 31 #include "webkit/browser/quota/quota_client.h" |
| 32 #include "webkit/browser/quota/quota_manager.h" | 32 #include "webkit/browser/quota/quota_manager.h" |
| 33 #include "webkit/browser/quota/quota_manager_proxy.h" | 33 #include "webkit/browser/quota/quota_manager_proxy.h" |
| 34 #include "webkit/browser/quota/special_storage_policy.h" | 34 #include "webkit/browser/quota/special_storage_policy.h" |
| 35 | 35 |
| 36 namespace appcache { | 36 namespace content { |
| 37 | 37 |
| 38 // Hard coded default when not using quota management. | 38 // Hard coded default when not using quota management. |
| 39 static const int kDefaultQuota = 5 * 1024 * 1024; | 39 static const int kDefaultQuota = 5 * 1024 * 1024; |
| 40 | 40 |
| 41 static const int kMaxDiskCacheSize = 250 * 1024 * 1024; | 41 static const int kMaxDiskCacheSize = 250 * 1024 * 1024; |
| 42 static const int kMaxMemDiskCacheSize = 10 * 1024 * 1024; | 42 static const int kMaxMemDiskCacheSize = 10 * 1024 * 1024; |
| 43 static const base::FilePath::CharType kDiskCacheDirectoryName[] = | 43 static const base::FilePath::CharType kDiskCacheDirectoryName[] = |
| 44 FILE_PATH_LITERAL("Cache"); | 44 FILE_PATH_LITERAL("Cache"); |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| (...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 cache_directory_, true), | 1850 cache_directory_, true), |
| 1851 base::Bind(&AppCacheStorageImpl::CallScheduleReinitialize, | 1851 base::Bind(&AppCacheStorageImpl::CallScheduleReinitialize, |
| 1852 weak_factory_.GetWeakPtr())); | 1852 weak_factory_.GetWeakPtr())); |
| 1853 } | 1853 } |
| 1854 | 1854 |
| 1855 void AppCacheStorageImpl::CallScheduleReinitialize() { | 1855 void AppCacheStorageImpl::CallScheduleReinitialize() { |
| 1856 service_->ScheduleReinitialize(); | 1856 service_->ScheduleReinitialize(); |
| 1857 // note: 'this' may be deleted at this point. | 1857 // note: 'this' may be deleted at this point. |
| 1858 } | 1858 } |
| 1859 | 1859 |
| 1860 } // namespace appcache | 1860 } // namespace content |
| OLD | NEW |