Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2494633004: Remove about:srcdoc url conversion. (Closed)
Patch Set: Addressed comments (@creis) Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 2360
2361 if (!url->is_valid()) { 2361 if (!url->is_valid()) {
2362 // Have to use about:blank for the denied case, instead of an empty GURL. 2362 // Have to use about:blank for the denied case, instead of an empty GURL.
2363 // This is because the browser treats navigation to an empty GURL as a 2363 // This is because the browser treats navigation to an empty GURL as a
2364 // navigation to the home page. This is often a privileged page 2364 // navigation to the home page. This is often a privileged page
2365 // (chrome://newtab/) which is exactly what we don't want. 2365 // (chrome://newtab/) which is exactly what we don't want.
2366 *url = GURL(url::kAboutBlankURL); 2366 *url = GURL(url::kAboutBlankURL);
2367 return; 2367 return;
2368 } 2368 }
2369 2369
2370 if (url->SchemeIs(url::kAboutScheme)) {
2371 // The renderer treats all URLs in the about: scheme as being about:blank.
2372 // Canonicalize about: URLs to about:blank.
2373 *url = GURL(url::kAboutBlankURL);
2374 }
2375
2376 if (!policy->CanRequestURL(rph->GetID(), *url)) { 2370 if (!policy->CanRequestURL(rph->GetID(), *url)) {
2377 // If this renderer is not permitted to request this URL, we invalidate the 2371 // If this renderer is not permitted to request this URL, we invalidate the
2378 // URL. This prevents us from storing the blocked URL and becoming confused 2372 // URL. This prevents us from storing the blocked URL and becoming confused
2379 // later. 2373 // later.
2380 VLOG(1) << "Blocked URL " << url->spec(); 2374 VLOG(1) << "Blocked URL " << url->spec();
2381 *url = GURL(url::kAboutBlankURL); 2375 *url = GURL(url::kAboutBlankURL);
2382 } 2376 }
2383 } 2377 }
2384 2378
2385 // static 2379 // static
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 2992 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
2999 2993
3000 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias 2994 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias
3001 // enough information here so that we can determine what the bad message was. 2995 // enough information here so that we can determine what the bad message was.
3002 base::debug::Alias(&error); 2996 base::debug::Alias(&error);
3003 bad_message::ReceivedBadMessage(render_process_id, 2997 bad_message::ReceivedBadMessage(render_process_id,
3004 bad_message::RPH_MOJO_PROCESS_ERROR); 2998 bad_message::RPH_MOJO_PROCESS_ERROR);
3005 } 2999 }
3006 3000
3007 } // namespace content 3001 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698