OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |