OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2144 // static | 2144 // static |
2145 void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph, | 2145 void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph, |
2146 bool empty_allowed, | 2146 bool empty_allowed, |
2147 GURL* url) { | 2147 GURL* url) { |
2148 ChildProcessSecurityPolicyImpl* policy = | 2148 ChildProcessSecurityPolicyImpl* policy = |
2149 ChildProcessSecurityPolicyImpl::GetInstance(); | 2149 ChildProcessSecurityPolicyImpl::GetInstance(); |
2150 | 2150 |
2151 if (empty_allowed && url->is_empty()) | 2151 if (empty_allowed && url->is_empty()) |
2152 return; | 2152 return; |
2153 | 2153 |
2154 // The browser process should never hear the swappedout:// URL from any | |
2155 // of the renderer's messages. Check for this in debug builds, but don't | |
2156 // let it crash a release browser. | |
2157 DCHECK(GURL(kSwappedOutURL) != *url); | |
2158 | |
2159 if (!url->is_valid()) { | 2154 if (!url->is_valid()) { |
2160 // Have to use about:blank for the denied case, instead of an empty GURL. | 2155 // Have to use about:blank for the denied case, instead of an empty GURL. |
2161 // This is because the browser treats navigation to an empty GURL as a | 2156 // This is because the browser treats navigation to an empty GURL as a |
2162 // navigation to the home page. This is often a privileged page | 2157 // navigation to the home page. This is often a privileged page |
2163 // (chrome://newtab/) which is exactly what we don't want. | 2158 // (chrome://newtab/) which is exactly what we don't want. |
2164 *url = GURL(url::kAboutBlankURL); | 2159 *url = GURL(url::kAboutBlankURL); |
2165 return; | 2160 return; |
2166 } | 2161 } |
2167 | 2162 |
2168 if (url->SchemeIs(url::kAboutScheme)) { | 2163 if (url->SchemeIs(url::kAboutScheme)) { |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2815 | 2810 |
2816 // Skip widgets in other processes. | 2811 // Skip widgets in other processes. |
2817 if (rvh->GetProcess()->GetID() != GetID()) | 2812 if (rvh->GetProcess()->GetID() != GetID()) |
2818 continue; | 2813 continue; |
2819 | 2814 |
2820 rvh->OnWebkitPreferencesChanged(); | 2815 rvh->OnWebkitPreferencesChanged(); |
2821 } | 2816 } |
2822 } | 2817 } |
2823 | 2818 |
2824 } // namespace content | 2819 } // namespace content |
OLD | NEW |