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 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2362 | 2362 |
2363 if (!url->is_valid()) { | 2363 if (!url->is_valid()) { |
2364 // Have to use about:blank for the denied case, instead of an empty GURL. | 2364 // Have to use about:blank for the denied case, instead of an empty GURL. |
2365 // This is because the browser treats navigation to an empty GURL as a | 2365 // This is because the browser treats navigation to an empty GURL as a |
2366 // navigation to the home page. This is often a privileged page | 2366 // navigation to the home page. This is often a privileged page |
2367 // (chrome://newtab/) which is exactly what we don't want. | 2367 // (chrome://newtab/) which is exactly what we don't want. |
2368 *url = GURL(url::kAboutBlankURL); | 2368 *url = GURL(url::kAboutBlankURL); |
2369 return; | 2369 return; |
2370 } | 2370 } |
2371 | 2371 |
2372 if (url->SchemeIs(url::kAboutScheme)) { | |
2373 // The renderer treats all URLs in the about: scheme as being about:blank. | |
2374 // Canonicalize about: URLs to about:blank. | |
2375 *url = GURL(url::kAboutBlankURL); | |
2376 } | |
2377 | |
2378 if (!policy->CanRequestURL(rph->GetID(), *url)) { | 2372 if (!policy->CanRequestURL(rph->GetID(), *url)) { |
2379 // If this renderer is not permitted to request this URL, we invalidate the | 2373 // If this renderer is not permitted to request this URL, we invalidate the |
2380 // URL. This prevents us from storing the blocked URL and becoming confused | 2374 // URL. This prevents us from storing the blocked URL and becoming confused |
2381 // later. | 2375 // later. |
2382 VLOG(1) << "Blocked URL " << url->spec(); | 2376 VLOG(1) << "Blocked URL " << url->spec(); |
2383 *url = GURL(url::kAboutBlankURL); | 2377 *url = GURL(url::kAboutBlankURL); |
2384 } | 2378 } |
2385 } | 2379 } |
2386 | 2380 |
2387 // static | 2381 // static |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3000 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2994 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3001 | 2995 |
3002 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2996 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
3003 // enough information here so that we can determine what the bad message was. | 2997 // enough information here so that we can determine what the bad message was. |
3004 base::debug::Alias(&error); | 2998 base::debug::Alias(&error); |
3005 bad_message::ReceivedBadMessage(render_process_id, | 2999 bad_message::ReceivedBadMessage(render_process_id, |
3006 bad_message::RPH_MOJO_PROCESS_ERROR); | 3000 bad_message::RPH_MOJO_PROCESS_ERROR); |
3007 } | 3001 } |
3008 | 3002 |
3009 } // namespace content | 3003 } // namespace content |
OLD | NEW |