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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "webkit/appcache/view_appcache_internals_job.h" | 8 #include "webkit/appcache/view_appcache_internals_job.h" |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 AppCacheService* appcache_service_; | 321 AppCacheService* appcache_service_; |
322 }; | 322 }; |
323 | 323 |
324 // Job that lists all appcaches in the system. | 324 // Job that lists all appcaches in the system. |
325 class MainPageJob : public BaseInternalsJob { | 325 class MainPageJob : public BaseInternalsJob { |
326 public: | 326 public: |
327 MainPageJob(net::URLRequest* request, | 327 MainPageJob(net::URLRequest* request, |
328 net::NetworkDelegate* network_delegate, | 328 net::NetworkDelegate* network_delegate, |
329 AppCacheService* service) | 329 AppCacheService* service) |
330 : BaseInternalsJob(request, network_delegate, service), | 330 : BaseInternalsJob(request, network_delegate, service), |
331 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 331 weak_factory_(this) { |
332 } | 332 } |
333 | 333 |
334 virtual void Start() OVERRIDE { | 334 virtual void Start() OVERRIDE { |
335 DCHECK(request_); | 335 DCHECK(request_); |
336 info_collection_ = new AppCacheInfoCollection; | 336 info_collection_ = new AppCacheInfoCollection; |
337 appcache_service_->GetAllAppCacheInfo( | 337 appcache_service_->GetAllAppCacheInfo( |
338 info_collection_, base::Bind(&MainPageJob::OnGotInfoComplete, | 338 info_collection_, base::Bind(&MainPageJob::OnGotInfoComplete, |
339 weak_factory_.GetWeakPtr())); | 339 weak_factory_.GetWeakPtr())); |
340 } | 340 } |
341 | 341 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // Job that removes an appcache and then redirects back to the main page. | 414 // Job that removes an appcache and then redirects back to the main page. |
415 class RemoveAppCacheJob : public RedirectToMainPageJob { | 415 class RemoveAppCacheJob : public RedirectToMainPageJob { |
416 public: | 416 public: |
417 RemoveAppCacheJob( | 417 RemoveAppCacheJob( |
418 net::URLRequest* request, | 418 net::URLRequest* request, |
419 net::NetworkDelegate* network_delegate, | 419 net::NetworkDelegate* network_delegate, |
420 AppCacheService* service, | 420 AppCacheService* service, |
421 const GURL& manifest_url) | 421 const GURL& manifest_url) |
422 : RedirectToMainPageJob(request, network_delegate, service), | 422 : RedirectToMainPageJob(request, network_delegate, service), |
423 manifest_url_(manifest_url), | 423 manifest_url_(manifest_url), |
424 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 424 weak_factory_(this) { |
425 } | 425 } |
426 | 426 |
427 virtual void Start() OVERRIDE { | 427 virtual void Start() OVERRIDE { |
428 DCHECK(request_); | 428 DCHECK(request_); |
429 | 429 |
430 appcache_service_->DeleteAppCacheGroup( | 430 appcache_service_->DeleteAppCacheGroup( |
431 manifest_url_,base::Bind(&RemoveAppCacheJob::OnDeleteAppCacheComplete, | 431 manifest_url_,base::Bind(&RemoveAppCacheJob::OnDeleteAppCacheComplete, |
432 weak_factory_.GetWeakPtr())); | 432 weak_factory_.GetWeakPtr())); |
433 } | 433 } |
434 | 434 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 return new ViewEntryJob(request, network_delegate, service, | 641 return new ViewEntryJob(request, network_delegate, service, |
642 DecodeBase64URL(tokens[0]), // manifest url | 642 DecodeBase64URL(tokens[0]), // manifest url |
643 DecodeBase64URL(tokens[1]), // entry url | 643 DecodeBase64URL(tokens[1]), // entry url |
644 response_id, group_id); | 644 response_id, group_id); |
645 } | 645 } |
646 | 646 |
647 return new RedirectToMainPageJob(request, network_delegate, service); | 647 return new RedirectToMainPageJob(request, network_delegate, service); |
648 } | 648 } |
649 | 649 |
650 } // namespace appcache | 650 } // namespace appcache |
OLD | NEW |