OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_backend_impl.h" | 5 #include "content/browser/appcache/appcache_backend_impl.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "content/browser/appcache/appcache.h" | 8 #include "content/browser/appcache/appcache.h" |
9 #include "content/browser/appcache/appcache_group.h" | 9 #include "content/browser/appcache/appcache_group.h" |
10 #include "content/browser/appcache/appcache_service_impl.h" | 10 #include "content/browser/appcache/appcache_service_impl.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 AppCacheBackendImpl::AppCacheBackendImpl() | 14 AppCacheBackendImpl::AppCacheBackendImpl() |
15 : service_(NULL), | 15 : service_(NULL), |
16 frontend_(NULL), | 16 frontend_(NULL), |
17 process_id_(0) { | 17 process_id_(0) { |
18 } | 18 } |
19 | 19 |
20 AppCacheBackendImpl::~AppCacheBackendImpl() { | 20 AppCacheBackendImpl::~AppCacheBackendImpl() { |
21 STLDeleteValues(&hosts_); | 21 base::STLDeleteValues(&hosts_); |
22 if (service_) | 22 if (service_) |
23 service_->UnregisterBackend(this); | 23 service_->UnregisterBackend(this); |
24 } | 24 } |
25 | 25 |
26 void AppCacheBackendImpl::Initialize(AppCacheServiceImpl* service, | 26 void AppCacheBackendImpl::Initialize(AppCacheServiceImpl* service, |
27 AppCacheFrontend* frontend, | 27 AppCacheFrontend* frontend, |
28 int process_id) { | 28 int process_id) { |
29 DCHECK(!service_ && !frontend_ && frontend && service); | 29 DCHECK(!service_ && !frontend_ && frontend && service); |
30 service_ = service; | 30 service_ = service; |
31 frontend_ = frontend; | 31 frontend_ = frontend; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 delete found->second; | 172 delete found->second; |
173 | 173 |
174 // We take onwership. | 174 // We take onwership. |
175 host->CompleteTransfer(new_host_id, frontend_); | 175 host->CompleteTransfer(new_host_id, frontend_); |
176 found->second = host.release(); | 176 found->second = host.release(); |
177 } | 177 } |
178 | 178 |
179 } // namespace content | 179 } // namespace content |
OLD | NEW |