| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_host.h" | 5 #include "content/browser/appcache/appcache_host.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 const GURL& origin, | 103 const GURL& origin, |
| 104 storage::StorageType type, | 104 storage::StorageType type, |
| 105 int64_t delta) override {} | 105 int64_t delta) override {} |
| 106 void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, | 106 void SetUsageCacheEnabled(storage::QuotaClient::ID client_id, |
| 107 const GURL& origin, | 107 const GURL& origin, |
| 108 storage::StorageType type, | 108 storage::StorageType type, |
| 109 bool enabled) override {} | 109 bool enabled) override {} |
| 110 void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner, | 110 void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner, |
| 111 const GURL& origin, | 111 const GURL& origin, |
| 112 storage::StorageType type, | 112 storage::StorageType type, |
| 113 const GetUsageAndQuotaCallback& callback) override {} | 113 const UsageAndQuotaCallback& callback) override {} |
| 114 | 114 |
| 115 void NotifyOriginInUse(const GURL& origin) override { inuse_[origin] += 1; } | 115 void NotifyOriginInUse(const GURL& origin) override { inuse_[origin] += 1; } |
| 116 | 116 |
| 117 void NotifyOriginNoLongerInUse(const GURL& origin) override { | 117 void NotifyOriginNoLongerInUse(const GURL& origin) override { |
| 118 inuse_[origin] -= 1; | 118 inuse_[origin] -= 1; |
| 119 } | 119 } |
| 120 | 120 |
| 121 int GetInUseCount(const GURL& origin) { | 121 int GetInUseCount(const GURL& origin) { |
| 122 return inuse_[origin]; | 122 return inuse_[origin]; |
| 123 } | 123 } |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 EXPECT_TRUE(host.SelectCache(kDocAndOriginUrl, kAppCacheNoCacheId, GURL())); | 541 EXPECT_TRUE(host.SelectCache(kDocAndOriginUrl, kAppCacheNoCacheId, GURL())); |
| 542 | 542 |
| 543 // Select methods should bail if cache has already been selected. | 543 // Select methods should bail if cache has already been selected. |
| 544 EXPECT_FALSE(host.SelectCache(kDocAndOriginUrl, kAppCacheNoCacheId, GURL())); | 544 EXPECT_FALSE(host.SelectCache(kDocAndOriginUrl, kAppCacheNoCacheId, GURL())); |
| 545 EXPECT_FALSE(host.SelectCacheForWorker(0, 0)); | 545 EXPECT_FALSE(host.SelectCacheForWorker(0, 0)); |
| 546 EXPECT_FALSE(host.SelectCacheForSharedWorker(kAppCacheNoCacheId)); | 546 EXPECT_FALSE(host.SelectCacheForSharedWorker(kAppCacheNoCacheId)); |
| 547 EXPECT_FALSE(host.MarkAsForeignEntry(kDocAndOriginUrl, kAppCacheNoCacheId)); | 547 EXPECT_FALSE(host.MarkAsForeignEntry(kDocAndOriginUrl, kAppCacheNoCacheId)); |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace content | 550 } // namespace content |
| OLD | NEW |