Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: content/browser/renderer_host/transfer_navigation_resource_throttle.cc

Issue 10501004: Refactor the guts of ResourceDispatcherHostImpl into a new class named (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/renderer_host/transfer_navigation_resource_throttle.h" 5 #include "content/browser/renderer_host/transfer_navigation_resource_throttle.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/renderer_host/render_view_host_delegate.h" 8 #include "content/browser/renderer_host/render_view_host_delegate.h"
9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" 9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
10 #include "content/public/browser/content_browser_client.h" 10 #include "content/public/browser/content_browser_client.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // If a toplevel request is redirecting across extension extents, we want to 56 // If a toplevel request is redirecting across extension extents, we want to
57 // switch processes. We do this by deferring the redirect and resuming the 57 // switch processes. We do this by deferring the redirect and resuming the
58 // request once the navigation controller properly assigns the right process 58 // request once the navigation controller properly assigns the right process
59 // to host the new URL. 59 // to host the new URL.
60 // TODO(mpcomplete): handle for cases other than extensions (e.g. WebUI). 60 // TODO(mpcomplete): handle for cases other than extensions (e.g. WebUI).
61 ResourceContext* resource_context = info->GetContext(); 61 ResourceContext* resource_context = info->GetContext();
62 if (GetContentClient()->browser()->ShouldSwapProcessesForRedirect( 62 if (GetContentClient()->browser()->ShouldSwapProcessesForRedirect(
63 resource_context, request_->url(), new_url)) { 63 resource_context, request_->url(), new_url)) {
64 int render_process_id, render_view_id; 64 int render_process_id, render_view_id;
65 if (info->GetAssociatedRenderView(&render_process_id, &render_view_id)) { 65 if (info->GetAssociatedRenderView(&render_process_id, &render_view_id)) {
66 ResourceDispatcherHostImpl::Get()->MarkAsTransferredNavigation(request_); 66 GlobalRequestID global_id(info->GetChildID(), info->GetRequestID());
67 67
68 GlobalRequestID global_id(info->GetChildID(), info->GetRequestID()); 68 ResourceDispatcherHostImpl::Get()->MarkAsTransferredNavigation(global_id);
69
69 BrowserThread::PostTask( 70 BrowserThread::PostTask(
70 BrowserThread::UI, 71 BrowserThread::UI,
71 FROM_HERE, 72 FROM_HERE,
72 base::Bind(&RequestTransferURLOnUIThread, 73 base::Bind(&RequestTransferURLOnUIThread,
73 render_process_id, 74 render_process_id,
74 render_view_id, 75 render_view_id,
75 new_url, 76 new_url,
76 Referrer(GURL(request_->referrer()), info->GetReferrerPolicy()), 77 Referrer(GURL(request_->referrer()), info->GetReferrerPolicy()),
77 CURRENT_TAB, 78 CURRENT_TAB,
78 info->GetFrameID(), 79 info->GetFrameID(),
79 global_id)); 80 global_id));
80 81
81 *defer = true; 82 *defer = true;
82 } 83 }
83 } 84 }
84 } 85 }
85 86
86 } // namespace content 87 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698