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

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

Issue 1415483008: Get rid of SandboxedProcessLauncherDelegate::PreSandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed one clang error. Created 5 years, 1 month 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 (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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after
2551 case PROCESS_TYPE_NACL_BROKER: 2551 case PROCESS_TYPE_NACL_BROKER:
2552 return base::string16(); 2552 return base::string16();
2553 #endif 2553 #endif
2554 } 2554 }
2555 2555
2556 // Should never reach here. 2556 // Should never reach here.
2557 CHECK(0); 2557 CHECK(0);
2558 return base::string16(); 2558 return base::string16();
2559 } 2559 }
2560 2560
2561 void ChromeContentBrowserClient::PreSpawnRenderer( 2561 bool ChromeContentBrowserClient::PreSpawnRenderer(
2562 sandbox::TargetPolicy* policy, 2562 sandbox::TargetPolicy* policy) {
2563 bool* success) {
2564 // This code is duplicated in nacl_exe_win_64.cc. 2563 // This code is duplicated in nacl_exe_win_64.cc.
2565 // Allow the server side of a pipe restricted to the "chrome.nacl." 2564 // Allow the server side of a pipe restricted to the "chrome.nacl."
2566 // namespace so that it cannot impersonate other system or other chrome 2565 // namespace so that it cannot impersonate other system or other chrome
2567 // service pipes. 2566 // service pipes.
2568 sandbox::ResultCode result = policy->AddRule( 2567 sandbox::ResultCode result = policy->AddRule(
2569 sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, 2568 sandbox::TargetPolicy::SUBSYS_NAMED_PIPES,
2570 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, 2569 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY,
2571 L"\\\\.\\pipe\\chrome.nacl.*"); 2570 L"\\\\.\\pipe\\chrome.nacl.*");
2572 if (result != sandbox::SBOX_ALL_OK) { 2571 if (result != sandbox::SBOX_ALL_OK) {
2573 *success = false; 2572 return false;
Will Harris 2015/11/06 19:26:37 nit: no need for braces
rickyz (no longer on Chrome) 2015/11/10 02:16:32 How strongly do you feel about leaving these brace
Will Harris 2015/11/10 17:45:38 style guide says no braces... so they really shoul
rickyz (no longer on Chrome) 2015/11/10 23:18:01 The style guide actually allows both here: https:/
2574 return;
2575 } 2573 }
2576 2574
2577 // Renderers need to send named pipe handles and shared memory 2575 // Renderers need to send named pipe handles and shared memory
2578 // segment handles to NaCl loader processes. 2576 // segment handles to NaCl loader processes.
2579 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES, 2577 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES,
2580 sandbox::TargetPolicy::HANDLES_DUP_ANY, 2578 sandbox::TargetPolicy::HANDLES_DUP_ANY,
2581 L"File"); 2579 L"File");
2582 if (result != sandbox::SBOX_ALL_OK) { 2580 if (result != sandbox::SBOX_ALL_OK) {
2583 *success = false; 2581 return false;
2584 return;
2585 } 2582 }
2583
2584 return true;
2586 } 2585 }
2587 #endif 2586 #endif
2588 2587
2589 void ChromeContentBrowserClient::RegisterFrameMojoShellServices( 2588 void ChromeContentBrowserClient::RegisterFrameMojoShellServices(
2590 content::ServiceRegistry* registry, 2589 content::ServiceRegistry* registry,
2591 content::RenderFrameHost* render_frame_host) { 2590 content::RenderFrameHost* render_frame_host) {
2592 #if defined(OS_CHROMEOS) 2591 #if defined(OS_CHROMEOS)
2593 registry->AddService( 2592 registry->AddService(
2594 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, 2593 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create,
2595 render_frame_host)); 2594 render_frame_host));
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 if (channel <= kMaxDisableEncryptionChannel) { 2768 if (channel <= kMaxDisableEncryptionChannel) {
2770 static const char* const kWebRtcDevSwitchNames[] = { 2769 static const char* const kWebRtcDevSwitchNames[] = {
2771 switches::kDisableWebRtcEncryption, 2770 switches::kDisableWebRtcEncryption,
2772 }; 2771 };
2773 to_command_line->CopySwitchesFrom(from_command_line, 2772 to_command_line->CopySwitchesFrom(from_command_line,
2774 kWebRtcDevSwitchNames, 2773 kWebRtcDevSwitchNames,
2775 arraysize(kWebRtcDevSwitchNames)); 2774 arraysize(kWebRtcDevSwitchNames));
2776 } 2775 }
2777 } 2776 }
2778 #endif // defined(ENABLE_WEBRTC) 2777 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/service/service_utility_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698