OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/appcache/appcache_storage_impl.h" | 5 #include "webkit/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> |
(...skipping 26 matching lines...) Expand all Loading... |
37 // Hard coded default when not using quota management. | 37 // Hard coded default when not using quota management. |
38 static const int kDefaultQuota = 5 * 1024 * 1024; | 38 static const int kDefaultQuota = 5 * 1024 * 1024; |
39 | 39 |
40 static const int kMaxDiskCacheSize = 250 * 1024 * 1024; | 40 static const int kMaxDiskCacheSize = 250 * 1024 * 1024; |
41 static const int kMaxMemDiskCacheSize = 10 * 1024 * 1024; | 41 static const int kMaxMemDiskCacheSize = 10 * 1024 * 1024; |
42 static const FilePath::CharType kDiskCacheDirectoryName[] = | 42 static const FilePath::CharType kDiskCacheDirectoryName[] = |
43 FILE_PATH_LITERAL("Cache"); | 43 FILE_PATH_LITERAL("Cache"); |
44 | 44 |
45 namespace { | 45 namespace { |
46 | 46 |
47 // Helper with no return value for use with NewRunnableFunction. | 47 // Helper with no return value for use with base::Bind. |
| 48 // TODO(jhawkins): Figure out why base::IgnoreResult does not work for |
| 49 // file_util::Delete on Windows. |
48 void DeleteDirectory(const FilePath& path) { | 50 void DeleteDirectory(const FilePath& path) { |
49 file_util::Delete(path, true); | 51 file_util::Delete(path, true); |
50 } | 52 } |
51 | 53 |
52 // Helpers for clearing data from the AppCacheDatabase. | 54 // Helpers for clearing data from the AppCacheDatabase. |
53 bool DeleteGroupAndRelatedRecords(AppCacheDatabase* database, | 55 bool DeleteGroupAndRelatedRecords(AppCacheDatabase* database, |
54 int64 group_id, | 56 int64 group_id, |
55 std::vector<int64>* deletable_response_ids) { | 57 std::vector<int64>* deletable_response_ids) { |
56 AppCacheDatabase::CacheRecord cache_record; | 58 AppCacheDatabase::CacheRecord cache_record; |
57 bool success = false; | 59 bool success = false; |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1712 Disable(); | 1714 Disable(); |
1713 if (!is_incognito_) { | 1715 if (!is_incognito_) { |
1714 VLOG(1) << "Deleting existing appcache data and starting over."; | 1716 VLOG(1) << "Deleting existing appcache data and starting over."; |
1715 db_thread_->PostTask( | 1717 db_thread_->PostTask( |
1716 FROM_HERE, base::Bind(&DeleteDirectory, cache_directory_)); | 1718 FROM_HERE, base::Bind(&DeleteDirectory, cache_directory_)); |
1717 } | 1719 } |
1718 } | 1720 } |
1719 } | 1721 } |
1720 | 1722 |
1721 } // namespace appcache | 1723 } // namespace appcache |
OLD | NEW |