Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Side by Side Diff: content/browser/cache_storage/cache_storage_cache.h

Issue 1636613002: [CacheStorage] Check quota before put operations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set quota per origin and fix order of operations error Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/id_map.h" 14 #include "base/id_map.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "content/common/cache_storage/cache_storage_types.h" 18 #include "content/common/cache_storage/cache_storage_types.h"
19 #include "content/common/service_worker/service_worker_types.h" 19 #include "content/common/service_worker/service_worker_types.h"
20 #include "net/disk_cache/disk_cache.h" 20 #include "net/disk_cache/disk_cache.h"
21 #include "storage/common/quota/quota_status_code.h"
21 22
22 namespace net { 23 namespace net {
23 class URLRequestContextGetter; 24 class URLRequestContextGetter;
24 class IOBufferWithSize; 25 class IOBufferWithSize;
25 } 26 }
26 27
27 namespace storage { 28 namespace storage {
28 class BlobDataHandle; 29 class BlobDataHandle;
29 class BlobStorageContext; 30 class BlobStorageContext;
30 class QuotaManagerProxy; 31 class QuotaManagerProxy;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 scoped_ptr<CacheMetadata> metadata); 184 scoped_ptr<CacheMetadata> metadata);
184 185
185 // Puts the request and response object in the cache. The response body (if 186 // Puts the request and response object in the cache. The response body (if
186 // present) is stored in the cache, but not the request body. Returns OK on 187 // present) is stored in the cache, but not the request body. Returns OK on
187 // success. 188 // success.
188 void Put(const CacheStorageBatchOperation& operation, 189 void Put(const CacheStorageBatchOperation& operation,
189 const ErrorCallback& callback); 190 const ErrorCallback& callback);
190 void PutImpl(scoped_ptr<PutContext> put_context); 191 void PutImpl(scoped_ptr<PutContext> put_context);
191 void PutDidDelete(scoped_ptr<PutContext> put_context, 192 void PutDidDelete(scoped_ptr<PutContext> put_context,
192 CacheStorageError delete_error); 193 CacheStorageError delete_error);
194 void PutDidGetUsageAndQuota(scoped_ptr<PutContext> put_context,
195 storage::QuotaStatusCode status_code,
196 int64_t usage,
197 int64_t quota);
193 void PutDidCreateEntry(scoped_ptr<disk_cache::Entry*> entry_ptr, 198 void PutDidCreateEntry(scoped_ptr<disk_cache::Entry*> entry_ptr,
194 scoped_ptr<PutContext> put_context, 199 scoped_ptr<PutContext> put_context,
195 int rv); 200 int rv);
196 void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, 201 void PutDidWriteHeaders(scoped_ptr<PutContext> put_context,
197 int expected_bytes, 202 int expected_bytes,
198 int rv); 203 int rv);
199 void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, 204 void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context,
200 BlobToDiskCacheIDMap::KeyType blob_to_cache_key, 205 BlobToDiskCacheIDMap::KeyType blob_to_cache_key,
201 disk_cache::ScopedEntryPtr entry, 206 disk_cache::ScopedEntryPtr entry,
202 bool success); 207 bool success);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 bool memory_only_; 283 bool memory_only_;
279 284
280 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; 285 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_;
281 286
282 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); 287 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache);
283 }; 288 };
284 289
285 } // namespace content 290 } // namespace content
286 291
287 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ 292 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698