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

Side by Side Diff: content/browser/loader/cross_site_resource_handler.cc

Issue 1259573006: Prevent GuestView from swapping process on cross-site navigations in --site-per-process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/loader/cross_site_resource_handler.h" 5 #include "content/browser/loader/cross_site_resource_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "content/browser/appcache/appcache_interceptor.h" 12 #include "content/browser/appcache/appcache_interceptor.h"
13 #include "content/browser/child_process_security_policy_impl.h" 13 #include "content/browser/child_process_security_policy_impl.h"
14 #include "content/browser/frame_host/cross_site_transferring_request.h" 14 #include "content/browser/frame_host/cross_site_transferring_request.h"
15 #include "content/browser/frame_host/render_frame_host_impl.h" 15 #include "content/browser/frame_host/render_frame_host_impl.h"
16 #include "content/browser/loader/resource_dispatcher_host_impl.h" 16 #include "content/browser/loader/resource_dispatcher_host_impl.h"
17 #include "content/browser/loader/resource_request_info_impl.h" 17 #include "content/browser/loader/resource_request_info_impl.h"
18 #include "content/browser/site_instance_impl.h" 18 #include "content/browser/site_instance_impl.h"
19 #include "content/browser/web_contents/web_contents_impl.h"
19 #include "content/public/browser/browser_thread.h" 20 #include "content/public/browser/browser_thread.h"
20 #include "content/public/browser/content_browser_client.h" 21 #include "content/public/browser/content_browser_client.h"
21 #include "content/public/browser/global_request_id.h" 22 #include "content/public/browser/global_request_id.h"
22 #include "content/public/browser/resource_controller.h" 23 #include "content/public/browser/resource_controller.h"
23 #include "content/public/browser/site_instance.h" 24 #include "content/public/browser/site_instance.h"
24 #include "content/public/common/content_switches.h" 25 #include "content/public/common/content_switches.h"
25 #include "content/public/common/resource_response.h" 26 #include "content/public/common/resource_response.h"
26 #include "content/public/common/url_constants.h" 27 #include "content/public/common/url_constants.h"
27 #include "net/http/http_response_headers.h" 28 #include "net/http/http_response_headers.h"
28 #include "net/url_request/url_request.h" 29 #include "net/url_request/url_request.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 RenderFrameHostImpl* rfh = 93 RenderFrameHostImpl* rfh =
93 RenderFrameHostImpl::FromID(process_id, render_frame_id); 94 RenderFrameHostImpl::FromID(process_id, render_frame_id);
94 if (!rfh) 95 if (!rfh)
95 return false; 96 return false;
96 97
97 // A transfer is not needed if the current SiteInstance doesn't yet have a 98 // A transfer is not needed if the current SiteInstance doesn't yet have a
98 // site. This is the case for tests that use NavigateToURL. 99 // site. This is the case for tests that use NavigateToURL.
99 if (!rfh->GetSiteInstance()->HasSite()) 100 if (!rfh->GetSiteInstance()->HasSite())
100 return false; 101 return false;
101 102
103 // For now, GuestView never transfer on cross-site navigations.
Charlie Reis 2015/07/24 19:20:31 nit: GuestViews
104 WebContentsImpl* web_contents =
105 static_cast<WebContentsImpl*>(WebContents::FromRenderFrameHost(rfh));
106 if (web_contents->GetBrowserPluginGuest())
107 return false;
108
102 // TODO(nasko): This check is very simplistic and is used temporarily only 109 // TODO(nasko): This check is very simplistic and is used temporarily only
103 // for --site-per-process. It should be updated to match the check performed 110 // for --site-per-process. It should be updated to match the check performed
104 // by RenderFrameHostManager::UpdateStateForNavigate. 111 // by RenderFrameHostManager::UpdateStateForNavigate.
105 return !SiteInstance::IsSameWebSite( 112 return !SiteInstance::IsSameWebSite(
106 rfh->GetSiteInstance()->GetBrowserContext(), 113 rfh->GetSiteInstance()->GetBrowserContext(),
107 rfh->GetSiteInstance()->GetSiteURL(), url); 114 rfh->GetSiteInstance()->GetSiteURL(), url);
108 } 115 }
109 116
110 } // namespace 117 } // namespace
111 118
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 controller()->Resume(); 379 controller()->Resume();
373 } 380 }
374 } 381 }
375 382
376 void CrossSiteResourceHandler::OnDidDefer() { 383 void CrossSiteResourceHandler::OnDidDefer() {
377 did_defer_ = true; 384 did_defer_ = true;
378 request()->LogBlockedBy("CrossSiteResourceHandler"); 385 request()->LogBlockedBy("CrossSiteResourceHandler");
379 } 386 }
380 387
381 } // namespace content 388 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698