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

Side by Side Diff: content/browser/service_worker/service_worker_cache.h

Issue 542703002: Change ownership of the parameters to ServiceWorkerCache:: Put and Match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@keys
Patch Set: Rebase Created 6 years, 3 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/service_worker/service_worker_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_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 virtual ~ServiceWorkerCache(); 62 virtual ~ServiceWorkerCache();
63 63
64 // Loads the backend and calls the callback with the result (true for 64 // Loads the backend and calls the callback with the result (true for
65 // success). This must be called before member functions that require a 65 // success). This must be called before member functions that require a
66 // backend are called. The callback will always be called. 66 // backend are called. The callback will always be called.
67 void CreateBackend(const ErrorCallback& callback); 67 void CreateBackend(const ErrorCallback& callback);
68 68
69 // Returns ErrorTypeNotFound if not found. The callback will always be called. 69 // Returns ErrorTypeNotFound if not found. The callback will always be called.
70 // |request| must remain valid until the callback is called. 70 // |request| must remain valid until the callback is called.
71 void Match(ServiceWorkerFetchRequest* request, 71 void Match(scoped_ptr<ServiceWorkerFetchRequest> request,
72 const ResponseCallback& callback); 72 const ResponseCallback& callback);
73 73
74 // Puts the request and response object in the cache. The response body (if 74 // Puts the request and response object in the cache. The response body (if
75 // present) is stored in the cache, but not the request body. Returns 75 // present) is stored in the cache, but not the request body. Returns
76 // ErrorTypeOK on success. The callback will always be called. |request| and 76 // ErrorTypeOK on success. The callback will always be called. |request| and
77 // |response| must remain valid until the callback is called. 77 // |response| must remain valid until the callback is called.
78 void Put(ServiceWorkerFetchRequest* request, 78 void Put(scoped_ptr<ServiceWorkerFetchRequest> request,
79 ServiceWorkerResponse* response, 79 scoped_ptr<ServiceWorkerResponse> response,
80 const ErrorCallback& callback); 80 const ErrorCallback& callback);
81 81
82 // Returns ErrorNotFound if not found. Otherwise deletes and returns 82 // Returns ErrorNotFound if not found. Otherwise deletes and returns
83 // ErrorTypeOK. The callback will always be called. |request| must remain 83 // ErrorTypeOK. The callback will always be called. |request| must remain
84 // valid until the callback is called. 84 // valid until the callback is called.
85 void Delete(ServiceWorkerFetchRequest* request, 85 void Delete(scoped_ptr<ServiceWorkerFetchRequest> request,
86 const ErrorCallback& callback); 86 const ErrorCallback& callback);
87 87
88 // TODO(jkarlin): Have keys take an optional ServiceWorkerFetchRequest. 88 // TODO(jkarlin): Have keys take an optional ServiceWorkerFetchRequest.
89 // Returns ErrorTypeOK and a vector of requests if there are no errors. The 89 // Returns ErrorTypeOK and a vector of requests if there are no errors. The
90 // callback will always be called. 90 // callback will always be called.
91 void Keys(const RequestsCallback& callback); 91 void Keys(const RequestsCallback& callback);
92 92
93 // Call to determine if CreateBackend must be called. 93 // Call to determine if CreateBackend must be called.
94 bool HasCreatedBackend() const; 94 bool HasCreatedBackend() const;
95 95
(...skipping 27 matching lines...) Expand all
123 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; 123 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_;
124 124
125 base::WeakPtrFactory<ServiceWorkerCache> weak_ptr_factory_; 125 base::WeakPtrFactory<ServiceWorkerCache> weak_ptr_factory_;
126 126
127 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCache); 127 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCache);
128 }; 128 };
129 129
130 } // namespace content 130 } // namespace content
131 131
132 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ 132 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698