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

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

Issue 2534393003: (Reland) Remove about:srcdoc url conversion. (Closed)
Patch Set: Rebase. 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 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698