Chromium Code Reviews| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/nacl/browser/nacl_broker_service_win.h" | 10 #include "components/nacl/browser/nacl_broker_service_win.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 base::CommandLine* cmd_line = new base::CommandLine(nacl_path); | 68 base::CommandLine* cmd_line = new base::CommandLine(nacl_path); |
| 69 CopyNaClCommandLineArguments(cmd_line); | 69 CopyNaClCommandLineArguments(cmd_line); |
| 70 | 70 |
| 71 cmd_line->AppendSwitchASCII(switches::kProcessType, | 71 cmd_line->AppendSwitchASCII(switches::kProcessType, |
| 72 switches::kNaClBrokerProcess); | 72 switches::kNaClBrokerProcess); |
| 73 cmd_line->AppendSwitchASCII(switches::kMojoChannelToken, mojo_channel_token); | 73 cmd_line->AppendSwitchASCII(switches::kMojoChannelToken, mojo_channel_token); |
| 74 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) | 74 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) |
| 75 cmd_line->AppendSwitch(switches::kNoErrorDialogs); | 75 cmd_line->AppendSwitch(switches::kNoErrorDialogs); |
| 76 | 76 |
| 77 process_->Launch(new NaClBrokerSandboxedProcessLauncherDelegate, | 77 process_->Launch(new NaClBrokerSandboxedProcessLauncherDelegate, |
| 78 NULL, | |
|
Alexei Svitkine (slow)
2016/10/03 15:28:05
Nit: New code should use nullptr rather than NULL.
lawrencewu
2016/10/03 21:36:10
Done.
| |
| 78 cmd_line, | 79 cmd_line, |
| 79 true); | 80 true); |
| 80 return true; | 81 return true; |
| 81 } | 82 } |
| 82 | 83 |
| 83 bool NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) { | 84 bool NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) { |
| 84 bool handled = true; | 85 bool handled = true; |
| 85 IPC_BEGIN_MESSAGE_MAP(NaClBrokerHost, msg) | 86 IPC_BEGIN_MESSAGE_MAP(NaClBrokerHost, msg) |
| 86 IPC_MESSAGE_HANDLER(NaClProcessMsg_LoaderLaunched, OnLoaderLaunched) | 87 IPC_MESSAGE_HANDLER(NaClProcessMsg_LoaderLaunched, OnLoaderLaunched) |
| 87 IPC_MESSAGE_HANDLER(NaClProcessMsg_DebugExceptionHandlerLaunched, | 88 IPC_MESSAGE_HANDLER(NaClProcessMsg_DebugExceptionHandlerLaunched, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 NaClBrokerService::GetInstance()->OnDebugExceptionHandlerLaunched(pid, | 122 NaClBrokerService::GetInstance()->OnDebugExceptionHandlerLaunched(pid, |
| 122 success); | 123 success); |
| 123 } | 124 } |
| 124 | 125 |
| 125 void NaClBrokerHost::StopBroker() { | 126 void NaClBrokerHost::StopBroker() { |
| 126 is_terminating_ = true; | 127 is_terminating_ = true; |
| 127 process_->Send(new NaClProcessMsg_StopBroker()); | 128 process_->Send(new NaClProcessMsg_StopBroker()); |
| 128 } | 129 } |
| 129 | 130 |
| 130 } // namespace nacl | 131 } // namespace nacl |
| OLD | NEW |