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

Side by Side Diff: mojo/runner/init.cc

Issue 1284833004: Remove remaining legacy SplitString calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « mojo/runner/context.cc ('k') | native_client_sdk/src/libraries/sdk_util/string_util.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/runner/init.h" 5 #include "mojo/runner/init.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/debug/debugger.h" 9 #include "base/debug/debugger.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 20 matching lines...) Expand all
31 logging::SetLogItems(false, // Process ID 31 logging::SetLogItems(false, // Process ID
32 false, // Thread ID 32 false, // Thread ID
33 false, // Timestamp 33 false, // Timestamp
34 false); // Tick count 34 false); // Tick count
35 } 35 }
36 36
37 void WaitForDebuggerIfNecessary() { 37 void WaitForDebuggerIfNecessary() {
38 const base::CommandLine* command_line = 38 const base::CommandLine* command_line =
39 base::CommandLine::ForCurrentProcess(); 39 base::CommandLine::ForCurrentProcess();
40 if (command_line->HasSwitch(switches::kWaitForDebugger)) { 40 if (command_line->HasSwitch(switches::kWaitForDebugger)) {
41 std::vector<std::string> apps_to_debug; 41 std::vector<std::string> apps_to_debug = base::SplitString(
42 base::SplitString( 42 command_line->GetSwitchValueASCII(switches::kWaitForDebugger), ",",
43 command_line->GetSwitchValueASCII(switches::kWaitForDebugger), ',', 43 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
44 &apps_to_debug);
45 std::string app = "launcher"; 44 std::string app = "launcher";
46 if (command_line->HasSwitch(switches::kChildProcess)) { 45 if (command_line->HasSwitch(switches::kChildProcess)) {
47 app = command_line->GetSwitchValuePath(switches::kChildProcess) 46 app = command_line->GetSwitchValuePath(switches::kChildProcess)
48 .BaseName() 47 .BaseName()
49 .RemoveExtension() 48 .RemoveExtension()
50 .MaybeAsASCII(); 49 .MaybeAsASCII();
51 } 50 }
52 if (apps_to_debug.empty() || ContainsValue(apps_to_debug, app)) { 51 if (apps_to_debug.empty() || ContainsValue(apps_to_debug, app)) {
53 #if defined(OS_WIN) 52 #if defined(OS_WIN)
54 base::string16 appw = base::UTF8ToUTF16(app); 53 base::string16 appw = base::UTF8ToUTF16(app);
55 MessageBox(NULL, appw.c_str(), appw.c_str(), MB_OK | MB_SETFOREGROUND); 54 MessageBox(NULL, appw.c_str(), appw.c_str(), MB_OK | MB_SETFOREGROUND);
56 #else 55 #else
57 LOG(ERROR) << app << " waiting for GDB. pid: " << getpid(); 56 LOG(ERROR) << app << " waiting for GDB. pid: " << getpid();
58 base::debug::WaitForDebugger(60, true); 57 base::debug::WaitForDebugger(60, true);
59 #endif 58 #endif
60 } 59 }
61 } 60 }
62 } 61 }
63 62
64 } // namespace runner 63 } // namespace runner
65 } // namespace mojo 64 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/runner/context.cc ('k') | native_client_sdk/src/libraries/sdk_util/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698