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/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" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // transferred back into the original process due to a redirect. | 187 // transferred back into the original process due to a redirect. |
188 bool should_transfer = | 188 bool should_transfer = |
189 GetContentClient()->browser()->ShouldSwapProcessesForRedirect( | 189 GetContentClient()->browser()->ShouldSwapProcessesForRedirect( |
190 info->GetContext(), request()->original_url(), request()->url()); | 190 info->GetContext(), request()->original_url(), request()->url()); |
191 | 191 |
192 // When the --site-per-process flag is passed, we transfer processes for | 192 // When the --site-per-process flag is passed, we transfer processes for |
193 // cross-site navigations. This is skipped if a transfer is already required | 193 // cross-site navigations. This is skipped if a transfer is already required |
194 // or for WebUI processes for now, since pages like the NTP host multiple | 194 // or for WebUI processes for now, since pages like the NTP host multiple |
195 // cross-site WebUI iframes. | 195 // cross-site WebUI iframes. |
196 if (!should_transfer && | 196 if (!should_transfer && |
197 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && | 197 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 198 switches::kSitePerProcess) && |
198 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 199 !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
199 info->GetChildID())) { | 200 info->GetChildID())) { |
200 return DeferForNavigationPolicyCheck(info, response, defer); | 201 return DeferForNavigationPolicyCheck(info, response, defer); |
201 } | 202 } |
202 | 203 |
203 bool swap_needed = should_transfer || | 204 bool swap_needed = should_transfer || |
204 CrossSiteRequestManager::GetInstance()-> | 205 CrossSiteRequestManager::GetInstance()-> |
205 HasPendingCrossSiteRequest(info->GetChildID(), info->GetRouteID()); | 206 HasPendingCrossSiteRequest(info->GetChildID(), info->GetRouteID()); |
206 | 207 |
207 // If this is a download, just pass the response through without doing a | 208 // If this is a download, just pass the response through without doing a |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 controller()->Resume(); | 442 controller()->Resume(); |
442 } | 443 } |
443 } | 444 } |
444 | 445 |
445 void CrossSiteResourceHandler::OnDidDefer() { | 446 void CrossSiteResourceHandler::OnDidDefer() { |
446 did_defer_ = true; | 447 did_defer_ = true; |
447 request()->LogBlockedBy("CrossSiteResourceHandler"); | 448 request()->LogBlockedBy("CrossSiteResourceHandler"); |
448 } | 449 } |
449 | 450 |
450 } // namespace content | 451 } // namespace content |
OLD | NEW |