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

Side by Side Diff: chrome/common/ipc_logging.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 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 | « chrome/common/ipc_channel_posix.cc ('k') | chrome/common/ipc_tests.cc » ('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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/common/ipc_logging.h" 5 #include "chrome/common/ipc_logging.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 27 matching lines...) Expand all
38 logging_event_off_(NULL), 38 logging_event_off_(NULL),
39 enabled_(false), 39 enabled_(false),
40 sender_(NULL), 40 sender_(NULL),
41 consumer_(NULL), 41 consumer_(NULL),
42 queue_invoke_later_pending_(false), 42 queue_invoke_later_pending_(false),
43 main_thread_(MessageLoop::current()) { 43 main_thread_(MessageLoop::current()) {
44 // Create an event for this browser instance that's set when logging is 44 // Create an event for this browser instance that's set when logging is
45 // enabled, so child processes can know when logging is enabled. 45 // enabled, so child processes can know when logging is enabled.
46 int browser_pid; 46 int browser_pid;
47 47
48 CommandLine parsed_command_line; 48 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
49 std::wstring process_type = 49 std::wstring process_type =
50 parsed_command_line.GetSwitchValue(switches::kProcessType); 50 parsed_command_line.GetSwitchValue(switches::kProcessType);
51 if (process_type.empty()) { 51 if (process_type.empty()) {
52 browser_pid = GetCurrentProcessId(); 52 browser_pid = GetCurrentProcessId();
53 } else { 53 } else {
54 std::wstring channel_name = 54 std::wstring channel_name =
55 parsed_command_line.GetSwitchValue(switches::kProcessChannelID); 55 parsed_command_line.GetSwitchValue(switches::kProcessChannelID);
56 56
57 browser_pid = _wtoi(channel_name.c_str()); 57 browser_pid = _wtoi(channel_name.c_str());
58 DCHECK(browser_pid != 0); 58 DCHECK(browser_pid != 0);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 data->sent = message.sent_time(); 262 data->sent = message.sent_time();
263 data->receive = message.received_time(); 263 data->receive = message.received_time();
264 data->dispatch = Time::Now().ToInternalValue(); 264 data->dispatch = Time::Now().ToInternalValue();
265 data->params = params; 265 data->params = params;
266 } 266 }
267 } 267 }
268 268
269 } 269 }
270 270
271 #endif // IPC_MESSAGE_LOG_ENABLED 271 #endif // IPC_MESSAGE_LOG_ENABLED
OLDNEW
« no previous file with comments | « chrome/common/ipc_channel_posix.cc ('k') | chrome/common/ipc_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698