| 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 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2369 | 2369 |
| 2370 if (!url->is_valid()) { | 2370 if (!url->is_valid()) { |
| 2371 // Have to use about:blank for the denied case, instead of an empty GURL. | 2371 // Have to use about:blank for the denied case, instead of an empty GURL. |
| 2372 // This is because the browser treats navigation to an empty GURL as a | 2372 // This is because the browser treats navigation to an empty GURL as a |
| 2373 // navigation to the home page. This is often a privileged page | 2373 // navigation to the home page. This is often a privileged page |
| 2374 // (chrome://newtab/) which is exactly what we don't want. | 2374 // (chrome://newtab/) which is exactly what we don't want. |
| 2375 *url = GURL(url::kAboutBlankURL); | 2375 *url = GURL(url::kAboutBlankURL); |
| 2376 return; | 2376 return; |
| 2377 } | 2377 } |
| 2378 | 2378 |
| 2379 if (url->SchemeIs(url::kAboutScheme)) { | |
| 2380 // The renderer treats all URLs in the about: scheme as being about:blank. | |
| 2381 // Canonicalize about: URLs to about:blank. | |
| 2382 *url = GURL(url::kAboutBlankURL); | |
| 2383 } | |
| 2384 | |
| 2385 if (!policy->CanRequestURL(rph->GetID(), *url)) { | 2379 if (!policy->CanRequestURL(rph->GetID(), *url)) { |
| 2386 // If this renderer is not permitted to request this URL, we invalidate the | 2380 // If this renderer is not permitted to request this URL, we invalidate the |
| 2387 // URL. This prevents us from storing the blocked URL and becoming confused | 2381 // URL. This prevents us from storing the blocked URL and becoming confused |
| 2388 // later. | 2382 // later. |
| 2389 VLOG(1) << "Blocked URL " << url->spec(); | 2383 VLOG(1) << "Blocked URL " << url->spec(); |
| 2390 *url = GURL(url::kAboutBlankURL); | 2384 *url = GURL(url::kAboutBlankURL); |
| 2391 } | 2385 } |
| 2392 } | 2386 } |
| 2393 | 2387 |
| 2394 // static | 2388 // static |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3007 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3001 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3008 | 3002 |
| 3009 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3003 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3010 // Capture the error message in a crash key value. | 3004 // Capture the error message in a crash key value. |
| 3011 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3005 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3012 bad_message::ReceivedBadMessage(render_process_id, | 3006 bad_message::ReceivedBadMessage(render_process_id, |
| 3013 bad_message::RPH_MOJO_PROCESS_ERROR); | 3007 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3014 } | 3008 } |
| 3015 | 3009 |
| 3016 } // namespace content | 3010 } // namespace content |
| OLD | NEW |