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 "webkit/appcache/appcache_service.h" | 5 #include "webkit/appcache/appcache_service.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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 std::mem_fun(&AsyncHelper::Cancel)); | 442 std::mem_fun(&AsyncHelper::Cancel)); |
443 STLDeleteElements(&pending_helpers_); | 443 STLDeleteElements(&pending_helpers_); |
444 if (quota_client_) | 444 if (quota_client_) |
445 quota_client_->NotifyAppCacheDestroyed(); | 445 quota_client_->NotifyAppCacheDestroyed(); |
446 | 446 |
447 // Destroy storage_ first; ~AppCacheStorageImpl accesses other data members | 447 // Destroy storage_ first; ~AppCacheStorageImpl accesses other data members |
448 // (special_storage_policy_). | 448 // (special_storage_policy_). |
449 storage_.reset(); | 449 storage_.reset(); |
450 } | 450 } |
451 | 451 |
452 void AppCacheService::Initialize(const FilePath& cache_directory, | 452 void AppCacheService::Initialize(const base::FilePath& cache_directory, |
453 base::MessageLoopProxy* db_thread, | 453 base::MessageLoopProxy* db_thread, |
454 base::MessageLoopProxy* cache_thread) { | 454 base::MessageLoopProxy* cache_thread) { |
455 DCHECK(!storage_.get()); | 455 DCHECK(!storage_.get()); |
456 AppCacheStorageImpl* storage = new AppCacheStorageImpl(this); | 456 AppCacheStorageImpl* storage = new AppCacheStorageImpl(this); |
457 storage->Initialize(cache_directory, db_thread, cache_thread); | 457 storage->Initialize(cache_directory, db_thread, cache_thread); |
458 storage_.reset(storage); | 458 storage_.reset(storage); |
459 } | 459 } |
460 | 460 |
461 void AppCacheService::CanHandleMainResourceOffline( | 461 void AppCacheService::CanHandleMainResourceOffline( |
462 const GURL& url, | 462 const GURL& url, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 backends_.insert( | 507 backends_.insert( |
508 BackendMap::value_type(backend_impl->process_id(), backend_impl)); | 508 BackendMap::value_type(backend_impl->process_id(), backend_impl)); |
509 } | 509 } |
510 | 510 |
511 void AppCacheService::UnregisterBackend( | 511 void AppCacheService::UnregisterBackend( |
512 AppCacheBackendImpl* backend_impl) { | 512 AppCacheBackendImpl* backend_impl) { |
513 backends_.erase(backend_impl->process_id()); | 513 backends_.erase(backend_impl->process_id()); |
514 } | 514 } |
515 | 515 |
516 } // namespace appcache | 516 } // namespace appcache |
OLD | NEW |