| 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 force_keep_session_state_(false), | 405 force_keep_session_state_(false), |
| 406 weak_factory_(this) { | 406 weak_factory_(this) { |
| 407 if (quota_manager_proxy_.get()) { | 407 if (quota_manager_proxy_.get()) { |
| 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 std::for_each(pending_helpers_.begin(), | 415 for (auto* helper : pending_helpers_) |
| 416 pending_helpers_.end(), | 416 helper->Cancel(); |
| 417 std::mem_fun(&AsyncHelper::Cancel)); | |
| 418 STLDeleteElements(&pending_helpers_); | 417 STLDeleteElements(&pending_helpers_); |
| 419 if (quota_client_) | 418 if (quota_client_) |
| 420 quota_client_->NotifyAppCacheDestroyed(); | 419 quota_client_->NotifyAppCacheDestroyed(); |
| 421 | 420 |
| 422 // Destroy storage_ first; ~AppCacheStorageImpl accesses other data members | 421 // Destroy storage_ first; ~AppCacheStorageImpl accesses other data members |
| 423 // (special_storage_policy_). | 422 // (special_storage_policy_). |
| 424 storage_.reset(); | 423 storage_.reset(); |
| 425 } | 424 } |
| 426 | 425 |
| 427 void AppCacheServiceImpl::Initialize( | 426 void AppCacheServiceImpl::Initialize( |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 backends_.insert( | 517 backends_.insert( |
| 519 BackendMap::value_type(backend_impl->process_id(), backend_impl)); | 518 BackendMap::value_type(backend_impl->process_id(), backend_impl)); |
| 520 } | 519 } |
| 521 | 520 |
| 522 void AppCacheServiceImpl::UnregisterBackend( | 521 void AppCacheServiceImpl::UnregisterBackend( |
| 523 AppCacheBackendImpl* backend_impl) { | 522 AppCacheBackendImpl* backend_impl) { |
| 524 backends_.erase(backend_impl->process_id()); | 523 backends_.erase(backend_impl->process_id()); |
| 525 } | 524 } |
| 526 | 525 |
| 527 } // namespace content | 526 } // namespace content |
| OLD | NEW |