summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-19 02:31:03 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-19 02:31:03 +0000
commitb026e35d56ca317e00fa54864e7f869be62e99d9 (patch)
treee9a32e7cc2d0574cf3ef29a0f4e75b7fc3cde6c6
parent12a94ea157a6326c835f6dc9bca3a2332b911606 (diff)
downloadchromium_src-b026e35d56ca317e00fa54864e7f869be62e99d9.zip
chromium_src-b026e35d56ca317e00fa54864e7f869be62e99d9.tar.gz
chromium_src-b026e35d56ca317e00fa54864e7f869be62e99d9.tar.bz2
Reland r62959 without the changes to histogram.cc, in hopes it won't break tab_switching_test, and without the changes to tools_sanity_unittest.cc, which have already been relanded separately.
TBR=timsteele Original changelog message: Convert LOG(INFO) to VLOG(1) - base/. Also removes an "else" after "return" and aligns "<<" per style guide. BUG=none TEST=none Review URL: http://codereview.chromium.org/3850007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63009 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/crypto/symmetric_key_unittest.cc2
-rw-r--r--base/debug_util_unittest.cc4
-rw-r--r--base/event_trace_consumer_win_unittest.cc6
-rw-r--r--base/event_trace_controller_win_unittest.cc6
-rw-r--r--base/file_util_win.cc28
-rw-r--r--base/i18n/char_iterator.h2
-rw-r--r--base/i18n/word_iterator.h2
-rw-r--r--base/message_loop_unittest.cc6
-rw-r--r--base/nss_util.cc8
-rw-r--r--base/observer_list_unittest.cc4
-rw-r--r--base/string_split.cc4
-rw-r--r--base/watchdog.cc6
12 files changed, 36 insertions, 42 deletions
diff --git a/base/crypto/symmetric_key_unittest.cc b/base/crypto/symmetric_key_unittest.cc
index 023179d..664bcb5 100644
--- a/base/crypto/symmetric_key_unittest.cc
+++ b/base/crypto/symmetric_key_unittest.cc
@@ -200,7 +200,7 @@ TEST(SymmetricKeyTest, DeriveKeyFromPassword) {
// The OS X crypto libraries have minimum salt and iteration requirements
// so some of the above tests will cause them to barf. Skip these.
if (strlen(test_vectors[i].salt) < 8 || test_vectors[i].rounds < 1000) {
- LOG(INFO) << "Skipped test vector #" << i;
+ VLOG(1) << "Skipped test vector #" << i;
continue;
}
#endif // OS_MACOSX
diff --git a/base/debug_util_unittest.cc b/base/debug_util_unittest.cc
index c3c9cdf..8d0deab 100644
--- a/base/debug_util_unittest.cc
+++ b/base/debug_util_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -97,7 +97,7 @@ TEST(StackTrace, DebugOutputToStream) {
StackTrace trace;
std::ostringstream os;
trace.OutputToStream(&os);
- LOG(INFO) << os.str();
+ VLOG(1) << os.str();
}
// The test is used for manual testing, e.g., to see the raw output.
diff --git a/base/event_trace_consumer_win_unittest.cc b/base/event_trace_consumer_win_unittest.cc
index c964412..412ca0c 100644
--- a/base/event_trace_consumer_win_unittest.cc
+++ b/base/event_trace_consumer_win_unittest.cc
@@ -179,7 +179,7 @@ TEST_F(EtwTraceConsumerRealtimeTest, ConsumerReturnsWhenSessionClosed) {
HRESULT hr = controller.StartRealtimeSession(kTestSessionName, 100 * 1024);
if (hr == E_ACCESSDENIED) {
- LOG(INFO) << "You must be an administrator to run this test on Vista";
+ VLOG(1) << "You must be an administrator to run this test on Vista";
return;
}
@@ -211,7 +211,7 @@ TEST_F(EtwTraceConsumerRealtimeTest, ConsumeEvent) {
EtwTraceController controller;
HRESULT hr = controller.StartRealtimeSession(kTestSessionName, 100 * 1024);
if (hr == E_ACCESSDENIED) {
- LOG(INFO) << "You must be an administrator to run this test on Vista";
+ VLOG(1) << "You must be an administrator to run this test on Vista";
return;
}
@@ -331,7 +331,7 @@ TEST_F(EtwTraceConsumerDataTest, RoundTrip) {
PEVENT_TRACE trace = NULL;
HRESULT hr = RoundTripEvent(&event.header, &trace);
if (hr == E_ACCESSDENIED) {
- LOG(INFO) << "You must be an administrator to run this test on Vista";
+ VLOG(1) << "You must be an administrator to run this test on Vista";
return;
}
ASSERT_TRUE(NULL != trace);
diff --git a/base/event_trace_controller_win_unittest.cc b/base/event_trace_controller_win_unittest.cc
index 5777e58..1fcb616 100644
--- a/base/event_trace_controller_win_unittest.cc
+++ b/base/event_trace_controller_win_unittest.cc
@@ -120,7 +120,7 @@ TEST(EtwTraceControllerTest, StartRealTimeSession) {
HRESULT hr = controller.StartRealtimeSession(kTestSessionName, 100 * 1024);
if (hr == E_ACCESSDENIED) {
- LOG(INFO) << "You must be an administrator to run this test on Vista";
+ VLOG(1) << "You must be an administrator to run this test on Vista";
return;
}
@@ -141,7 +141,7 @@ TEST(EtwTraceControllerTest, StartFileSession) {
HRESULT hr = controller.StartFileSession(kTestSessionName,
temp.value().c_str());
if (hr == E_ACCESSDENIED) {
- LOG(INFO) << "You must be an administrator to run this test on Vista";
+ VLOG(1) << "You must be an administrator to run this test on Vista";
return;
}
@@ -162,7 +162,7 @@ TEST(EtwTraceControllerTest, EnableDisable) {
EtwTraceController controller;
HRESULT hr = controller.StartRealtimeSession(kTestSessionName, 100 * 1024);
if (hr == E_ACCESSDENIED) {
- LOG(INFO) << "You must be an administrator to run this test on Vista";
+ VLOG(1) << "You must be an administrator to run this test on Vista";
return;
}
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index d9f8404..30d314f 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -561,8 +561,7 @@ bool CreateTemporaryDirInDir(const FilePath& base_dir,
FilePath path_to_create;
srand(static_cast<uint32>(time(NULL)));
- int count = 0;
- while (count < 50) {
+ for (int count = 0; count < 50; ++count) {
// Try create a new temporary directory with random generated name. If
// the one exists, keep trying another path name until we reach some limit.
path_to_create = base_dir;
@@ -572,17 +571,13 @@ bool CreateTemporaryDirInDir(const FilePath& base_dir,
new_dir_name.append(base::IntToString16(rand() % kint16max));
path_to_create = path_to_create.Append(new_dir_name);
- if (::CreateDirectory(path_to_create.value().c_str(), NULL))
- break;
- count++;
- }
-
- if (count == 50) {
- return false;
+ if (::CreateDirectory(path_to_create.value().c_str(), NULL)) {
+ *new_dir = path_to_create;
+ return true;
+ }
}
- *new_dir = path_to_create;
- return true;
+ return false;
}
bool CreateNewTempDirectory(const FilePath::StringType& prefix,
@@ -600,14 +595,13 @@ bool CreateDirectory(const FilePath& full_path) {
DWORD fileattr = ::GetFileAttributes(full_path_str);
if (fileattr != INVALID_FILE_ATTRIBUTES) {
if ((fileattr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
- DLOG(INFO) << "CreateDirectory(" << full_path_str << "), "
- << "directory already exists.";
+ DVLOG(1) << "CreateDirectory(" << full_path_str << "), "
+ << "directory already exists.";
return true;
- } else {
- LOG(WARNING) << "CreateDirectory(" << full_path_str << "), "
- << "conflicts with existing file.";
- return false;
}
+ LOG(WARNING) << "CreateDirectory(" << full_path_str << "), "
+ << "conflicts with existing file.";
+ return false;
}
// Invariant: Path does not exist as file or directory.
diff --git a/base/i18n/char_iterator.h b/base/i18n/char_iterator.h
index 835ac06..f45b04b 100644
--- a/base/i18n/char_iterator.h
+++ b/base/i18n/char_iterator.h
@@ -16,7 +16,7 @@
//
// UTF8CharIterator iter(&str);
// while (!iter.End()) {
-// LOG(INFO) << iter.get();
+// VLOG(1) << iter.get();
// iter.Advance();
// }
diff --git a/base/i18n/word_iterator.h b/base/i18n/word_iterator.h
index b9067c6..b097bc2 100644
--- a/base/i18n/word_iterator.h
+++ b/base/i18n/word_iterator.h
@@ -25,7 +25,7 @@
// while (iter.Advance()) {
// if (iter.IsWord()) {
// // region [iter.prev(),iter.pos()) contains a word.
-// LOG(INFO) << "word: " << iter.GetWord();
+// VLOG(1) << "word: " << iter.GetWord();
// }
// }
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc
index e21ac63..741eb71 100644
--- a/base/message_loop_unittest.cc
+++ b/base/message_loop_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -669,12 +669,12 @@ class OrderedTasks : public Task {
void RunStart() {
TaskItem item(type_, cookie_, true);
- DLOG(INFO) << item;
+ DVLOG(1) << item;
order_->push_back(item);
}
void RunEnd() {
TaskItem item(type_, cookie_, false);
- DLOG(INFO) << item;
+ DVLOG(1) << item;
order_->push_back(item);
}
diff --git a/base/nss_util.cc b/base/nss_util.cc
index b144881..5c7cafd 100644
--- a/base/nss_util.cc
+++ b/base/nss_util.cc
@@ -230,10 +230,10 @@ class NSSInitSingleton {
SECStatus status = NSS_Shutdown();
if (status != SECSuccess) {
- // We LOG(INFO) because this failure is relatively harmless
- // (leaking, but we're shutting down anyway).
- LOG(INFO) << "NSS_Shutdown failed; see "
- "http://code.google.com/p/chromium/issues/detail?id=4609";
+ // We VLOG(1) because this failure is relatively harmless (leaking, but
+ // we're shutting down anyway).
+ VLOG(1) << "NSS_Shutdown failed; see "
+ "http://code.google.com/p/chromium/issues/detail?id=4609";
}
}
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc
index 71c97d3..6b57550 100644
--- a/base/observer_list_unittest.cc
+++ b/base/observer_list_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -126,7 +126,7 @@ class AddRemoveThread : public PlatformThread::Delegate,
count_addtask_++;
if ((Time::Now() - start_).InMilliseconds() > kThreadRunTime) {
- LOG(INFO) << "DONE!";
+ VLOG(1) << "DONE!";
return;
}
diff --git a/base/string_split.cc b/base/string_split.cc
index b6e251f..bc7955d 100644
--- a/base/string_split.cc
+++ b/base/string_split.cc
@@ -67,7 +67,7 @@ bool SplitStringIntoKeyValues(
// Find the key string.
size_t end_key_pos = line.find_first_of(key_value_delimiter);
if (end_key_pos == std::string::npos) {
- DLOG(INFO) << "cannot parse key from line: " << line;
+ DVLOG(1) << "cannot parse key from line: " << line;
return false; // no key
}
key->assign(line, 0, end_key_pos);
@@ -76,7 +76,7 @@ bool SplitStringIntoKeyValues(
std::string remains(line, end_key_pos, line.size() - end_key_pos);
size_t begin_values_pos = remains.find_first_not_of(key_value_delimiter);
if (begin_values_pos == std::string::npos) {
- DLOG(INFO) << "cannot parse value from line: " << line;
+ DVLOG(1) << "cannot parse value from line: " << line;
return false; // no value
}
std::string values_string(remains, begin_values_pos,
diff --git a/base/watchdog.cc b/base/watchdog.cc
index b20d9fa..f9326e1 100644
--- a/base/watchdog.cc
+++ b/base/watchdog.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -74,7 +74,7 @@ void Watchdog::Disarm() {
}
void Watchdog::Alarm() {
- DLOG(INFO) << "Watchdog alarmed for " << thread_watched_name_;
+ DVLOG(1) << "Watchdog alarmed for " << thread_watched_name_;
}
//------------------------------------------------------------------------------
@@ -128,7 +128,7 @@ void Watchdog::ThreadDelegate::ThreadMain() {
void Watchdog::ThreadDelegate::SetThreadName() const {
std::string name = watchdog_->thread_watched_name_ + " Watchdog";
PlatformThread::SetName(name.c_str());
- DLOG(INFO) << "Watchdog active: " << name;
+ DVLOG(1) << "Watchdog active: " << name;
}
// static