OLD | NEW |
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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 quota_client_ = new AppCacheQuotaClient(this); | 408 quota_client_ = new AppCacheQuotaClient(this); |
409 quota_manager_proxy_->RegisterClient(quota_client_); | 409 quota_manager_proxy_->RegisterClient(quota_client_); |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 AppCacheServiceImpl::~AppCacheServiceImpl() { | 413 AppCacheServiceImpl::~AppCacheServiceImpl() { |
414 DCHECK(backends_.empty()); | 414 DCHECK(backends_.empty()); |
415 FOR_EACH_OBSERVER(Observer, observers_, OnServiceDestructionImminent(this)); | 415 FOR_EACH_OBSERVER(Observer, observers_, OnServiceDestructionImminent(this)); |
416 for (auto* helper : pending_helpers_) | 416 for (auto* helper : pending_helpers_) |
417 helper->Cancel(); | 417 helper->Cancel(); |
418 STLDeleteElements(&pending_helpers_); | 418 base::STLDeleteElements(&pending_helpers_); |
419 if (quota_client_) | 419 if (quota_client_) |
420 quota_client_->NotifyAppCacheDestroyed(); | 420 quota_client_->NotifyAppCacheDestroyed(); |
421 | 421 |
422 // Destroy storage_ first; ~AppCacheStorageImpl accesses other data members | 422 // Destroy storage_ first; ~AppCacheStorageImpl accesses other data members |
423 // (special_storage_policy_). | 423 // (special_storage_policy_). |
424 storage_.reset(); | 424 storage_.reset(); |
425 } | 425 } |
426 | 426 |
427 void AppCacheServiceImpl::Initialize( | 427 void AppCacheServiceImpl::Initialize( |
428 const base::FilePath& cache_directory, | 428 const base::FilePath& cache_directory, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 backends_.insert( | 518 backends_.insert( |
519 BackendMap::value_type(backend_impl->process_id(), backend_impl)); | 519 BackendMap::value_type(backend_impl->process_id(), backend_impl)); |
520 } | 520 } |
521 | 521 |
522 void AppCacheServiceImpl::UnregisterBackend( | 522 void AppCacheServiceImpl::UnregisterBackend( |
523 AppCacheBackendImpl* backend_impl) { | 523 AppCacheBackendImpl* backend_impl) { |
524 backends_.erase(backend_impl->process_id()); | 524 backends_.erase(backend_impl->process_id()); |
525 } | 525 } |
526 | 526 |
527 } // namespace content | 527 } // namespace content |
OLD | NEW |