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 "content/browser/appcache/appcache_storage_impl.h" | 5 #include "content/browser/appcache/appcache_storage_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <functional> | 10 #include <functional> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 return success; | 76 return success; |
77 } | 77 } |
78 | 78 |
79 // Destroys |database|. If there is appcache data to be deleted | 79 // Destroys |database|. If there is appcache data to be deleted |
80 // (|force_keep_session_state| is false), deletes session-only appcache data. | 80 // (|force_keep_session_state| is false), deletes session-only appcache data. |
81 void ClearSessionOnlyOrigins( | 81 void ClearSessionOnlyOrigins( |
82 AppCacheDatabase* database, | 82 AppCacheDatabase* database, |
83 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy, | 83 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy, |
84 bool force_keep_session_state) { | 84 bool force_keep_session_state) { |
85 scoped_ptr<AppCacheDatabase> database_to_delete(database); | 85 std::unique_ptr<AppCacheDatabase> database_to_delete(database); |
86 | 86 |
87 // If saving session state, only delete the database. | 87 // If saving session state, only delete the database. |
88 if (force_keep_session_state) | 88 if (force_keep_session_state) |
89 return; | 89 return; |
90 | 90 |
91 bool has_session_only_appcaches = | 91 bool has_session_only_appcaches = |
92 special_storage_policy.get() && | 92 special_storage_policy.get() && |
93 special_storage_policy->HasSessionOnlyOrigins(); | 93 special_storage_policy->HasSessionOnlyOrigins(); |
94 | 94 |
95 // Clearning only session-only databases, and there are none. | 95 // Clearning only session-only databases, and there are none. |
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 | 1987 |
1988 void AppCacheStorageImpl::OnLazyCommitTimer() { | 1988 void AppCacheStorageImpl::OnLazyCommitTimer() { |
1989 lazy_commit_timer_.Stop(); | 1989 lazy_commit_timer_.Stop(); |
1990 if (is_disabled()) | 1990 if (is_disabled()) |
1991 return; | 1991 return; |
1992 scoped_refptr<DatabaseTask> task(new CommitLastAccessTimesTask(this)); | 1992 scoped_refptr<DatabaseTask> task(new CommitLastAccessTimesTask(this)); |
1993 task->Schedule(); | 1993 task->Schedule(); |
1994 } | 1994 } |
1995 | 1995 |
1996 } // namespace content | 1996 } // namespace content |
OLD | NEW |