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

Side by Side Diff: content/browser/appcache/appcache_service_impl.cc

Issue 631773003: Replacing the OVERRIDE with override and FINAL with final in content/browser/appcache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 #include "content/browser/appcache/appcache_service_impl.h" 5 #include "content/browser/appcache/appcache_service_impl.h"
6 6
7 #include <functional> 7 #include <functional>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 class AppCacheServiceImpl::CanHandleOfflineHelper : AsyncHelper { 87 class AppCacheServiceImpl::CanHandleOfflineHelper : AsyncHelper {
88 public: 88 public:
89 CanHandleOfflineHelper( 89 CanHandleOfflineHelper(
90 AppCacheServiceImpl* service, const GURL& url, 90 AppCacheServiceImpl* service, const GURL& url,
91 const GURL& first_party, const net::CompletionCallback& callback) 91 const GURL& first_party, const net::CompletionCallback& callback)
92 : AsyncHelper(service, callback), 92 : AsyncHelper(service, callback),
93 url_(url), 93 url_(url),
94 first_party_(first_party) { 94 first_party_(first_party) {
95 } 95 }
96 96
97 virtual void Start() OVERRIDE { 97 virtual void Start() override {
98 AppCachePolicy* policy = service_->appcache_policy(); 98 AppCachePolicy* policy = service_->appcache_policy();
99 if (policy && !policy->CanLoadAppCache(url_, first_party_)) { 99 if (policy && !policy->CanLoadAppCache(url_, first_party_)) {
100 CallCallback(net::ERR_FAILED); 100 CallCallback(net::ERR_FAILED);
101 delete this; 101 delete this;
102 return; 102 return;
103 } 103 }
104 104
105 service_->storage()->FindResponseForMainRequest(url_, GURL(), this); 105 service_->storage()->FindResponseForMainRequest(url_, GURL(), this);
106 } 106 }
107 107
108 private: 108 private:
109 // AppCacheStorage::Delegate implementation. 109 // AppCacheStorage::Delegate implementation.
110 virtual void OnMainResponseFound( 110 virtual void OnMainResponseFound(
111 const GURL& url, const AppCacheEntry& entry, 111 const GURL& url, const AppCacheEntry& entry,
112 const GURL& fallback_url, const AppCacheEntry& fallback_entry, 112 const GURL& fallback_url, const AppCacheEntry& fallback_entry,
113 int64 cache_id, int64 group_id, const GURL& mainfest_url) OVERRIDE; 113 int64 cache_id, int64 group_id, const GURL& mainfest_url) override;
114 114
115 GURL url_; 115 GURL url_;
116 GURL first_party_; 116 GURL first_party_;
117 117
118 DISALLOW_COPY_AND_ASSIGN(CanHandleOfflineHelper); 118 DISALLOW_COPY_AND_ASSIGN(CanHandleOfflineHelper);
119 }; 119 };
120 120
121 void AppCacheServiceImpl::CanHandleOfflineHelper::OnMainResponseFound( 121 void AppCacheServiceImpl::CanHandleOfflineHelper::OnMainResponseFound(
122 const GURL& url, const AppCacheEntry& entry, 122 const GURL& url, const AppCacheEntry& entry,
123 const GURL& fallback_url, const AppCacheEntry& fallback_entry, 123 const GURL& fallback_url, const AppCacheEntry& fallback_entry,
124 int64 cache_id, int64 group_id, const GURL& manifest_url) { 124 int64 cache_id, int64 group_id, const GURL& manifest_url) {
125 bool can = (entry.has_response_id() || fallback_entry.has_response_id()); 125 bool can = (entry.has_response_id() || fallback_entry.has_response_id());
126 CallCallback(can ? net::OK : net::ERR_FAILED); 126 CallCallback(can ? net::OK : net::ERR_FAILED);
127 delete this; 127 delete this;
128 } 128 }
129 129
130 // DeleteHelper ------- 130 // DeleteHelper -------
131 131
132 class AppCacheServiceImpl::DeleteHelper : public AsyncHelper { 132 class AppCacheServiceImpl::DeleteHelper : public AsyncHelper {
133 public: 133 public:
134 DeleteHelper( 134 DeleteHelper(
135 AppCacheServiceImpl* service, const GURL& manifest_url, 135 AppCacheServiceImpl* service, const GURL& manifest_url,
136 const net::CompletionCallback& callback) 136 const net::CompletionCallback& callback)
137 : AsyncHelper(service, callback), manifest_url_(manifest_url) { 137 : AsyncHelper(service, callback), manifest_url_(manifest_url) {
138 } 138 }
139 139
140 virtual void Start() OVERRIDE { 140 virtual void Start() override {
141 service_->storage()->LoadOrCreateGroup(manifest_url_, this); 141 service_->storage()->LoadOrCreateGroup(manifest_url_, this);
142 } 142 }
143 143
144 private: 144 private:
145 // AppCacheStorage::Delegate implementation. 145 // AppCacheStorage::Delegate implementation.
146 virtual void OnGroupLoaded( 146 virtual void OnGroupLoaded(
147 AppCacheGroup* group, const GURL& manifest_url) OVERRIDE; 147 AppCacheGroup* group, const GURL& manifest_url) override;
148 virtual void OnGroupMadeObsolete(AppCacheGroup* group, 148 virtual void OnGroupMadeObsolete(AppCacheGroup* group,
149 bool success, 149 bool success,
150 int response_code) OVERRIDE; 150 int response_code) override;
151 151
152 GURL manifest_url_; 152 GURL manifest_url_;
153 DISALLOW_COPY_AND_ASSIGN(DeleteHelper); 153 DISALLOW_COPY_AND_ASSIGN(DeleteHelper);
154 }; 154 };
155 155
156 void AppCacheServiceImpl::DeleteHelper::OnGroupLoaded( 156 void AppCacheServiceImpl::DeleteHelper::OnGroupLoaded(
157 AppCacheGroup* group, const GURL& manifest_url) { 157 AppCacheGroup* group, const GURL& manifest_url) {
158 if (group) { 158 if (group) {
159 group->set_being_deleted(true); 159 group->set_being_deleted(true);
160 group->CancelUpdate(); 160 group->CancelUpdate();
(...skipping 16 matching lines...) Expand all
177 177
178 class AppCacheServiceImpl::DeleteOriginHelper : public AsyncHelper { 178 class AppCacheServiceImpl::DeleteOriginHelper : public AsyncHelper {
179 public: 179 public:
180 DeleteOriginHelper( 180 DeleteOriginHelper(
181 AppCacheServiceImpl* service, const GURL& origin, 181 AppCacheServiceImpl* service, const GURL& origin,
182 const net::CompletionCallback& callback) 182 const net::CompletionCallback& callback)
183 : AsyncHelper(service, callback), origin_(origin), 183 : AsyncHelper(service, callback), origin_(origin),
184 num_caches_to_delete_(0), successes_(0), failures_(0) { 184 num_caches_to_delete_(0), successes_(0), failures_(0) {
185 } 185 }
186 186
187 virtual void Start() OVERRIDE { 187 virtual void Start() override {
188 // We start by listing all caches, continues in OnAllInfo(). 188 // We start by listing all caches, continues in OnAllInfo().
189 service_->storage()->GetAllInfo(this); 189 service_->storage()->GetAllInfo(this);
190 } 190 }
191 191
192 private: 192 private:
193 // AppCacheStorage::Delegate implementation. 193 // AppCacheStorage::Delegate implementation.
194 virtual void OnAllInfo(AppCacheInfoCollection* collection) OVERRIDE; 194 virtual void OnAllInfo(AppCacheInfoCollection* collection) override;
195 virtual void OnGroupLoaded( 195 virtual void OnGroupLoaded(
196 AppCacheGroup* group, const GURL& manifest_url) OVERRIDE; 196 AppCacheGroup* group, const GURL& manifest_url) override;
197 virtual void OnGroupMadeObsolete(AppCacheGroup* group, 197 virtual void OnGroupMadeObsolete(AppCacheGroup* group,
198 bool success, 198 bool success,
199 int response_code) OVERRIDE; 199 int response_code) override;
200 200
201 void CacheCompleted(bool success); 201 void CacheCompleted(bool success);
202 202
203 GURL origin_; 203 GURL origin_;
204 int num_caches_to_delete_; 204 int num_caches_to_delete_;
205 int successes_; 205 int successes_;
206 int failures_; 206 int failures_;
207 207
208 DISALLOW_COPY_AND_ASSIGN(DeleteOriginHelper); 208 DISALLOW_COPY_AND_ASSIGN(DeleteOriginHelper);
209 }; 209 };
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // GetInfoHelper ------- 271 // GetInfoHelper -------
272 272
273 class AppCacheServiceImpl::GetInfoHelper : AsyncHelper { 273 class AppCacheServiceImpl::GetInfoHelper : AsyncHelper {
274 public: 274 public:
275 GetInfoHelper( 275 GetInfoHelper(
276 AppCacheServiceImpl* service, AppCacheInfoCollection* collection, 276 AppCacheServiceImpl* service, AppCacheInfoCollection* collection,
277 const net::CompletionCallback& callback) 277 const net::CompletionCallback& callback)
278 : AsyncHelper(service, callback), collection_(collection) { 278 : AsyncHelper(service, callback), collection_(collection) {
279 } 279 }
280 280
281 virtual void Start() OVERRIDE { 281 virtual void Start() override {
282 service_->storage()->GetAllInfo(this); 282 service_->storage()->GetAllInfo(this);
283 } 283 }
284 284
285 private: 285 private:
286 // AppCacheStorage::Delegate implementation. 286 // AppCacheStorage::Delegate implementation.
287 virtual void OnAllInfo(AppCacheInfoCollection* collection) OVERRIDE; 287 virtual void OnAllInfo(AppCacheInfoCollection* collection) override;
288 288
289 scoped_refptr<AppCacheInfoCollection> collection_; 289 scoped_refptr<AppCacheInfoCollection> collection_;
290 290
291 DISALLOW_COPY_AND_ASSIGN(GetInfoHelper); 291 DISALLOW_COPY_AND_ASSIGN(GetInfoHelper);
292 }; 292 };
293 293
294 void AppCacheServiceImpl::GetInfoHelper::OnAllInfo( 294 void AppCacheServiceImpl::GetInfoHelper::OnAllInfo(
295 AppCacheInfoCollection* collection) { 295 AppCacheInfoCollection* collection) {
296 if (collection) 296 if (collection)
297 collection->infos_by_origin.swap(collection_->infos_by_origin); 297 collection->infos_by_origin.swap(collection_->infos_by_origin);
(...skipping 11 matching lines...) Expand all
309 : AsyncHelper(service, net::CompletionCallback()), 309 : AsyncHelper(service, net::CompletionCallback()),
310 manifest_url_(manifest_url), 310 manifest_url_(manifest_url),
311 cache_id_(cache_id), 311 cache_id_(cache_id),
312 response_id_(response_id), 312 response_id_(response_id),
313 kIOBufferSize(32 * 1024), 313 kIOBufferSize(32 * 1024),
314 expected_total_size_(0), 314 expected_total_size_(0),
315 amount_headers_read_(0), 315 amount_headers_read_(0),
316 amount_data_read_(0) { 316 amount_data_read_(0) {
317 } 317 }
318 318
319 virtual void Start() OVERRIDE { 319 virtual void Start() override {
320 service_->storage()->LoadOrCreateGroup(manifest_url_, this); 320 service_->storage()->LoadOrCreateGroup(manifest_url_, this);
321 } 321 }
322 322
323 virtual void Cancel() OVERRIDE { 323 virtual void Cancel() override {
324 AppCacheHistograms::CountCheckResponseResult( 324 AppCacheHistograms::CountCheckResponseResult(
325 AppCacheHistograms::CHECK_CANCELED); 325 AppCacheHistograms::CHECK_CANCELED);
326 response_reader_.reset(); 326 response_reader_.reset();
327 AsyncHelper::Cancel(); 327 AsyncHelper::Cancel();
328 } 328 }
329 329
330 private: 330 private:
331 virtual void OnGroupLoaded(AppCacheGroup* group, 331 virtual void OnGroupLoaded(AppCacheGroup* group,
332 const GURL& manifest_url) OVERRIDE; 332 const GURL& manifest_url) override;
333 void OnReadInfoComplete(int result); 333 void OnReadInfoComplete(int result);
334 void OnReadDataComplete(int result); 334 void OnReadDataComplete(int result);
335 335
336 // Inputs describing what to check. 336 // Inputs describing what to check.
337 GURL manifest_url_; 337 GURL manifest_url_;
338 int64 cache_id_; 338 int64 cache_id_;
339 int64 response_id_; 339 int64 response_id_;
340 340
341 // Internals used to perform the checks. 341 // Internals used to perform the checks.
342 const int kIOBufferSize; 342 const int kIOBufferSize;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 backends_.insert( 573 backends_.insert(
574 BackendMap::value_type(backend_impl->process_id(), backend_impl)); 574 BackendMap::value_type(backend_impl->process_id(), backend_impl));
575 } 575 }
576 576
577 void AppCacheServiceImpl::UnregisterBackend( 577 void AppCacheServiceImpl::UnregisterBackend(
578 AppCacheBackendImpl* backend_impl) { 578 AppCacheBackendImpl* backend_impl) {
579 backends_.erase(backend_impl->process_id()); 579 backends_.erase(backend_impl->process_id());
580 } 580 }
581 581
582 } // namespace content 582 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_service_impl.h ('k') | content/browser/appcache/appcache_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698