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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 int render_frame_id, | 84 int render_frame_id, |
85 const TransitionLayerData& transition_data) { | 85 const TransitionLayerData& transition_data) { |
86 RenderFrameHostImpl* rfh = | 86 RenderFrameHostImpl* rfh = |
87 RenderFrameHostImpl::FromID(global_request_id.child_id, render_frame_id); | 87 RenderFrameHostImpl::FromID(global_request_id.child_id, render_frame_id); |
88 if (rfh) | 88 if (rfh) |
89 rfh->OnDeferredAfterResponseStarted(global_request_id, transition_data); | 89 rfh->OnDeferredAfterResponseStarted(global_request_id, transition_data); |
90 } | 90 } |
91 | 91 |
92 // Returns whether a transfer is needed by doing a check on the UI thread. | 92 // Returns whether a transfer is needed by doing a check on the UI thread. |
93 bool CheckNavigationPolicyOnUI(GURL url, int process_id, int render_frame_id) { | 93 bool CheckNavigationPolicyOnUI(GURL url, int process_id, int render_frame_id) { |
94 CHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)); | 94 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 95 switches::kSitePerProcess)); |
95 RenderFrameHostImpl* rfh = | 96 RenderFrameHostImpl* rfh = |
96 RenderFrameHostImpl::FromID(process_id, render_frame_id); | 97 RenderFrameHostImpl::FromID(process_id, render_frame_id); |
97 if (!rfh) | 98 if (!rfh) |
98 return false; | 99 return false; |
99 | 100 |
100 // A transfer is not needed if the current SiteInstance doesn't yet have a | 101 // A transfer is not needed if the current SiteInstance doesn't yet have a |
101 // site. This is the case for tests that use NavigateToURL. | 102 // site. This is the case for tests that use NavigateToURL. |
102 if (!rfh->GetSiteInstance()->HasSite()) | 103 if (!rfh->GetSiteInstance()->HasSite()) |
103 return false; | 104 return false; |
104 | 105 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 controller()->Resume(); | 422 controller()->Resume(); |
422 } | 423 } |
423 } | 424 } |
424 | 425 |
425 void CrossSiteResourceHandler::OnDidDefer() { | 426 void CrossSiteResourceHandler::OnDidDefer() { |
426 did_defer_ = true; | 427 did_defer_ = true; |
427 request()->LogBlockedBy("CrossSiteResourceHandler"); | 428 request()->LogBlockedBy("CrossSiteResourceHandler"); |
428 } | 429 } |
429 | 430 |
430 } // namespace content | 431 } // namespace content |
OLD | NEW |