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

Side by Side Diff: chrome/browser/render_process_host.cc

Issue 2458: Use the new dll injection blocking api of the sandbox to block... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 | « chrome/app/chrome_dll_main.cc ('k') | chrome/browser/sandbox_policy.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/render_process_host.h" 8 #include "chrome/browser/render_process_host.h"
9 9
10 #include <windows.h> 10 #include <windows.h>
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 policy->SetDesktop(kDesktopName); 362 policy->SetDesktop(kDesktopName);
363 } else { 363 } else {
364 DLOG(WARNING) << "Failed to apply desktop security to the renderer"; 364 DLOG(WARNING) << "Failed to apply desktop security to the renderer";
365 } 365 }
366 366
367 if (!AddGenericPolicy(policy)) { 367 if (!AddGenericPolicy(policy)) {
368 NOTREACHED(); 368 NOTREACHED();
369 return false; 369 return false;
370 } 370 }
371 371
372 if (!AddDllEvictionPolicy(policy)) {
373 NOTREACHED();
374 return false;
375 }
376
372 result = broker_service->SpawnTarget(renderer_path.c_str(), 377 result = broker_service->SpawnTarget(renderer_path.c_str(),
373 cmd_line.c_str(), 378 cmd_line.c_str(),
374 policy, &target); 379 policy, &target);
375 policy->Release(); 380 policy->Release();
376 381
377 if (desktop) 382 if (desktop)
378 CloseDesktop(desktop); 383 CloseDesktop(desktop);
379 384
380 if (sandbox::SBOX_ALL_OK != result) 385 if (sandbox::SBOX_ALL_OK != result)
381 return false; 386 return false;
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 // NOTE: Sometimes it's necessary to create more render processes than 758 // NOTE: Sometimes it's necessary to create more render processes than
754 // GetMaxRendererProcessCount(), for instance when we want to create 759 // GetMaxRendererProcessCount(), for instance when we want to create
755 // a renderer process for a profile that has no existing renderers. 760 // a renderer process for a profile that has no existing renderers.
756 // This is OK in moderation, since the GetMaxRendererProcessCount() 761 // This is OK in moderation, since the GetMaxRendererProcessCount()
757 // is conservative. 762 // is conservative.
758 763
759 return run_renderer_in_process() || 764 return run_renderer_in_process() ||
760 (renderer_process_count >= GetMaxRendererProcessCount()); 765 (renderer_process_count >= GetMaxRendererProcessCount());
761 } 766 }
762 767
OLDNEW
« no previous file with comments | « chrome/app/chrome_dll_main.cc ('k') | chrome/browser/sandbox_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698