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

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

Issue 11772005: Implement a prototype to render cross-site iframes in a separate process from their parent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT. Created 7 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/plugin_service_impl.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 // Kill the renderer process if it violates this policy. 1247 // Kill the renderer process if it violates this policy.
1248 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 1248 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1249 if (command_line.HasSwitch(switches::kSitePerProcess) && 1249 if (command_line.HasSwitch(switches::kSitePerProcess) &&
1250 static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() && 1250 static_cast<SiteInstanceImpl*>(GetSiteInstance())->HasSite() &&
1251 validated_params.url != GURL(chrome::kAboutBlankURL)) { 1251 validated_params.url != GURL(chrome::kAboutBlankURL)) {
1252 if (!SiteInstance::IsSameWebSite(GetSiteInstance()->GetBrowserContext(), 1252 if (!SiteInstance::IsSameWebSite(GetSiteInstance()->GetBrowserContext(),
1253 GetSiteInstance()->GetSiteURL(), 1253 GetSiteInstance()->GetSiteURL(),
1254 validated_params.url) || 1254 validated_params.url) ||
1255 static_cast<SiteInstanceImpl*>(GetSiteInstance())-> 1255 static_cast<SiteInstanceImpl*>(GetSiteInstance())->
1256 HasWrongProcessForURL(validated_params.url)) { 1256 HasWrongProcessForURL(validated_params.url)) {
1257 base::KillProcess(process->GetHandle(), RESULT_CODE_KILLED, true); 1257 // TODO(nasko): Removed the actual kill process call until out-of-process
1258 UMA_HISTOGRAM_COUNTS("ChildProcess.ViolatedSitePerProcess", 1); 1258 // iframes is ready to go.
1259 } 1259 }
1260 } 1260 }
1261 1261
1262 ChildProcessSecurityPolicyImpl* policy = 1262 ChildProcessSecurityPolicyImpl* policy =
1263 ChildProcessSecurityPolicyImpl::GetInstance(); 1263 ChildProcessSecurityPolicyImpl::GetInstance();
1264 // Without this check, an evil renderer can trick the browser into creating 1264 // Without this check, an evil renderer can trick the browser into creating
1265 // a navigation entry for a banned URL. If the user clicks the back button 1265 // a navigation entry for a banned URL. If the user clicks the back button
1266 // followed by the forward button (or clicks reload, or round-trips through 1266 // followed by the forward button (or clicks reload, or round-trips through
1267 // session restore, etc), we'll think that the browser commanded the 1267 // session restore, etc), we'll think that the browser commanded the
1268 // renderer to load the URL and grant the renderer the privileges to request 1268 // renderer to load the URL and grant the renderer the privileges to request
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 GetRoutingID(), snapshot_id, snapshot_size, png)); 2101 GetRoutingID(), snapshot_id, snapshot_size, png));
2102 return; 2102 return;
2103 } 2103 }
2104 } 2104 }
2105 2105
2106 Send(new ViewMsg_WindowSnapshotCompleted( 2106 Send(new ViewMsg_WindowSnapshotCompleted(
2107 GetRoutingID(), snapshot_id, gfx::Size(), png)); 2107 GetRoutingID(), snapshot_id, gfx::Size(), png));
2108 } 2108 }
2109 2109
2110 } // namespace content 2110 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_service_impl.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698