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 "chrome/browser/nacl_host/nacl_process_host.h" | 5 #include "chrome/browser/nacl_host/nacl_process_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 cmd_line->AppendArg("--eval-command"); | 305 cmd_line->AppendArg("--eval-command"); |
306 const FilePath::StringType& irt_path = | 306 const FilePath::StringType& irt_path = |
307 NaClBrowser::GetInstance()->GetIrtFilePath().value(); | 307 NaClBrowser::GetInstance()->GetIrtFilePath().value(); |
308 cmd_line->AppendArgNative(FILE_PATH_LITERAL("nacl-irt ") + irt_path); | 308 cmd_line->AppendArgNative(FILE_PATH_LITERAL("nacl-irt ") + irt_path); |
309 FilePath manifest_path = GetManifestPath(); | 309 FilePath manifest_path = GetManifestPath(); |
310 if (!manifest_path.empty()) { | 310 if (!manifest_path.empty()) { |
311 cmd_line->AppendArg("--eval-command"); | 311 cmd_line->AppendArg("--eval-command"); |
312 cmd_line->AppendArgNative(FILE_PATH_LITERAL("nacl-manifest ") + | 312 cmd_line->AppendArgNative(FILE_PATH_LITERAL("nacl-manifest ") + |
313 manifest_path.value()); | 313 manifest_path.value()); |
314 } | 314 } |
315 const FilePath script = CommandLine::ForCurrentProcess()->GetSwitchValuePath( | |
Mark Seaborn
2012/05/24 17:25:58
Nit: 'const' seems unnecessary for a simple, non-r
halyavin
2012/05/25 09:37:45
Done.
| |
316 switches::kNaClGdbScript); | |
317 if (!script.empty()) { | |
318 cmd_line->AppendArg("--command"); | |
319 cmd_line->AppendArgNative(script.value()); | |
320 } | |
315 cmd_line->AppendArg("--args"); | 321 cmd_line->AppendArg("--args"); |
316 const CommandLine::StringVector& argv = line->argv(); | 322 const CommandLine::StringVector& argv = line->argv(); |
317 for (size_t i = 0; i < argv.size(); i++) { | 323 for (size_t i = 0; i < argv.size(); i++) { |
318 cmd_line->AppendArgNative(argv[i]); | 324 cmd_line->AppendArgNative(argv[i]); |
319 } | 325 } |
320 return scoped_ptr<CommandLine>(cmd_line); | 326 return scoped_ptr<CommandLine>(cmd_line); |
321 } | 327 } |
322 #elif defined(OS_LINUX) | 328 #elif defined(OS_LINUX) |
323 namespace { | 329 namespace { |
324 class NaClGdbWatchDelegate : public MessageLoopForIO::Watcher { | 330 class NaClGdbWatchDelegate : public MessageLoopForIO::Watcher { |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
751 } else { | 757 } else { |
752 NaClStartDebugExceptionHandlerThread( | 758 NaClStartDebugExceptionHandlerThread( |
753 process_handle.Take(), info, | 759 process_handle.Take(), info, |
754 base::MessageLoopProxy::current(), | 760 base::MessageLoopProxy::current(), |
755 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 761 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
756 weak_factory_.GetWeakPtr())); | 762 weak_factory_.GetWeakPtr())); |
757 return true; | 763 return true; |
758 } | 764 } |
759 } | 765 } |
760 #endif | 766 #endif |
OLD | NEW |