| 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 "chrome/browser/renderer_host/transfer_navigation_resource_handler.h" | 5 #include "chrome/browser/renderer_host/transfer_navigation_resource_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/profiles/profile_io_data.h" | 8 #include "chrome/browser/profiles/profile_io_data.h" |
| 9 #include "chrome/browser/extensions/extension_info_map.h" | 9 #include "chrome/browser/extensions/extension_info_map.h" |
| 10 #include "chrome/common/extensions/extension_process_policy.h" | 10 #include "chrome/common/extensions/extension_process_policy.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 uint64 position, | 57 uint64 position, |
| 58 uint64 size) { | 58 uint64 size) { |
| 59 return next_handler_->OnUploadProgress(request_id, position, size); | 59 return next_handler_->OnUploadProgress(request_id, position, size); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool TransferNavigationResourceHandler::OnRequestRedirected( | 62 bool TransferNavigationResourceHandler::OnRequestRedirected( |
| 63 int request_id, | 63 int request_id, |
| 64 const GURL& new_url, | 64 const GURL& new_url, |
| 65 content::ResourceResponse* response, | 65 content::ResourceResponse* response, |
| 66 bool* defer) { | 66 bool* defer) { |
| 67 | |
| 68 ResourceDispatcherHostRequestInfo* info = | 67 ResourceDispatcherHostRequestInfo* info = |
| 69 ResourceDispatcherHost::InfoForRequest(request_); | 68 ResourceDispatcherHost::InfoForRequest(request_); |
| 70 | 69 |
| 71 // If a toplevel request is redirecting across extension extents, we want to | 70 // If a toplevel request is redirecting across extension extents, we want to |
| 72 // switch processes. We do this by deferring the redirect and resuming the | 71 // switch processes. We do this by deferring the redirect and resuming the |
| 73 // request once the navigation controller properly assigns the right process | 72 // request once the navigation controller properly assigns the right process |
| 74 // to host the new URL. | 73 // to host the new URL. |
| 75 // TODO(mpcomplete): handle for cases other than extensions (e.g. WebUI). | 74 // TODO(mpcomplete): handle for cases other than extensions (e.g. WebUI). |
| 76 const content::ResourceContext& resource_context = *info->context(); | 75 const content::ResourceContext& resource_context = *info->context(); |
| 77 ProfileIOData* io_data = | 76 ProfileIOData* io_data = |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 bool TransferNavigationResourceHandler::OnResponseCompleted( | 132 bool TransferNavigationResourceHandler::OnResponseCompleted( |
| 134 int request_id, | 133 int request_id, |
| 135 const net::URLRequestStatus& status, | 134 const net::URLRequestStatus& status, |
| 136 const std::string& security_info) { | 135 const std::string& security_info) { |
| 137 return next_handler_->OnResponseCompleted(request_id, status, security_info); | 136 return next_handler_->OnResponseCompleted(request_id, status, security_info); |
| 138 } | 137 } |
| 139 | 138 |
| 140 void TransferNavigationResourceHandler::OnRequestClosed() { | 139 void TransferNavigationResourceHandler::OnRequestClosed() { |
| 141 next_handler_->OnRequestClosed(); | 140 next_handler_->OnRequestClosed(); |
| 142 } | 141 } |
| OLD | NEW |