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/memory/ptr_util.h" | 7 #include "base/memory/ptr_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 #include "content/public/common/browser_side_navigation_policy.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 AppCacheBackendImpl::AppCacheBackendImpl() | 15 AppCacheBackendImpl::AppCacheBackendImpl() |
15 : service_(NULL), | 16 : service_(NULL), |
16 frontend_(NULL), | 17 frontend_(NULL), |
17 process_id_(0) { | 18 process_id_(0) { |
18 } | 19 } |
19 | 20 |
20 AppCacheBackendImpl::~AppCacheBackendImpl() { | 21 AppCacheBackendImpl::~AppCacheBackendImpl() { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 auto found = hosts_.find(new_host_id); | 160 auto found = hosts_.find(new_host_id); |
160 if (found == hosts_.end()) { | 161 if (found == hosts_.end()) { |
161 NOTREACHED(); | 162 NOTREACHED(); |
162 return; | 163 return; |
163 } | 164 } |
164 | 165 |
165 host->CompleteTransfer(new_host_id, frontend_); | 166 host->CompleteTransfer(new_host_id, frontend_); |
166 found->second = std::move(host); | 167 found->second = std::move(host); |
167 } | 168 } |
168 | 169 |
| 170 void AppCacheBackendImpl::RegisterPrecreatedHost( |
| 171 std::unique_ptr<AppCacheHost> host) { |
| 172 DCHECK(IsBrowserSideNavigationEnabled()); |
| 173 DCHECK(host.get()); |
| 174 DCHECK(hosts_.find(host->host_id()) == hosts_.end()); |
| 175 |
| 176 hosts_[host->host_id()] = std::move(host); |
| 177 } |
| 178 |
169 } // namespace content | 179 } // namespace content |
OLD | NEW |