Chromium Code Reviews| 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 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2350 // This is because the browser treats navigation to an empty GURL as a | 2350 // This is because the browser treats navigation to an empty GURL as a |
| 2351 // navigation to the home page. This is often a privileged page | 2351 // navigation to the home page. This is often a privileged page |
| 2352 // (chrome://newtab/) which is exactly what we don't want. | 2352 // (chrome://newtab/) which is exactly what we don't want. |
| 2353 *url = GURL(url::kAboutBlankURL); | 2353 *url = GURL(url::kAboutBlankURL); |
| 2354 return; | 2354 return; |
| 2355 } | 2355 } |
| 2356 | 2356 |
| 2357 if (url->SchemeIs(url::kAboutScheme)) { | 2357 if (url->SchemeIs(url::kAboutScheme)) { |
| 2358 // The renderer treats all URLs in the about: scheme as being about:blank. | 2358 // The renderer treats all URLs in the about: scheme as being about:blank. |
| 2359 // Canonicalize about: URLs to about:blank. | 2359 // Canonicalize about: URLs to about:blank. |
| 2360 *url = GURL(url::kAboutBlankURL); | 2360 // An exception is made for about:srcdoc. |
| 2361 if (*url != kAboutSrcDocURL) | |
| 2362 *url = GURL(url::kAboutBlankURL); | |
| 2363 return; | |
|
Charlie Reis
2016/11/16 18:20:22
Was this return added for ChildPolicySecurityPolic
arthursonzogni
2016/11/17 17:04:58
Yes it was.
To be honest, I initially tried what y
Charlie Reis
2016/11/22 01:01:20
Yes, I think that makes sense, assuming we don't e
| |
| 2361 } | 2364 } |
| 2362 | 2365 |
| 2363 if (!policy->CanRequestURL(rph->GetID(), *url)) { | 2366 if (!policy->CanRequestURL(rph->GetID(), *url)) { |
| 2364 // If this renderer is not permitted to request this URL, we invalidate the | 2367 // If this renderer is not permitted to request this URL, we invalidate the |
| 2365 // URL. This prevents us from storing the blocked URL and becoming confused | 2368 // URL. This prevents us from storing the blocked URL and becoming confused |
| 2366 // later. | 2369 // later. |
| 2367 VLOG(1) << "Blocked URL " << url->spec(); | 2370 VLOG(1) << "Blocked URL " << url->spec(); |
| 2368 *url = GURL(url::kAboutBlankURL); | 2371 *url = GURL(url::kAboutBlankURL); |
| 2369 } | 2372 } |
| 2370 } | 2373 } |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2985 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2988 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 2986 | 2989 |
| 2987 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2990 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 2988 // enough information here so that we can determine what the bad message was. | 2991 // enough information here so that we can determine what the bad message was. |
| 2989 base::debug::Alias(&error); | 2992 base::debug::Alias(&error); |
| 2990 bad_message::ReceivedBadMessage(render_process_id, | 2993 bad_message::ReceivedBadMessage(render_process_id, |
| 2991 bad_message::RPH_MOJO_PROCESS_ERROR); | 2994 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2992 } | 2995 } |
| 2993 | 2996 |
| 2994 } // namespace content | 2997 } // namespace content |
| OLD | NEW |