| OLD | NEW |
| 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 "components/nacl/browser/nacl_broker_host_win.h" | 5 #include "components/nacl/browser/nacl_broker_host_win.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "components/nacl/browser/nacl_broker_service_win.h" | 10 #include "components/nacl/browser/nacl_broker_service_win.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ipc/ipc_switches.h" | 21 #include "ipc/ipc_switches.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 // NOTE: changes to this class need to be reviewed by the security team. | 24 // NOTE: changes to this class need to be reviewed by the security team. |
| 25 class NaClBrokerSandboxedProcessLauncherDelegate | 25 class NaClBrokerSandboxedProcessLauncherDelegate |
| 26 : public content::SandboxedProcessLauncherDelegate { | 26 : public content::SandboxedProcessLauncherDelegate { |
| 27 public: | 27 public: |
| 28 NaClBrokerSandboxedProcessLauncherDelegate() {} | 28 NaClBrokerSandboxedProcessLauncherDelegate() {} |
| 29 virtual ~NaClBrokerSandboxedProcessLauncherDelegate() {} | 29 virtual ~NaClBrokerSandboxedProcessLauncherDelegate() {} |
| 30 | 30 |
| 31 virtual void ShouldSandbox(bool* in_sandbox) OVERRIDE { | 31 virtual bool ShouldSandbox() OVERRIDE { |
| 32 *in_sandbox = false; | 32 return false; |
| 33 } | 33 } |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(NaClBrokerSandboxedProcessLauncherDelegate); | 36 DISALLOW_COPY_AND_ASSIGN(NaClBrokerSandboxedProcessLauncherDelegate); |
| 37 }; | 37 }; |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 namespace nacl { | 40 namespace nacl { |
| 41 | 41 |
| 42 NaClBrokerHost::NaClBrokerHost() : is_terminating_(false) { | 42 NaClBrokerHost::NaClBrokerHost() : is_terminating_(false) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 61 CommandLine* cmd_line = new CommandLine(nacl_path); | 61 CommandLine* cmd_line = new CommandLine(nacl_path); |
| 62 CopyNaClCommandLineArguments(cmd_line); | 62 CopyNaClCommandLineArguments(cmd_line); |
| 63 | 63 |
| 64 cmd_line->AppendSwitchASCII(switches::kProcessType, | 64 cmd_line->AppendSwitchASCII(switches::kProcessType, |
| 65 switches::kNaClBrokerProcess); | 65 switches::kNaClBrokerProcess); |
| 66 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 66 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
| 67 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) | 67 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) |
| 68 cmd_line->AppendSwitch(switches::kNoErrorDialogs); | 68 cmd_line->AppendSwitch(switches::kNoErrorDialogs); |
| 69 | 69 |
| 70 process_->Launch(new NaClBrokerSandboxedProcessLauncherDelegate, | 70 process_->Launch(new NaClBrokerSandboxedProcessLauncherDelegate, |
| 71 false, | |
| 72 cmd_line); | 71 cmd_line); |
| 73 return true; | 72 return true; |
| 74 } | 73 } |
| 75 | 74 |
| 76 bool NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) { | 75 bool NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) { |
| 77 bool handled = true; | 76 bool handled = true; |
| 78 IPC_BEGIN_MESSAGE_MAP(NaClBrokerHost, msg) | 77 IPC_BEGIN_MESSAGE_MAP(NaClBrokerHost, msg) |
| 79 IPC_MESSAGE_HANDLER(NaClProcessMsg_LoaderLaunched, OnLoaderLaunched) | 78 IPC_MESSAGE_HANDLER(NaClProcessMsg_LoaderLaunched, OnLoaderLaunched) |
| 80 IPC_MESSAGE_HANDLER(NaClProcessMsg_DebugExceptionHandlerLaunched, | 79 IPC_MESSAGE_HANDLER(NaClProcessMsg_DebugExceptionHandlerLaunched, |
| 81 OnDebugExceptionHandlerLaunched) | 80 OnDebugExceptionHandlerLaunched) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 111 NaClBrokerService::GetInstance()->OnDebugExceptionHandlerLaunched(pid, | 110 NaClBrokerService::GetInstance()->OnDebugExceptionHandlerLaunched(pid, |
| 112 success); | 111 success); |
| 113 } | 112 } |
| 114 | 113 |
| 115 void NaClBrokerHost::StopBroker() { | 114 void NaClBrokerHost::StopBroker() { |
| 116 is_terminating_ = true; | 115 is_terminating_ = true; |
| 117 process_->Send(new NaClProcessMsg_StopBroker()); | 116 process_->Send(new NaClProcessMsg_StopBroker()); |
| 118 } | 117 } |
| 119 | 118 |
| 120 } // namespace nacl | 119 } // namespace nacl |
| OLD | NEW |