| 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_request_handler.h" | 5 #include "content/browser/appcache/appcache_request_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "content/browser/appcache/appcache.h" | 10 #include "content/browser/appcache/appcache.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 void AppCacheRequestHandler::GetExtraResponseInfo(int64_t* cache_id, | 180 void AppCacheRequestHandler::GetExtraResponseInfo(int64_t* cache_id, |
| 181 GURL* manifest_url) { | 181 GURL* manifest_url) { |
| 182 *cache_id = cache_id_; | 182 *cache_id = cache_id_; |
| 183 *manifest_url = manifest_url_; | 183 *manifest_url = manifest_url_; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void AppCacheRequestHandler::PrepareForCrossSiteTransfer(int old_process_id) { | 186 void AppCacheRequestHandler::PrepareForCrossSiteTransfer(int old_process_id) { |
| 187 if (!host_) | 187 if (!host_) |
| 188 return; | 188 return; |
| 189 AppCacheBackendImpl* backend = host_->service()->GetBackend(old_process_id); | 189 AppCacheBackendImpl* backend = host_->service()->GetBackend(old_process_id); |
| 190 DCHECK(backend) << "appcache detected likely storage partition mismatch"; |
| 190 old_process_id_ = old_process_id; | 191 old_process_id_ = old_process_id; |
| 191 old_host_id_ = host_->host_id(); | 192 old_host_id_ = host_->host_id(); |
| 192 host_for_cross_site_transfer_ = backend->TransferHostOut(host_->host_id()); | 193 host_for_cross_site_transfer_ = backend->TransferHostOut(host_->host_id()); |
| 193 DCHECK_EQ(host_, host_for_cross_site_transfer_.get()); | 194 DCHECK_EQ(host_, host_for_cross_site_transfer_.get()); |
| 194 } | 195 } |
| 195 | 196 |
| 196 void AppCacheRequestHandler::CompleteCrossSiteTransfer( | 197 void AppCacheRequestHandler::CompleteCrossSiteTransfer( |
| 197 int new_process_id, int new_host_id) { | 198 int new_process_id, int new_host_id) { |
| 198 if (!host_for_cross_site_transfer_.get()) | 199 if (!host_for_cross_site_transfer_.get()) |
| 199 return; | 200 return; |
| 200 DCHECK_EQ(host_, host_for_cross_site_transfer_.get()); | 201 DCHECK_EQ(host_, host_for_cross_site_transfer_.get()); |
| 201 AppCacheBackendImpl* backend = host_->service()->GetBackend(new_process_id); | 202 AppCacheBackendImpl* backend = host_->service()->GetBackend(new_process_id); |
| 203 DCHECK(backend) << "appcache detected likely storage partition mismatch"; |
| 202 backend->TransferHostIn(new_host_id, | 204 backend->TransferHostIn(new_host_id, |
| 203 std::move(host_for_cross_site_transfer_)); | 205 std::move(host_for_cross_site_transfer_)); |
| 204 } | 206 } |
| 205 | 207 |
| 206 void AppCacheRequestHandler::MaybeCompleteCrossSiteTransferInOldProcess( | 208 void AppCacheRequestHandler::MaybeCompleteCrossSiteTransferInOldProcess( |
| 207 int old_process_id) { | 209 int old_process_id) { |
| 208 if (!host_ || !host_for_cross_site_transfer_.get() || | 210 if (!host_ || !host_for_cross_site_transfer_.get() || |
| 209 old_process_id != old_process_id_) { | 211 old_process_id != old_process_id_) { |
| 210 return; | 212 return; |
| 211 } | 213 } |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 if (!host_->associated_cache() || | 482 if (!host_->associated_cache() || |
| 481 !host_->associated_cache()->is_complete()) { | 483 !host_->associated_cache()->is_complete()) { |
| 482 DeliverNetworkResponse(); | 484 DeliverNetworkResponse(); |
| 483 return; | 485 return; |
| 484 } | 486 } |
| 485 | 487 |
| 486 ContinueMaybeLoadSubResource(); | 488 ContinueMaybeLoadSubResource(); |
| 487 } | 489 } |
| 488 | 490 |
| 489 } // namespace content | 491 } // namespace content |
| OLD | NEW |