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 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1727 } | 1727 } |
1728 | 1728 |
1729 void AppCacheStorageImpl::StoreEvictionTimes(AppCacheGroup* group) { | 1729 void AppCacheStorageImpl::StoreEvictionTimes(AppCacheGroup* group) { |
1730 scoped_refptr<UpdateEvictionTimesTask> task( | 1730 scoped_refptr<UpdateEvictionTimesTask> task( |
1731 new UpdateEvictionTimesTask(this, group)); | 1731 new UpdateEvictionTimesTask(this, group)); |
1732 task->Schedule(); | 1732 task->Schedule(); |
1733 } | 1733 } |
1734 | 1734 |
1735 AppCacheResponseReader* AppCacheStorageImpl::CreateResponseReader( | 1735 AppCacheResponseReader* AppCacheStorageImpl::CreateResponseReader( |
1736 const GURL& manifest_url, | 1736 const GURL& manifest_url, |
1737 int64_t group_id, | |
1738 int64_t response_id) { | 1737 int64_t response_id) { |
1739 return new AppCacheResponseReader(response_id, group_id, | 1738 return new AppCacheResponseReader(response_id, disk_cache()->GetWeakPtr()); |
1740 disk_cache()->GetWeakPtr()); | |
1741 } | 1739 } |
1742 | 1740 |
1743 AppCacheResponseWriter* AppCacheStorageImpl::CreateResponseWriter( | 1741 AppCacheResponseWriter* AppCacheStorageImpl::CreateResponseWriter( |
1744 const GURL& manifest_url, | 1742 const GURL& manifest_url) { |
1745 int64_t group_id) { | 1743 return new AppCacheResponseWriter(NewResponseId(), |
1746 return new AppCacheResponseWriter(NewResponseId(), group_id, | |
1747 disk_cache()->GetWeakPtr()); | 1744 disk_cache()->GetWeakPtr()); |
1748 } | 1745 } |
1749 | 1746 |
1750 AppCacheResponseMetadataWriter* | 1747 AppCacheResponseMetadataWriter* |
1751 AppCacheStorageImpl::CreateResponseMetadataWriter(int64_t group_id, | 1748 AppCacheStorageImpl::CreateResponseMetadataWriter(int64_t response_id) { |
1752 int64_t response_id) { | 1749 return new AppCacheResponseMetadataWriter(response_id, |
1753 return new AppCacheResponseMetadataWriter(response_id, group_id, | |
1754 disk_cache()->GetWeakPtr()); | 1750 disk_cache()->GetWeakPtr()); |
1755 } | 1751 } |
1756 | 1752 |
1757 void AppCacheStorageImpl::DoomResponses( | 1753 void AppCacheStorageImpl::DoomResponses( |
1758 const GURL& manifest_url, | 1754 const GURL& manifest_url, |
1759 const std::vector<int64_t>& response_ids) { | 1755 const std::vector<int64_t>& response_ids) { |
1760 if (response_ids.empty()) | 1756 if (response_ids.empty()) |
1761 return; | 1757 return; |
1762 | 1758 |
1763 // Start deleting them from the disk cache lazily. | 1759 // Start deleting them from the disk cache lazily. |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 | 1983 |
1988 void AppCacheStorageImpl::OnLazyCommitTimer() { | 1984 void AppCacheStorageImpl::OnLazyCommitTimer() { |
1989 lazy_commit_timer_.Stop(); | 1985 lazy_commit_timer_.Stop(); |
1990 if (is_disabled()) | 1986 if (is_disabled()) |
1991 return; | 1987 return; |
1992 scoped_refptr<DatabaseTask> task(new CommitLastAccessTimesTask(this)); | 1988 scoped_refptr<DatabaseTask> task(new CommitLastAccessTimesTask(this)); |
1993 task->Schedule(); | 1989 task->Schedule(); |
1994 } | 1990 } |
1995 | 1991 |
1996 } // namespace content | 1992 } // namespace content |
OLD | NEW |