summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-18 21:53:00 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-18 21:53:00 +0000
commit89fb65a6f0f1b6981c26c9b9d05a02332f6ec6d7 (patch)
tree5a468222857cf411fec486a7a806a333f4e6cfc2
parent21605478c7a32298c06c29d3f8f59ed42b90c091 (diff)
downloadchromium_src-89fb65a6f0f1b6981c26c9b9d05a02332f6ec6d7.zip
chromium_src-89fb65a6f0f1b6981c26c9b9d05a02332f6ec6d7.tar.gz
chromium_src-89fb65a6f0f1b6981c26c9b9d05a02332f6ec6d7.tar.bz2
** Think this may have caused TabSwitchingTest to fail, as it is parsing log files. **
Revert 62959 - 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/3845002 TBR=pkasting@chromium.org Review URL: http://codereview.chromium.org/3850006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62981 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/metrics/histogram.cc12
-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/tools_sanity_unittest.cc6
-rw-r--r--base/watchdog.cc6
14 files changed, 51 insertions, 45 deletions
diff --git a/base/crypto/symmetric_key_unittest.cc b/base/crypto/symmetric_key_unittest.cc
index 664bcb5..023179d 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) {
- VLOG(1) << "Skipped test vector #" << i;
+ LOG(INFO) << "Skipped test vector #" << i;
continue;
}
#endif // OS_MACOSX
diff --git a/base/debug_util_unittest.cc b/base/debug_util_unittest.cc
index 8d0deab..c3c9cdf 100644
--- a/base/debug_util_unittest.cc
+++ b/base/debug_util_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 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);
- VLOG(1) << os.str();
+ LOG(INFO) << 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 412ca0c..c964412 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) {
- VLOG(1) << "You must be an administrator to run this test on Vista";
+ LOG(INFO) << "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) {
- VLOG(1) << "You must be an administrator to run this test on Vista";
+ LOG(INFO) << "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) {
- VLOG(1) << "You must be an administrator to run this test on Vista";
+ LOG(INFO) << "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 1fcb616..5777e58 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) {
- VLOG(1) << "You must be an administrator to run this test on Vista";
+ LOG(INFO) << "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) {
- VLOG(1) << "You must be an administrator to run this test on Vista";
+ LOG(INFO) << "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) {
- VLOG(1) << "You must be an administrator to run this test on Vista";
+ LOG(INFO) << "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 30d314f..d9f8404 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -561,7 +561,8 @@ bool CreateTemporaryDirInDir(const FilePath& base_dir,
FilePath path_to_create;
srand(static_cast<uint32>(time(NULL)));
- for (int count = 0; count < 50; ++count) {
+ int count = 0;
+ while (count < 50) {
// 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;
@@ -571,13 +572,17 @@ 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)) {
- *new_dir = path_to_create;
- return true;
- }
+ if (::CreateDirectory(path_to_create.value().c_str(), NULL))
+ break;
+ count++;
}
- return false;
+ if (count == 50) {
+ return false;
+ }
+
+ *new_dir = path_to_create;
+ return true;
}
bool CreateNewTempDirectory(const FilePath::StringType& prefix,
@@ -595,13 +600,14 @@ bool CreateDirectory(const FilePath& full_path) {
DWORD fileattr = ::GetFileAttributes(full_path_str);
if (fileattr != INVALID_FILE_ATTRIBUTES) {
if ((fileattr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
- DVLOG(1) << "CreateDirectory(" << full_path_str << "), "
- << "directory already exists.";
+ DLOG(INFO) << "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 f45b04b..835ac06 100644
--- a/base/i18n/char_iterator.h
+++ b/base/i18n/char_iterator.h
@@ -16,7 +16,7 @@
//
// UTF8CharIterator iter(&str);
// while (!iter.End()) {
-// VLOG(1) << iter.get();
+// LOG(INFO) << iter.get();
// iter.Advance();
// }
diff --git a/base/i18n/word_iterator.h b/base/i18n/word_iterator.h
index b097bc2..b9067c6 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.
-// VLOG(1) << "word: " << iter.GetWord();
+// LOG(INFO) << "word: " << iter.GetWord();
// }
// }
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc
index 741eb71..e21ac63 100644
--- a/base/message_loop_unittest.cc
+++ b/base/message_loop_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 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);
- DVLOG(1) << item;
+ DLOG(INFO) << item;
order_->push_back(item);
}
void RunEnd() {
TaskItem item(type_, cookie_, false);
- DVLOG(1) << item;
+ DLOG(INFO) << item;
order_->push_back(item);
}
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index 2123fc8..9746e9c 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -81,7 +81,7 @@ Histogram::~Histogram() {
if (StatisticsRecorder::dump_on_exit()) {
std::string output;
WriteAscii(true, "\n", &output);
- VLOG(1) << output;
+ LOG(INFO) << output;
}
// Just to make sure most derived class did this properly...
@@ -474,8 +474,8 @@ bool Histogram::DeserializeHistogramInfo(const std::string& histogram_info) {
} else if (histogram_type == BOOLEAN_HISTOGRAM) {
render_histogram = BooleanHistogram::FactoryGet(histogram_name, flags);
} else {
- LOG(ERROR) << "Error Deserializing Histogram Unknown histogram_type: "
- << histogram_type;
+ LOG(ERROR) << "Error Deserializing Histogram Unknown histogram_type: " <<
+ histogram_type;
return false;
}
@@ -485,8 +485,8 @@ bool Histogram::DeserializeHistogramInfo(const std::string& histogram_info) {
DCHECK(histogram_type == render_histogram->histogram_type());
if (render_histogram->flags() & kIPCSerializationSourceFlag) {
- DVLOG(1) << "Single process mode, histogram observed and not copied: "
- << histogram_name;
+ DLOG(INFO) << "Single process mode, histogram observed and not copied: " <<
+ histogram_name;
} else {
DCHECK(flags == (flags & render_histogram->flags()));
render_histogram->AddSampleSet(sample);
@@ -814,7 +814,7 @@ StatisticsRecorder::~StatisticsRecorder() {
if (dump_on_exit_) {
std::string output;
WriteGraph("", &output);
- VLOG(1) << output;
+ LOG(INFO) << output;
}
// Clean up.
delete histograms_;
diff --git a/base/nss_util.cc b/base/nss_util.cc
index 5c7cafd..b144881 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 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";
+ // 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";
}
}
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc
index 6b57550..71c97d3 100644
--- a/base/observer_list_unittest.cc
+++ b/base/observer_list_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 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) {
- VLOG(1) << "DONE!";
+ LOG(INFO) << "DONE!";
return;
}
diff --git a/base/string_split.cc b/base/string_split.cc
index bc7955d..b6e251f 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) {
- DVLOG(1) << "cannot parse key from line: " << line;
+ DLOG(INFO) << "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) {
- DVLOG(1) << "cannot parse value from line: " << line;
+ DLOG(INFO) << "cannot parse value from line: " << line;
return false; // no value
}
std::string values_string(remains, begin_values_pos,
diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc
index 0d55eb9..0f21381 100644
--- a/base/tools_sanity_unittest.cc
+++ b/base/tools_sanity_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -36,11 +36,11 @@ void ReadUninitializedValue(char *ptr) {
}
void ReadValueOutOfArrayBoundsLeft(char *ptr) {
- VLOG(1) << "Reading a byte out of bounds: " << ptr[-2];
+ LOG(INFO) << "Reading a byte out of bounds: " << ptr[-2];
}
void ReadValueOutOfArrayBoundsRight(char *ptr, size_t size) {
- VLOG(1) << "Reading a byte out of bounds: " << ptr[size + 1];
+ LOG(INFO) << "Reading a byte out of bounds: " << ptr[size + 1];
}
// This is harmless if you run it under Valgrind thanks to redzones.
diff --git a/base/watchdog.cc b/base/watchdog.cc
index f9326e1..b20d9fa 100644
--- a/base/watchdog.cc
+++ b/base/watchdog.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 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() {
- DVLOG(1) << "Watchdog alarmed for " << thread_watched_name_;
+ DLOG(INFO) << "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());
- DVLOG(1) << "Watchdog active: " << name;
+ DLOG(INFO) << "Watchdog active: " << name;
}
// static