| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/loader/transfer_navigation_resource_throttle.h" | 5 #include "content/browser/loader/transfer_navigation_resource_throttle.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 8 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 9 #include "content/browser/renderer_host/render_view_host_delegate.h" | 9 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // request once the navigation controller properly assigns the right process | 63 // request once the navigation controller properly assigns the right process |
| 64 // to host the new URL. | 64 // to host the new URL. |
| 65 // TODO(mpcomplete): handle for cases other than extensions (e.g. WebUI). | 65 // TODO(mpcomplete): handle for cases other than extensions (e.g. WebUI). |
| 66 ResourceContext* resource_context = info->GetContext(); | 66 ResourceContext* resource_context = info->GetContext(); |
| 67 if (GetContentClient()->browser()->ShouldSwapProcessesForRedirect( | 67 if (GetContentClient()->browser()->ShouldSwapProcessesForRedirect( |
| 68 resource_context, request_->url(), new_url)) { | 68 resource_context, request_->url(), new_url)) { |
| 69 int render_process_id, render_view_id; | 69 int render_process_id, render_view_id; |
| 70 if (info->GetAssociatedRenderView(&render_process_id, &render_view_id)) { | 70 if (info->GetAssociatedRenderView(&render_process_id, &render_view_id)) { |
| 71 GlobalRequestID global_id(info->GetChildID(), info->GetRequestID()); | 71 GlobalRequestID global_id(info->GetChildID(), info->GetRequestID()); |
| 72 | 72 |
| 73 ResourceDispatcherHostImpl::Get()->MarkAsTransferredNavigation(global_id); | 73 ResourceDispatcherHostImpl::Get()->MarkAsTransferredNavigation(global_id, |
| 74 new_url); |
| 74 | 75 |
| 75 BrowserThread::PostTask( | 76 BrowserThread::PostTask( |
| 76 BrowserThread::UI, | 77 BrowserThread::UI, |
| 77 FROM_HERE, | 78 FROM_HERE, |
| 78 base::Bind(&RequestTransferURLOnUIThread, | 79 base::Bind(&RequestTransferURLOnUIThread, |
| 79 render_process_id, | 80 render_process_id, |
| 80 render_view_id, | 81 render_view_id, |
| 81 new_url, | 82 new_url, |
| 82 Referrer(GURL(request_->referrer()), info->GetReferrerPolicy()), | 83 Referrer(GURL(request_->referrer()), info->GetReferrerPolicy()), |
| 83 CURRENT_TAB, | 84 CURRENT_TAB, |
| 84 info->GetFrameID(), | 85 info->GetFrameID(), |
| 85 global_id)); | 86 global_id)); |
| 86 | 87 |
| 87 *defer = true; | 88 *defer = true; |
| 88 } | 89 } |
| 89 } | 90 } |
| 90 } | 91 } |
| 91 | 92 |
| 92 } // namespace content | 93 } // namespace content |
| OLD | NEW |