summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_logging.cc
diff options
context:
space:
mode:
authorthomasvl@google.com <thomasvl@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-23 14:18:59 +0000
committerthomasvl@google.com <thomasvl@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-23 14:18:59 +0000
commit7ee1a44c27384650612290a18ccbe736e0e4b955 (patch)
tree563b500ae9e1db27c1659456a33a5f0d7546aaad /ipc/ipc_logging.cc
parent23633b659e6bc5f672197eb90eb6ee50b843ba4a (diff)
downloadchromium_src-7ee1a44c27384650612290a18ccbe736e0e4b955.zip
chromium_src-7ee1a44c27384650612290a18ccbe736e0e4b955.tar.gz
chromium_src-7ee1a44c27384650612290a18ccbe736e0e4b955.tar.bz2
Up the warnings in ipc (take 2)
- add chromium_code:1 to the GYP file - Fix some unittest compares of literal 0 to apis that return size_t - initializer order match declared order - type_id is a uint32, so fix up comparison warnings by using the right type in the test code. - duplicate a type cast used in the ipc headers into the ipc impl to make windows happy. - msvc warns about getenv, avoid it. BUG=none TEST=everything still builds/works Review URL: http://codereview.chromium.org/2821028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_logging.cc')
-rw-r--r--ipc/ipc_logging.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc
index fb2f79b..608abcd 100644
--- a/ipc/ipc_logging.cc
+++ b/ipc/ipc_logging.cc
@@ -49,7 +49,17 @@ Logging::Logging()
sender_(NULL),
main_thread_(MessageLoop::current()),
consumer_(NULL) {
- if (getenv("CHROME_IPC_LOGGING")) {
+#if defined(OS_WIN)
+ // getenv triggers an unsafe warning. Simply check how big of a buffer
+ // would be needed to fetch the value to see if the enviornment variable is
+ // set.
+ size_t requiredSize = 0;
+ getenv_s(&requiredSize, NULL, 0, "CHROME_IPC_LOGGING");
+ bool logging_env_var_set = (requiredSize != 0);
+#else // !defined(OS_WIN)
+ bool logging_env_var_set = (getenv("CHROME_IPC_LOGGING") != NULL);
+#endif //defined(OS_WIN)
+ if (logging_env_var_set) {
enabled_ = true;
enabled_on_stderr_ = true;
}