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

Side by Side Diff: ipc/ipc_logging.cc

Issue 2821028: Up the warnings in ipc (take 2)... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | ipc/ipc_message_utils.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 "ipc/ipc_logging.h" 5 #include "ipc/ipc_logging.h"
6 6
7 #ifdef IPC_MESSAGE_LOG_ENABLED 7 #ifdef IPC_MESSAGE_LOG_ENABLED
8 // This will cause render_messages.h etc to define ViewMsgLog and friends. 8 // This will cause render_messages.h etc to define ViewMsgLog and friends.
9 #define IPC_MESSAGE_MACROS_LOG_ENABLED 9 #define IPC_MESSAGE_MACROS_LOG_ENABLED
10 #endif 10 #endif
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // all the traits used as IPC message parameters. 42 // all the traits used as IPC message parameters.
43 Logging::LogFunction *Logging::log_function_mapping_; 43 Logging::LogFunction *Logging::log_function_mapping_;
44 44
45 Logging::Logging() 45 Logging::Logging()
46 : enabled_(false), 46 : enabled_(false),
47 enabled_on_stderr_(false), 47 enabled_on_stderr_(false),
48 queue_invoke_later_pending_(false), 48 queue_invoke_later_pending_(false),
49 sender_(NULL), 49 sender_(NULL),
50 main_thread_(MessageLoop::current()), 50 main_thread_(MessageLoop::current()),
51 consumer_(NULL) { 51 consumer_(NULL) {
52 if (getenv("CHROME_IPC_LOGGING")) { 52 #if defined(OS_WIN)
53 // getenv triggers an unsafe warning. Simply check how big of a buffer
54 // would be needed to fetch the value to see if the enviornment variable is
55 // set.
56 size_t requiredSize = 0;
57 getenv_s(&requiredSize, NULL, 0, "CHROME_IPC_LOGGING");
58 bool logging_env_var_set = (requiredSize != 0);
Mark Mentovai 2010/07/23 15:07:28 I don’t know if requiredSize will be 0 (or somethi
TVL 2010/07/23 15:26:55 From what msdn says, if you fetch the value, it wi
59 #else // !defined(OS_WIN)
60 bool logging_env_var_set = (getenv("CHROME_IPC_LOGGING") != NULL);
Mark Mentovai 2010/07/23 15:07:28 You could have a const char* just outside the #if
61 #endif //defined(OS_WIN)
62 if (logging_env_var_set) {
53 enabled_ = true; 63 enabled_ = true;
54 enabled_on_stderr_ = true; 64 enabled_on_stderr_ = true;
55 } 65 }
56 } 66 }
57 67
58 Logging::~Logging() { 68 Logging::~Logging() {
59 } 69 }
60 70
61 Logging* Logging::current() { 71 Logging* Logging::current() {
62 return Singleton<Logging>::get(); 72 return Singleton<Logging>::get();
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 data->receive = message.received_time(); 244 data->receive = message.received_time();
235 data->dispatch = Time::Now().ToInternalValue(); 245 data->dispatch = Time::Now().ToInternalValue();
236 data->params = params; 246 data->params = params;
237 data->message_name = message_name; 247 data->message_name = message_name;
238 } 248 }
239 } 249 }
240 250
241 } 251 }
242 252
243 #endif // IPC_MESSAGE_LOG_ENABLED 253 #endif // IPC_MESSAGE_LOG_ENABLED
OLDNEW
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698