summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-25 02:12:09 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-25 02:12:09 +0000
commitda7d86e75fe4a37ef12f3ae4bd28b043932d2aa0 (patch)
tree5e8bfb0503ab08a672054fa34e04ef7cce3d0d2f
parent6c293a7baba7aa1d998e2680492246f239a7015d (diff)
downloadchromium_src-da7d86e75fe4a37ef12f3ae4bd28b043932d2aa0.zip
chromium_src-da7d86e75fe4a37ef12f3ae4bd28b043932d2aa0.tar.gz
chromium_src-da7d86e75fe4a37ef12f3ae4bd28b043932d2aa0.tar.bz2
Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.
I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107042 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/allocator/allocator_shim.cc2
-rw-r--r--base/allocator/allocator_unittests.cc6
-rw-r--r--base/android/jni_array.cc2
-rw-r--r--base/base_paths_linux.cc8
-rw-r--r--base/command_line.cc8
-rw-r--r--base/debug/debugger.cc4
-rw-r--r--base/debug/trace_event.cc2
-rw-r--r--base/dir_reader_posix_unittest.cc4
-rw-r--r--base/event_recorder_win.cc4
-rw-r--r--base/file_util.cc2
-rw-r--r--base/file_util.h2
-rw-r--r--base/file_util_posix.cc62
-rw-r--r--base/file_util_win.cc28
-rw-r--r--base/files/file_path_watcher_mac.cc14
-rw-r--r--base/files/file_path_watcher_win.cc6
-rw-r--r--base/global_descriptors_posix.cc2
-rw-r--r--base/i18n/icu_util.cc8
-rw-r--r--base/i18n/time_formatting.cc6
-rw-r--r--base/linux_util.cc14
-rw-r--r--base/mac/foundation_util.mm10
-rw-r--r--base/mac/mac_util.mm42
-rw-r--r--base/mac/objc_property_releaser.mm6
-rw-r--r--base/message_loop.cc16
-rw-r--r--base/message_pump_glib.cc5
-rw-r--r--base/message_pump_libevent.cc4
-rw-r--r--base/message_pump_x.cc10
-rw-r--r--base/metrics/histogram.cc12
-rw-r--r--base/metrics/stats_table.cc2
-rw-r--r--base/mime_util_xdg.cc4
-rw-r--r--base/native_library_linux.cc2
-rw-r--r--base/process_linux.cc2
-rw-r--r--base/process_util_linux.cc19
-rw-r--r--base/process_util_mac.mm30
-rw-r--r--base/process_util_openbsd.cc8
-rw-r--r--base/process_util_posix.cc32
-rw-r--r--base/process_util_win.cc4
-rw-r--r--base/rand_util_posix.cc2
-rw-r--r--base/scoped_temp_dir.cc4
-rw-r--r--base/sha1_win.cc16
-rw-r--r--base/shared_memory_posix.cc4
-rw-r--r--base/shared_memory_win.cc2
-rw-r--r--base/sync_socket_posix.cc6
-rw-r--r--base/synchronization/condition_variable_win.cc4
-rw-r--r--base/system_monitor/system_monitor.cc8
-rw-r--r--base/system_monitor/system_monitor_win.cc2
-rw-r--r--base/test/test_file_util_mac.cc10
-rw-r--r--base/test/test_file_util_posix.cc16
-rw-r--r--base/threading/non_thread_safe_unittest.cc2
-rw-r--r--base/threading/platform_thread_mac.mm8
-rw-r--r--base/threading/platform_thread_posix.cc4
-rw-r--r--base/threading/simple_thread.cc2
-rw-r--r--base/threading/thread_checker_unittest.cc2
-rw-r--r--base/threading/thread_local_posix.cc2
-rw-r--r--base/threading/thread_local_win.cc2
-rw-r--r--base/vlog.cc12
-rw-r--r--base/win/i18n.cc2
56 files changed, 254 insertions, 248 deletions
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
index b7973e8..97bbf90 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -297,7 +297,7 @@ void SetupSubprocessAllocator() {
char* secondary_value = secondary_length ? buffer : "TCMALLOC";
// Force renderer (or other subprocesses) to use secondary_value.
int ret_val = _putenv_s(primary_name, secondary_value);
- CHECK_EQ(0, ret_val);
+ DCHECK_EQ(0, ret_val);
}
#endif // ENABLE_DYNAMIC_ALLOCATOR_SWITCHING
}
diff --git a/base/allocator/allocator_unittests.cc b/base/allocator/allocator_unittests.cc
index d935cf9..d6556ce 100644
--- a/base/allocator/allocator_unittests.cc
+++ b/base/allocator/allocator_unittests.cc
@@ -398,16 +398,16 @@ TEST(Allocators, Realloc1) {
for (int s = 0; s < sizeof(start_sizes)/sizeof(*start_sizes); ++s) {
void* p = malloc(start_sizes[s]);
- CHECK(p);
+ ASSERT_TRUE(p);
// The larger the start-size, the larger the non-reallocing delta.
for (int d = 0; d < s*2; ++d) {
void* new_p = realloc(p, start_sizes[s] + deltas[d]);
- CHECK_EQ(p, new_p); // realloc should not allocate new memory
+ ASSERT_EQ(p, new_p); // realloc should not allocate new memory
}
// Test again, but this time reallocing smaller first.
for (int d = 0; d < s*2; ++d) {
void* new_p = realloc(p, start_sizes[s] - deltas[d]);
- CHECK_EQ(p, new_p); // realloc should not allocate new memory
+ ASSERT_EQ(p, new_p); // realloc should not allocate new memory
}
free(p);
}
diff --git a/base/android/jni_array.cc b/base/android/jni_array.cc
index 08cb42e..ae2f185 100644
--- a/base/android/jni_array.cc
+++ b/base/android/jni_array.cc
@@ -17,7 +17,7 @@ jbyteArray ToJavaByteArray(JNIEnv* env,
size_t len) {
jbyteArray byte_array = env->NewByteArray(len);
CheckException(env);
- CHECK(byte_array);
+ DCHECK(byte_array);
jbyte* elements = env->GetByteArrayElements(byte_array, NULL);
memcpy(elements, bytes, len);
diff --git a/base/base_paths_linux.cc b/base/base_paths_linux.cc
index b082eb3..4ce3bd7 100644
--- a/base/base_paths_linux.cc
+++ b/base/base_paths_linux.cc
@@ -83,8 +83,8 @@ bool PathProviderPosix(int key, FilePath* result) {
*result = path;
return true;
} else {
- LOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not "
- << "point to the correct source root directory.";
+ DLOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not "
+ << "point to the correct source root directory.";
}
}
// On POSIX, unit tests execute two levels deep from the source root.
@@ -113,8 +113,8 @@ bool PathProviderPosix(int key, FilePath* result) {
*result = path;
return true;
}
- LOG(ERROR) << "Couldn't find your source root. "
- << "Try running from your chromium/src directory.";
+ DLOG(ERROR) << "Couldn't find your source root. "
+ << "Try running from your chromium/src directory.";
return false;
}
case base::DIR_CACHE:
diff --git a/base/command_line.cc b/base/command_line.cc
index 22977af..0237ffe 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -268,8 +268,8 @@ std::string CommandLine::GetSwitchValueASCII(
const std::string& switch_string) const {
StringType value = GetSwitchValueNative(switch_string);
if (!IsStringASCII(value)) {
- LOG(WARNING) << "Value of switch (" << switch_string << ") must be ASCII.";
- return "";
+ DLOG(WARNING) << "Value of switch (" << switch_string << ") must be ASCII.";
+ return std::string();
}
#if defined(OS_WIN)
return WideToASCII(value);
@@ -394,8 +394,8 @@ void CommandLine::ParseFromString(const std::wstring& command_line) {
wchar_t** args = NULL;
args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args);
- PLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: " <<
- command_line;
+ DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: "
+ << command_line;
InitFromArgv(num_args, args);
LocalFree(args);
}
diff --git a/base/debug/debugger.cc b/base/debug/debugger.cc
index 3777fa1..a0d8a92 100644
--- a/base/debug/debugger.cc
+++ b/base/debug/debugger.cc
@@ -15,8 +15,8 @@ bool WaitForDebugger(int wait_seconds, bool silent) {
#if defined(OS_ANDROID)
// The pid from which we know which process to attach to are not output by
// android ddms, so we have to print it out explicitly.
- LOG(INFO) << "DebugUtil::WaitForDebugger(pid=" << static_cast<int>(getpid())
- << ")";
+ DLOG(INFO) << "DebugUtil::WaitForDebugger(pid=" << static_cast<int>(getpid())
+ << ")";
#endif
for (int i = 0; i < wait_seconds * 10; ++i) {
if (BeingDebugged()) {
diff --git a/base/debug/trace_event.cc b/base/debug/trace_event.cc
index 8b24cca..63f057f 100644
--- a/base/debug/trace_event.cc
+++ b/base/debug/trace_event.cc
@@ -322,7 +322,7 @@ TraceLog::~TraceLog() {
const TraceCategory* TraceLog::GetCategory(const char* name) {
TraceLog* tracelog = GetInstance();
if (!tracelog){
- CHECK(!g_category_already_shutdown->enabled);
+ DCHECK(!g_category_already_shutdown->enabled);
return g_category_already_shutdown;
}
return tracelog->GetCategoryInternal(name);
diff --git a/base/dir_reader_posix_unittest.cc b/base/dir_reader_posix_unittest.cc
index 5aefb9a..a6adfdb 100644
--- a/base/dir_reader_posix_unittest.cc
+++ b/base/dir_reader_posix_unittest.cc
@@ -27,10 +27,10 @@ TEST(DirReaderPosixUnittest, Read) {
char kDirTemplate[] = "/tmp/org.chromium.dir-reader-posix-XXXXXX";
const char* dir = mkdtemp(kDirTemplate);
- CHECK(dir);
+ ASSERT_TRUE(dir);
const int prev_wd = open(".", O_RDONLY | O_DIRECTORY);
- CHECK_GE(prev_wd, 0);
+ DCHECK_GE(prev_wd, 0);
PCHECK(chdir(dir) == 0);
diff --git a/base/event_recorder_win.cc b/base/event_recorder_win.cc
index b2473809..11bf0f0 100644
--- a/base/event_recorder_win.cc
+++ b/base/event_recorder_win.cc
@@ -24,13 +24,13 @@ EventRecorder* EventRecorder::current_ = NULL;
LRESULT CALLBACK StaticRecordWndProc(int nCode, WPARAM wParam,
LPARAM lParam) {
- CHECK(EventRecorder::current());
+ DCHECK(EventRecorder::current());
return EventRecorder::current()->RecordWndProc(nCode, wParam, lParam);
}
LRESULT CALLBACK StaticPlaybackWndProc(int nCode, WPARAM wParam,
LPARAM lParam) {
- CHECK(EventRecorder::current());
+ DCHECK(EventRecorder::current());
return EventRecorder::current()->PlaybackWndProc(nCode, wParam, lParam);
}
diff --git a/base/file_util.cc b/base/file_util.cc
index e9f1d4e..dc186d9 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -342,7 +342,7 @@ bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) {
NULL, NULL);
if (file_ == base::kInvalidPlatformFileValue) {
- LOG(ERROR) << "Couldn't open " << file_name.value();
+ DLOG(ERROR) << "Couldn't open " << file_name.value();
return false;
}
diff --git a/base/file_util.h b/base/file_util.h
index b0c2459..90ec1ae 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -426,7 +426,7 @@ class ScopedFDClose {
inline void operator()(int* x) const {
if (x && *x >= 0) {
if (HANDLE_EINTR(close(*x)) < 0)
- PLOG(ERROR) << "close";
+ DPLOG(ERROR) << "close";
}
}
};
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 8d9fb29..c365869a 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -95,33 +95,33 @@ bool VerifySpecificPathControlledByUser(const FilePath& path,
const std::set<gid_t>& group_gids) {
stat_wrapper_t stat_info;
if (CallLstat(path.value().c_str(), &stat_info) != 0) {
- PLOG(ERROR) << "Failed to get information on path "
- << path.value();
+ DPLOG(ERROR) << "Failed to get information on path "
+ << path.value();
return false;
}
if (S_ISLNK(stat_info.st_mode)) {
- LOG(ERROR) << "Path " << path.value()
+ DLOG(ERROR) << "Path " << path.value()
<< " is a symbolic link.";
return false;
}
if (stat_info.st_uid != owner_uid) {
- LOG(ERROR) << "Path " << path.value()
- << " is owned by the wrong user.";
+ DLOG(ERROR) << "Path " << path.value()
+ << " is owned by the wrong user.";
return false;
}
if ((stat_info.st_mode & S_IWGRP) &&
!ContainsKey(group_gids, stat_info.st_gid)) {
- LOG(ERROR) << "Path " << path.value()
- << " is writable by an unprivileged group.";
+ DLOG(ERROR) << "Path " << path.value()
+ << " is writable by an unprivileged group.";
return false;
}
if (stat_info.st_mode & S_IWOTH) {
- LOG(ERROR) << "Path " << path.value()
- << " is writable by any user.";
+ DLOG(ERROR) << "Path " << path.value()
+ << " is writable by any user.";
return false;
}
@@ -173,7 +173,7 @@ int CountFilesCreatedAfter(const FilePath& path,
stat_wrapper_t st;
int test = CallStat(path.Append(ent->d_name).value().c_str(), &st);
if (test != 0) {
- PLOG(ERROR) << "stat64 failed";
+ DPLOG(ERROR) << "stat64 failed";
continue;
}
// Here, we use Time::TimeT(), which discards microseconds. This
@@ -322,8 +322,8 @@ bool CopyDirectory(const FilePath& from_path,
FileEnumerator::FindInfo info;
FilePath current = from_path;
if (stat(from_path.value().c_str(), &info.stat) < 0) {
- LOG(ERROR) << "CopyDirectory() couldn't stat source directory: " <<
- from_path.value() << " errno = " << errno;
+ DLOG(ERROR) << "CopyDirectory() couldn't stat source directory: "
+ << from_path.value() << " errno = " << errno;
success = false;
}
struct stat to_path_stat;
@@ -353,19 +353,19 @@ bool CopyDirectory(const FilePath& from_path,
if (S_ISDIR(info.stat.st_mode)) {
if (mkdir(target_path.value().c_str(), info.stat.st_mode & 01777) != 0 &&
errno != EEXIST) {
- LOG(ERROR) << "CopyDirectory() couldn't create directory: " <<
- target_path.value() << " errno = " << errno;
+ DLOG(ERROR) << "CopyDirectory() couldn't create directory: "
+ << target_path.value() << " errno = " << errno;
success = false;
}
} else if (S_ISREG(info.stat.st_mode)) {
if (!CopyFile(current, target_path)) {
- LOG(ERROR) << "CopyDirectory() couldn't create file: " <<
- target_path.value();
+ DLOG(ERROR) << "CopyDirectory() couldn't create file: "
+ << target_path.value();
success = false;
}
} else {
- LOG(WARNING) << "CopyDirectory() skipping non-regular file: " <<
- current.value();
+ DLOG(WARNING) << "CopyDirectory() skipping non-regular file: "
+ << current.value();
}
current = traversal.Next();
@@ -511,8 +511,8 @@ static bool CreateTemporaryDirInDirImpl(const FilePath& base_dir,
const FilePath::StringType& name_tmpl,
FilePath* new_dir) {
base::ThreadRestrictions::AssertIOAllowed(); // For call to mkdtemp().
- CHECK(name_tmpl.find("XXXXXX") != FilePath::StringType::npos)
- << "Directory name template must contain \"XXXXXX\".";
+ DCHECK(name_tmpl.find("XXXXXX") != FilePath::StringType::npos)
+ << "Directory name template must contain \"XXXXXX\".";
FilePath sub_dir = base_dir.Append(name_tmpl);
std::string sub_dir_string = sub_dir.value();
@@ -823,8 +823,8 @@ bool FileEnumerator::ReadDirectory(std::vector<DirectoryEntryInfo>* entries,
// Print the stat() error message unless it was ENOENT and we're
// following symlinks.
if (!(errno == ENOENT && !show_links)) {
- PLOG(ERROR) << "Couldn't stat "
- << source.Append(dent->d_name).value();
+ DPLOG(ERROR) << "Couldn't stat "
+ << source.Append(dent->d_name).value();
}
memset(&info.stat, 0, sizeof(info.stat));
}
@@ -849,7 +849,7 @@ bool MemoryMappedFile::MapFileToMemoryInternal() {
struct stat file_stat;
if (fstat(file_, &file_stat) == base::kInvalidPlatformFileValue) {
- LOG(ERROR) << "Couldn't fstat " << file_ << ", errno " << errno;
+ DLOG(ERROR) << "Couldn't fstat " << file_ << ", errno " << errno;
return false;
}
length_ = file_stat.st_size;
@@ -857,7 +857,7 @@ bool MemoryMappedFile::MapFileToMemoryInternal() {
data_ = static_cast<uint8*>(
mmap(NULL, length_, PROT_READ, MAP_SHARED, file_, 0));
if (data_ == MAP_FAILED)
- LOG(ERROR) << "Couldn't mmap " << file_ << ", errno " << errno;
+ DLOG(ERROR) << "Couldn't mmap " << file_ << ", errno " << errno;
return data_ != MAP_FAILED;
}
@@ -927,7 +927,7 @@ FilePath GetHomeDir() {
return FilePath(home_dir);
#if defined(OS_ANDROID)
- LOG(WARNING) << "OS_ANDROID: Home directory lookup not yet implemented.";
+ DLOG(WARNING) << "OS_ANDROID: Home directory lookup not yet implemented.";
#else
// g_get_home_dir calls getpwent, which can fall through to LDAP calls.
base::ThreadRestrictions::AssertIOAllowed();
@@ -998,8 +998,8 @@ bool VerifyPathControlledByUser(const FilePath& base,
uid_t owner_uid,
const std::set<gid_t>& group_gids) {
if (base != path && !base.IsParent(path)) {
- LOG(ERROR) << "|base| must be a subdirectory of |path|. base = \""
- << base.value() << "\", path = \"" << path.value() << "\"";
+ DLOG(ERROR) << "|base| must be a subdirectory of |path|. base = \""
+ << base.value() << "\", path = \"" << path.value() << "\"";
return false;
}
@@ -1015,8 +1015,8 @@ bool VerifyPathControlledByUser(const FilePath& base,
// |base| must be a subpath of |path|, so all components should match.
// If these CHECKs fail, look at the test that base is a parent of
// path at the top of this function.
- CHECK(ip != path_components.end());
- CHECK(*ip == *ib);
+ DCHECK(ip != path_components.end());
+ DCHECK(*ip == *ib);
}
FilePath current_path = base;
@@ -1050,8 +1050,8 @@ bool VerifyPathControlledByAdmin(const FilePath& path) {
for (int i = 0, ie = arraysize(kAdminGroupNames); i < ie; ++i) {
struct group *group_record = getgrnam(kAdminGroupNames[i]);
if (!group_record) {
- PLOG(ERROR) << "Could not get the group ID of group \""
- << kAdminGroupNames[i] << "\".";
+ DPLOG(ERROR) << "Could not get the group ID of group \""
+ << kAdminGroupNames[i] << "\".";
continue;
}
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 19e15fc..8d9fbdef 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -44,7 +44,7 @@ bool DevicePathToDriveLetterPath(const FilePath& device_path,
const int kDriveMappingSize = 1024;
wchar_t drive_mapping[kDriveMappingSize] = {'\0'};
if (!::GetLogicalDriveStrings(kDriveMappingSize - 1, drive_mapping)) {
- LOG(ERROR) << "Failed to get drive mapping.";
+ DLOG(ERROR) << "Failed to get drive mapping.";
return false;
}
@@ -603,13 +603,13 @@ bool CreateTemporaryFileInDir(const FilePath& dir,
wchar_t temp_name[MAX_PATH + 1];
if (!GetTempFileName(dir.value().c_str(), L"", 0, temp_name)) {
- PLOG(WARNING) << "Failed to get temporary file name in " << dir.value();
+ DPLOG(WARNING) << "Failed to get temporary file name in " << dir.value();
return false;
}
DWORD path_len = GetLongPathName(temp_name, temp_name, MAX_PATH);
if (path_len > MAX_PATH + 1 || path_len == 0) {
- PLOG(WARNING) << "Failed to get long path name for " << temp_name;
+ DPLOG(WARNING) << "Failed to get long path name for " << temp_name;
return false;
}
@@ -667,8 +667,8 @@ bool CreateDirectory(const FilePath& full_path) {
<< "directory already exists.";
return true;
}
- LOG(WARNING) << "CreateDirectory(" << full_path_str << "), "
- << "conflicts with existing file.";
+ DLOG(WARNING) << "CreateDirectory(" << full_path_str << "), "
+ << "conflicts with existing file.";
return false;
}
@@ -695,8 +695,8 @@ bool CreateDirectory(const FilePath& full_path) {
// race to create the same directory.
return true;
} else {
- LOG(WARNING) << "Failed to create directory " << full_path_str
- << ", last error is " << error_code << ".";
+ DLOG(WARNING) << "Failed to create directory " << full_path_str
+ << ", last error is " << error_code << ".";
return false;
}
} else {
@@ -773,8 +773,8 @@ int WriteFile(const FilePath& filename, const char* data, int size) {
0,
NULL));
if (!file) {
- LOG(WARNING) << "CreateFile failed for path " << filename.value()
- << " error code=" << GetLastError();
+ DLOG(WARNING) << "CreateFile failed for path " << filename.value()
+ << " error code=" << GetLastError();
return -1;
}
@@ -785,12 +785,12 @@ int WriteFile(const FilePath& filename, const char* data, int size) {
if (!result) {
// WriteFile failed.
- LOG(WARNING) << "writing file " << filename.value()
- << " failed, error code=" << GetLastError();
+ DLOG(WARNING) << "writing file " << filename.value()
+ << " failed, error code=" << GetLastError();
} else {
// Didn't write all the bytes.
- LOG(WARNING) << "wrote" << written << " bytes to " <<
- filename.value() << " expected " << size;
+ DLOG(WARNING) << "wrote" << written << " bytes to "
+ << filename.value() << " expected " << size;
}
return -1;
}
@@ -967,7 +967,7 @@ bool MemoryMappedFile::InitializeAsImageSection(const FilePath& file_name) {
NULL, NULL);
if (file_ == base::kInvalidPlatformFileValue) {
- LOG(ERROR) << "Couldn't open " << file_name.value();
+ DLOG(ERROR) << "Couldn't open " << file_name.value();
return false;
}
diff --git a/base/files/file_path_watcher_mac.cc b/base/files/file_path_watcher_mac.cc
index 3413e8a..07a4dd2 100644
--- a/base/files/file_path_watcher_mac.cc
+++ b/base/files/file_path_watcher_mac.cc
@@ -195,7 +195,7 @@ void FilePathWatcherImpl::CloseFileDescriptor(int *fd) {
}
if (HANDLE_EINTR(close(*fd)) != 0) {
- PLOG(ERROR) << "close";
+ DPLOG(ERROR) << "close";
}
*fd = -1;
}
@@ -203,7 +203,7 @@ void FilePathWatcherImpl::CloseFileDescriptor(int *fd) {
bool FilePathWatcherImpl::AreKeventValuesValid(struct kevent* kevents,
int count) {
if (count < 0) {
- PLOG(ERROR) << "kevent";
+ DPLOG(ERROR) << "kevent";
return false;
}
bool valid = true;
@@ -227,7 +227,7 @@ bool FilePathWatcherImpl::AreKeventValuesValid(struct kevent* kevents,
path_name = base::StringPrintf(
"fd %d", *reinterpret_cast<int*>(&kevents[i].ident));
}
- LOG(ERROR) << "Error: " << kevents[i].data << " for " << path_name;
+ DLOG(ERROR) << "Error: " << kevents[i].data << " for " << path_name;
valid = false;
}
}
@@ -338,8 +338,8 @@ bool FilePathWatcherImpl::UpdateWatches(bool* target_file_affected) {
void FilePathWatcherImpl::OnFileCanReadWithoutBlocking(int fd) {
DCHECK(MessageLoopForIO::current());
- CHECK_EQ(fd, kqueue_);
- CHECK(events_.size());
+ DCHECK_EQ(fd, kqueue_);
+ DCHECK(events_.size());
// Request the file system update notifications that have occurred and return
// them in |updates|. |count| will contain the number of updates that have
@@ -432,12 +432,12 @@ bool FilePathWatcherImpl::Watch(const FilePath& path,
kqueue_ = kqueue();
if (kqueue_ == -1) {
- PLOG(ERROR) << "kqueue";
+ DPLOG(ERROR) << "kqueue";
return false;
}
int last_entry = EventsForPath(target_, &events_);
- CHECK_NE(last_entry, 0);
+ DCHECK_NE(last_entry, 0);
EventVector responses(last_entry);
diff --git a/base/files/file_path_watcher_win.cc b/base/files/file_path_watcher_win.cc
index b87654e..84a5398 100644
--- a/base/files/file_path_watcher_win.cc
+++ b/base/files/file_path_watcher_win.cc
@@ -206,8 +206,8 @@ bool FilePathWatcherImpl::SetupWatchHandle(const FilePath& dir,
error_code != ERROR_SHARING_VIOLATION &&
error_code != ERROR_DIRECTORY) {
using ::operator<<; // Pick the right operator<< below.
- PLOG(ERROR) << "FindFirstChangeNotification failed for "
- << dir.value();
+ DPLOG(ERROR) << "FindFirstChangeNotification failed for "
+ << dir.value();
return false;
}
@@ -241,7 +241,7 @@ bool FilePathWatcherImpl::UpdateWatch() {
child_dirs.push_back(watched_path.BaseName());
FilePath parent(watched_path.DirName());
if (parent == watched_path) {
- LOG(ERROR) << "Reached the root directory";
+ DLOG(ERROR) << "Reached the root directory";
return false;
}
watched_path = parent;
diff --git a/base/global_descriptors_posix.cc b/base/global_descriptors_posix.cc
index 65e7955..d8884a5 100644
--- a/base/global_descriptors_posix.cc
+++ b/base/global_descriptors_posix.cc
@@ -23,7 +23,7 @@ int GlobalDescriptors::Get(Key key) const {
const int ret = MaybeGet(key);
if (ret == -1)
- LOG(FATAL) << "Unknown global descriptor: " << key;
+ DLOG(FATAL) << "Unknown global descriptor: " << key;
return ret;
}
diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
index 4f17f177..e5bbe17 100644
--- a/base/i18n/icu_util.cc
+++ b/base/i18n/icu_util.cc
@@ -68,13 +68,13 @@ bool Initialize() {
HMODULE module = LoadLibrary(data_path.value().c_str());
if (!module) {
- LOG(ERROR) << "Failed to load " << ICU_UTIL_DATA_SHARED_MODULE_NAME;
+ DLOG(ERROR) << "Failed to load " << ICU_UTIL_DATA_SHARED_MODULE_NAME;
return false;
}
FARPROC addr = GetProcAddress(module, ICU_UTIL_DATA_SYMBOL);
if (!addr) {
- LOG(ERROR) << ICU_UTIL_DATA_SYMBOL << ": not found in "
+ DLOG(ERROR) << ICU_UTIL_DATA_SYMBOL << ": not found in "
<< ICU_UTIL_DATA_SHARED_MODULE_NAME;
return false;
}
@@ -113,11 +113,11 @@ bool Initialize() {
FilePath data_path =
base::mac::PathForMainAppBundleResource(CFSTR(ICU_UTIL_DATA_FILE_NAME));
if (data_path.empty()) {
- LOG(ERROR) << ICU_UTIL_DATA_FILE_NAME << " not found in bundle";
+ DLOG(ERROR) << ICU_UTIL_DATA_FILE_NAME << " not found in bundle";
return false;
}
if (!mapped_file.Initialize(data_path)) {
- LOG(ERROR) << "Couldn't mmap " << data_path.value();
+ DLOG(ERROR) << "Couldn't mmap " << data_path.value();
return false;
}
}
diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc
index 419e8db..9906dba 100644
--- a/base/i18n/time_formatting.cc
+++ b/base/i18n/time_formatting.cc
@@ -75,15 +75,15 @@ string16 TimeFormatTimeOfDayWithHourClockType(const Time& time,
UErrorCode status = U_ZERO_ERROR;
scoped_ptr<icu::DateTimePatternGenerator> generator(
icu::DateTimePatternGenerator::createInstance(status));
- CHECK(U_SUCCESS(status));
+ DCHECK(U_SUCCESS(status));
const char* base_pattern = (type == k12HourClock ? "ahm" : "Hm");
icu::UnicodeString generated_pattern =
generator->getBestPattern(icu::UnicodeString(base_pattern), status);
- CHECK(U_SUCCESS(status));
+ DCHECK(U_SUCCESS(status));
// Then, format the time using the generated pattern.
icu::SimpleDateFormat formatter(generated_pattern, status);
- CHECK(U_SUCCESS(status));
+ DCHECK(U_SUCCESS(status));
if (ampm == kKeepAmPm) {
return TimeFormat(&formatter, time);
} else {
diff --git a/base/linux_util.cc b/base/linux_util.cc
index c0757fa..6751469 100644
--- a/base/linux_util.cc
+++ b/base/linux_util.cc
@@ -88,7 +88,7 @@ bool ProcPathGetInode(ino_t* inode_out, const char* path, bool log = false) {
const ssize_t n = readlink(path, buf, sizeof(buf) - 1);
if (n == -1) {
if (log) {
- LOG(WARNING) << "Failed to read the inode number for a socket from /proc"
+ DLOG(WARNING) << "Failed to read the inode number for a socket from /proc"
"(" << errno << ")";
}
return false;
@@ -97,8 +97,8 @@ bool ProcPathGetInode(ino_t* inode_out, const char* path, bool log = false) {
if (memcmp(kSocketLinkPrefix, buf, sizeof(kSocketLinkPrefix) - 1)) {
if (log) {
- LOG(WARNING) << "The descriptor passed from the crashing process wasn't a"
- " UNIX domain socket.";
+ DLOG(WARNING) << "The descriptor passed from the crashing process wasn't "
+ " a UNIX domain socket.";
}
return false;
}
@@ -111,8 +111,8 @@ bool ProcPathGetInode(ino_t* inode_out, const char* path, bool log = false) {
if (inode_ul == ULLONG_MAX) {
if (log) {
- LOG(WARNING) << "Failed to parse a socket's inode number: the number was "
- "too large. Please report this bug: " << buf;
+ DLOG(WARNING) << "Failed to parse a socket's inode number: the number "
+ "was too large. Please report this bug: " << buf;
}
return false;
}
@@ -201,7 +201,7 @@ bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode) {
DIR* proc = opendir("/proc");
if (!proc) {
- LOG(WARNING) << "Cannot open /proc";
+ DLOG(WARNING) << "Cannot open /proc";
return false;
}
@@ -263,7 +263,7 @@ pid_t FindThreadIDWithSyscall(pid_t pid, const std::string& expected_data,
DIR* task = opendir(buf);
if (!task) {
- LOG(WARNING) << "Cannot open " << buf;
+ DLOG(WARNING) << "Cannot open " << buf;
return -1;
}
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index 37b001b..8a4ce47 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -28,7 +28,7 @@ static bool UncachedAmIBundled() {
FSRef fsref;
OSStatus pbErr;
if ((pbErr = GetProcessBundleLocation(&psn, &fsref)) != noErr) {
- LOG(ERROR) << "GetProcessBundleLocation failed: error " << pbErr;
+ DLOG(ERROR) << "GetProcessBundleLocation failed: error " << pbErr;
return false;
}
@@ -36,7 +36,7 @@ static bool UncachedAmIBundled() {
OSErr fsErr;
if ((fsErr = FSGetCatalogInfo(&fsref, kFSCatInfoNodeFlags, &info,
NULL, NULL, NULL)) != noErr) {
- LOG(ERROR) << "FSGetCatalogInfo failed: error " << fsErr;
+ DLOG(ERROR) << "FSGetCatalogInfo failed: error " << fsErr;
return false;
}
@@ -102,7 +102,7 @@ void SetOverrideAppBundle(NSBundle* bundle) {
void SetOverrideAppBundlePath(const FilePath& file_path) {
NSString* path = base::SysUTF8ToNSString(file_path.value());
NSBundle* bundle = [NSBundle bundleWithPath:path];
- CHECK(bundle) << "Failed to load the bundle at " << file_path.value();
+ DCHECK(bundle) << "Failed to load the bundle at " << file_path.value();
SetOverrideAppBundle(bundle);
}
@@ -146,7 +146,7 @@ bool GetUserDirectory(NSSearchPathDirectory directory, FilePath* result) {
FilePath GetUserLibraryPath() {
FilePath user_library_path;
if (!GetUserDirectory(NSLibraryDirectory, &user_library_path)) {
- LOG(WARNING) << "Could not get user library path";
+ DLOG(WARNING) << "Could not get user library path";
}
return user_library_path;
}
@@ -212,7 +212,7 @@ CFTypeRef GetValueFromDictionary(CFDictionaryRef dict,
CFCopyTypeIDDescription(expected_type));
ScopedCFTypeRef<CFStringRef> actual_type_ref(
CFCopyTypeIDDescription(CFGetTypeID(value)));
- LOG(WARNING) << "Expected value for key "
+ DLOG(WARNING) << "Expected value for key "
<< base::SysCFStringRefToUTF8(key)
<< " to be "
<< base::SysCFStringRefToUTF8(expected_type_ref)
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index 57e07a6..66fbf11 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -64,7 +64,7 @@ LSSharedFileListItemRef GetLoginItemForApp() {
NULL, kLSSharedFileListSessionLoginItems, NULL));
if (!login_items.get()) {
- LOG(ERROR) << "Couldn't get a Login Items list.";
+ DLOG(ERROR) << "Couldn't get a Login Items list.";
return NULL;
}
@@ -126,7 +126,7 @@ CGColorSpaceRef GetSRGBColorSpace() {
// Leaked. That's OK, it's scoped to the lifetime of the application.
static CGColorSpaceRef g_color_space_sRGB =
CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
- LOG_IF(ERROR, !g_color_space_sRGB) << "Couldn't get the sRGB color space";
+ DLOG_IF(ERROR, !g_color_space_sRGB) << "Couldn't get the sRGB color space";
return g_color_space_sRGB;
}
@@ -141,10 +141,10 @@ CGColorSpaceRef GetSystemColorSpace() {
g_system_color_space = CGColorSpaceCreateDeviceRGB();
if (g_system_color_space) {
- LOG(WARNING) <<
+ DLOG(WARNING) <<
"Couldn't get the main display's color space, using generic";
} else {
- LOG(ERROR) << "Couldn't get any color space";
+ DLOG(ERROR) << "Couldn't get any color space";
}
}
@@ -216,7 +216,7 @@ void ActivateProcess(pid_t pid) {
if (status == noErr) {
SetFrontProcess(&process);
} else {
- LOG(WARNING) << "Unable to get process for pid " << pid;
+ DLOG(WARNING) << "Unable to get process for pid " << pid;
}
}
@@ -224,7 +224,7 @@ bool AmIForeground() {
ProcessSerialNumber foreground_psn = { 0 };
OSErr err = GetFrontProcess(&foreground_psn);
if (err != noErr) {
- LOG(WARNING) << "GetFrontProcess: " << err;
+ DLOG(WARNING) << "GetFrontProcess: " << err;
return false;
}
@@ -233,7 +233,7 @@ bool AmIForeground() {
Boolean result = FALSE;
err = SameProcess(&foreground_psn, &my_psn, &result);
if (err != noErr) {
- LOG(WARNING) << "SameProcess: " << err;
+ DLOG(WARNING) << "SameProcess: " << err;
return false;
}
@@ -254,7 +254,7 @@ bool SetFileBackupExclusion(const FilePath& file_path) {
OSStatus os_err =
CSBackupSetItemExcluded(base::mac::NSToCFCast(file_url), TRUE, FALSE);
if (os_err != noErr) {
- LOG(WARNING) << "Failed to set backup exclusion for file '"
+ DLOG(WARNING) << "Failed to set backup exclusion for file '"
<< file_path.value().c_str() << "' with error "
<< os_err << " (" << GetMacOSStatusErrorString(os_err)
<< ": " << GetMacOSStatusCommentString(os_err)
@@ -300,7 +300,7 @@ void SetProcessName(CFStringRef process_name) {
CFBundleRef launch_services_bundle =
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.LaunchServices"));
if (!launch_services_bundle) {
- LOG(ERROR) << "Failed to look up LaunchServices bundle";
+ DLOG(ERROR) << "Failed to look up LaunchServices bundle";
return;
}
@@ -309,7 +309,7 @@ void SetProcessName(CFStringRef process_name) {
CFBundleGetFunctionPointerForName(
launch_services_bundle, CFSTR("_LSGetCurrentApplicationASN")));
if (!ls_get_current_application_asn_func)
- LOG(ERROR) << "Could not find _LSGetCurrentApplicationASN";
+ DLOG(ERROR) << "Could not find _LSGetCurrentApplicationASN";
ls_set_application_information_item_func =
reinterpret_cast<LSSetApplicationInformationItemType>(
@@ -317,14 +317,14 @@ void SetProcessName(CFStringRef process_name) {
launch_services_bundle,
CFSTR("_LSSetApplicationInformationItem")));
if (!ls_set_application_information_item_func)
- LOG(ERROR) << "Could not find _LSSetApplicationInformationItem";
+ DLOG(ERROR) << "Could not find _LSSetApplicationInformationItem";
CFStringRef* key_pointer = reinterpret_cast<CFStringRef*>(
CFBundleGetDataPointerForName(launch_services_bundle,
CFSTR("_kLSDisplayNameKey")));
ls_display_name_key = key_pointer ? *key_pointer : NULL;
if (!ls_display_name_key)
- LOG(ERROR) << "Could not find _kLSDisplayNameKey";
+ DLOG(ERROR) << "Could not find _kLSDisplayNameKey";
// Internally, this call relies on the Mach ports that are started up by the
// Carbon Process Manager. In debug builds this usually happens due to how
@@ -349,7 +349,7 @@ void SetProcessName(CFStringRef process_name) {
ls_display_name_key,
process_name,
NULL /* optional out param */);
- LOG_IF(ERROR, err) << "Call to set process name failed, err " << err;
+ DLOG_IF(ERROR, err) << "Call to set process name failed, err " << err;
}
// Converts a NSImage to a CGImageRef. Normally, the system frameworks can do
@@ -406,7 +406,7 @@ void AddToLoginItems(bool hide_on_startup) {
NULL, kLSSharedFileListSessionLoginItems, NULL));
if (!login_items.get()) {
- LOG(ERROR) << "Couldn't get a Login Items list.";
+ DLOG(ERROR) << "Couldn't get a Login Items list.";
return;
}
@@ -430,7 +430,7 @@ void AddToLoginItems(bool hide_on_startup) {
reinterpret_cast<CFDictionaryRef>(properties), NULL));
if (!new_item.get()) {
- LOG(ERROR) << "Couldn't insert current app into Login Items list.";
+ DLOG(ERROR) << "Couldn't insert current app into Login Items list.";
}
}
@@ -443,7 +443,7 @@ void RemoveFromLoginItems() {
NULL, kLSSharedFileListSessionLoginItems, NULL));
if (!login_items.get()) {
- LOG(ERROR) << "Couldn't get a Login Items list.";
+ DLOG(ERROR) << "Couldn't get a Login Items list.";
return;
}
@@ -481,7 +481,7 @@ bool WasLaunchedAsHiddenLoginItem() {
// Lion can launch items for the resume feature. So log an error only for
// Snow Leopard or earlier.
if (IsOSSnowLeopardOrEarlier())
- LOG(ERROR) <<
+ DLOG(ERROR) <<
"Process launched at Login but can't access Login Item List.";
return false;
@@ -509,12 +509,12 @@ int DarwinMajorVersionInternal() {
struct utsname uname_info;
if (uname(&uname_info) != 0) {
- PLOG(ERROR) << "uname";
+ DPLOG(ERROR) << "uname";
return 0;
}
if (strcmp(uname_info.sysname, "Darwin") != 0) {
- LOG(ERROR) << "unexpected uname sysname " << uname_info.sysname;
+ DLOG(ERROR) << "unexpected uname sysname " << uname_info.sysname;
return 0;
}
@@ -527,7 +527,7 @@ int DarwinMajorVersionInternal() {
}
if (!dot) {
- LOG(ERROR) << "could not parse uname release " << uname_info.release;
+ DLOG(ERROR) << "could not parse uname release " << uname_info.release;
return 0;
}
@@ -548,7 +548,7 @@ int MacOSXMinorVersionInternal() {
// immediate death.
CHECK(darwin_major_version >= 6);
int mac_os_x_minor_version = darwin_major_version - 4;
- LOG_IF(WARNING, darwin_major_version > 11) << "Assuming Darwin "
+ DLOG_IF(WARNING, darwin_major_version > 11) << "Assuming Darwin "
<< base::IntToString(darwin_major_version) << " is Mac OS X 10."
<< base::IntToString(mac_os_x_minor_version);
diff --git a/base/mac/objc_property_releaser.mm b/base/mac/objc_property_releaser.mm
index bd7a750..f7ee88f 100644
--- a/base/mac/objc_property_releaser.mm
+++ b/base/mac/objc_property_releaser.mm
@@ -98,8 +98,8 @@ void ObjCPropertyReleaser::Init(id object, Class classy) {
}
void ObjCPropertyReleaser::ReleaseProperties() {
- CHECK(object_);
- CHECK(class_);
+ DCHECK(object_);
+ DCHECK(class_);
unsigned int property_count = 0;
objc_property_t* properties = class_copyPropertyList(class_, &property_count);
@@ -114,7 +114,7 @@ void ObjCPropertyReleaser::ReleaseProperties() {
Ivar instance_variable =
object_getInstanceVariable(object_, instance_name.c_str(),
(void**)&instance_value);
- CHECK(instance_variable);
+ DCHECK(instance_variable);
[instance_value release];
}
}
diff --git a/base/message_loop.cc b/base/message_loop.cc
index 593c03c9..553efb1 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -258,7 +258,7 @@ void MessageLoop::RemoveDestructionObserver(
void MessageLoop::PostTask(
const tracked_objects::Location& from_here, Task* task) {
- CHECK(task);
+ DCHECK(task);
PendingTask pending_task(
base::Bind(
&base::subtle::TaskClosureAdapter::Run,
@@ -270,7 +270,7 @@ void MessageLoop::PostTask(
void MessageLoop::PostDelayedTask(
const tracked_objects::Location& from_here, Task* task, int64 delay_ms) {
- CHECK(task);
+ DCHECK(task);
PendingTask pending_task(
base::Bind(
&base::subtle::TaskClosureAdapter::Run,
@@ -282,7 +282,7 @@ void MessageLoop::PostDelayedTask(
void MessageLoop::PostNonNestableTask(
const tracked_objects::Location& from_here, Task* task) {
- CHECK(task);
+ DCHECK(task);
PendingTask pending_task(
base::Bind(
&base::subtle::TaskClosureAdapter::Run,
@@ -294,7 +294,7 @@ void MessageLoop::PostNonNestableTask(
void MessageLoop::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here, Task* task, int64 delay_ms) {
- CHECK(task);
+ DCHECK(task);
PendingTask pending_task(
base::Bind(
&base::subtle::TaskClosureAdapter::Run,
@@ -306,7 +306,7 @@ void MessageLoop::PostNonNestableDelayedTask(
void MessageLoop::PostTask(
const tracked_objects::Location& from_here, const base::Closure& task) {
- CHECK(!task.is_null()) << from_here.ToString();
+ DCHECK(!task.is_null()) << from_here.ToString();
PendingTask pending_task(task, from_here, CalculateDelayedRuntime(0), true);
AddToIncomingQueue(&pending_task);
}
@@ -314,7 +314,7 @@ void MessageLoop::PostTask(
void MessageLoop::PostDelayedTask(
const tracked_objects::Location& from_here, const base::Closure& task,
int64 delay_ms) {
- CHECK(!task.is_null()) << from_here.ToString();
+ DCHECK(!task.is_null()) << from_here.ToString();
PendingTask pending_task(task, from_here,
CalculateDelayedRuntime(delay_ms), true);
AddToIncomingQueue(&pending_task);
@@ -322,7 +322,7 @@ void MessageLoop::PostDelayedTask(
void MessageLoop::PostNonNestableTask(
const tracked_objects::Location& from_here, const base::Closure& task) {
- CHECK(!task.is_null()) << from_here.ToString();
+ DCHECK(!task.is_null()) << from_here.ToString();
PendingTask pending_task(task, from_here, CalculateDelayedRuntime(0), false);
AddToIncomingQueue(&pending_task);
}
@@ -330,7 +330,7 @@ void MessageLoop::PostNonNestableTask(
void MessageLoop::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here, const base::Closure& task,
int64 delay_ms) {
- CHECK(!task.is_null()) << from_here.ToString();
+ DCHECK(!task.is_null()) << from_here.ToString();
PendingTask pending_task(task, from_here,
CalculateDelayedRuntime(delay_ms), false);
AddToIncomingQueue(&pending_task);
diff --git a/base/message_pump_glib.cc b/base/message_pump_glib.cc
index 20fc8ea9..19a0eea 100644
--- a/base/message_pump_glib.cc
+++ b/base/message_pump_glib.cc
@@ -145,7 +145,10 @@ MessagePumpGlib::MessagePumpGlib()
wakeup_gpollfd_(new GPollFD) {
// Create our wakeup pipe, which is used to flag when work was scheduled.
int fds[2];
- CHECK_EQ(pipe(fds), 0);
+ int ret = pipe(fds);
+ DCHECK_EQ(ret, 0);
+ (void)ret; // Prevent warning in release mode.
+
wakeup_pipe_read_ = fds[0];
wakeup_pipe_write_ = fds[1];
wakeup_gpollfd_->fd = wakeup_pipe_read_;
diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc
index 1b4c023..9bef229 100644
--- a/base/message_pump_libevent.cc
+++ b/base/message_pump_libevent.cc
@@ -129,11 +129,11 @@ MessagePumpLibevent::~MessagePumpLibevent() {
delete wakeup_event_;
if (wakeup_pipe_in_ >= 0) {
if (HANDLE_EINTR(close(wakeup_pipe_in_)) < 0)
- PLOG(ERROR) << "close";
+ DPLOG(ERROR) << "close";
}
if (wakeup_pipe_out_ >= 0) {
if (HANDLE_EINTR(close(wakeup_pipe_out_)) < 0)
- PLOG(ERROR) << "close";
+ DPLOG(ERROR) << "close";
}
event_base_free(event_base_);
}
diff --git a/base/message_pump_x.cc b/base/message_pump_x.cc
index a9b1b8a..15276e4 100644
--- a/base/message_pump_x.cc
+++ b/base/message_pump_x.cc
@@ -66,7 +66,7 @@ void InitializeXInput2(void) {
int event, err;
if (!XQueryExtension(display, "XInputExtension", &xiopcode, &event, &err)) {
- VLOG(1) << "X Input extension not available.";
+ DVLOG(1) << "X Input extension not available.";
xiopcode = -1;
return;
}
@@ -78,13 +78,13 @@ void InitializeXInput2(void) {
int major = 2, minor = 0;
#endif
if (XIQueryVersion(display, &major, &minor) == BadRequest) {
- VLOG(1) << "XInput2 not supported in the server.";
+ DVLOG(1) << "XInput2 not supported in the server.";
xiopcode = -1;
return;
}
#if defined(USE_XI2_MT)
if (major < 2 || (major == 2 && minor < USE_XI2_MT)) {
- VLOG(1) << "XI version on server is " << major << "." << minor << ". "
+ DVLOG(1) << "XI version on server is " << major << "." << minor << ". "
<< "But 2." << USE_XI2_MT << " is required.";
xiopcode = -1;
return;
@@ -148,7 +148,7 @@ void MessagePumpX::InitXSource() {
DCHECK(!x_source_);
GPollFD* x_poll = new GPollFD();
Display* display = GetDefaultXDisplay();
- CHECK(display) << "Unable to get connection to X server";
+ DCHECK(display) << "Unable to get connection to X server";
x_poll->fd = ConnectionNumber(display);
x_poll->events = G_IO_IN;
@@ -186,7 +186,7 @@ bool MessagePumpX::ProcessXEvent(XEvent* xev) {
should_quit = true;
Quit();
} else if (status == MessagePumpDispatcher::EVENT_IGNORED) {
- VLOG(1) << "Event (" << xev->type << ") not handled.";
+ DVLOG(1) << "Event (" << xev->type << ") not handled.";
}
DidProcessXEvent(xev);
}
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index 484d095..7077b09 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -268,7 +268,7 @@ bool Histogram::DeserializeHistogramInfo(const std::string& histogram_info) {
!pickle.ReadInt(&iter, &histogram_type) ||
!pickle.ReadInt(&iter, &pickle_flags) ||
!sample.Histogram::SampleSet::Deserialize(&iter, pickle)) {
- LOG(ERROR) << "Pickle error decoding Histogram: " << histogram_name;
+ DLOG(ERROR) << "Pickle error decoding Histogram: " << histogram_name;
return false;
}
DCHECK(pickle_flags & kIPCSerializationSourceFlag);
@@ -276,7 +276,7 @@ bool Histogram::DeserializeHistogramInfo(const std::string& histogram_info) {
// checks above and beyond those in Histogram::Initialize()
if (declared_max <= 0 || declared_min <= 0 || declared_max < declared_min ||
INT_MAX / sizeof(Count) <= bucket_count || bucket_count < 2) {
- LOG(ERROR) << "Values error decoding Histogram: " << histogram_name;
+ DLOG(ERROR) << "Values error decoding Histogram: " << histogram_name;
return false;
}
@@ -295,8 +295,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;
+ DLOG(ERROR) << "Error Deserializing Histogram Unknown histogram_type: "
+ << histogram_type;
return false;
}
@@ -433,7 +433,7 @@ Histogram::~Histogram() {
if (StatisticsRecorder::dump_on_exit()) {
std::string output;
WriteAscii(true, "\n", &output);
- LOG(INFO) << output;
+ DLOG(INFO) << output;
}
// Just to make sure most derived class did this properly...
@@ -1025,7 +1025,7 @@ StatisticsRecorder::~StatisticsRecorder() {
if (dump_on_exit_) {
std::string output;
WriteGraph("", &output);
- LOG(INFO) << output;
+ DLOG(INFO) << output;
}
// Clean up.
HistogramMap* histograms = NULL;
diff --git a/base/metrics/stats_table.cc b/base/metrics/stats_table.cc
index 3db008e..2bccc90 100644
--- a/base/metrics/stats_table.cc
+++ b/base/metrics/stats_table.cc
@@ -265,7 +265,7 @@ StatsTable::StatsTable(const std::string& name, int max_threads,
impl_ = Private::New(name, table_size, max_threads, max_counters);
if (!impl_)
- PLOG(ERROR) << "StatsTable did not initialize";
+ DPLOG(ERROR) << "StatsTable did not initialize";
}
StatsTable::~StatsTable() {
diff --git a/base/mime_util_xdg.cc b/base/mime_util_xdg.cc
index a25a0d5..294638d 100644
--- a/base/mime_util_xdg.cc
+++ b/base/mime_util_xdg.cc
@@ -371,7 +371,7 @@ bool IconTheme::SetDirectories(const std::string& dirs) {
while ((epos = dirs.find(',', pos)) != std::string::npos) {
TrimWhitespaceASCII(dirs.substr(pos, epos - pos), TRIM_ALL, &dir);
if (dir.length() == 0) {
- LOG(WARNING) << "Invalid index.theme: blank subdir";
+ DLOG(WARNING) << "Invalid index.theme: blank subdir";
return false;
}
subdirs_[dir] = num++;
@@ -379,7 +379,7 @@ bool IconTheme::SetDirectories(const std::string& dirs) {
}
TrimWhitespaceASCII(dirs.substr(pos), TRIM_ALL, &dir);
if (dir.length() == 0) {
- LOG(WARNING) << "Invalid index.theme: blank subdir";
+ DLOG(WARNING) << "Invalid index.theme: blank subdir";
return false;
}
subdirs_[dir] = num++;
diff --git a/base/native_library_linux.cc b/base/native_library_linux.cc
index bcc4ffb..4b82ff4 100644
--- a/base/native_library_linux.cc
+++ b/base/native_library_linux.cc
@@ -34,7 +34,7 @@ NativeLibrary LoadNativeLibrary(const FilePath& library_path,
void UnloadNativeLibrary(NativeLibrary library) {
int ret = dlclose(library);
if (ret < 0) {
- LOG(ERROR) << "dlclose failed: " << dlerror();
+ DLOG(ERROR) << "dlclose failed: " << dlerror();
NOTREACHED();
}
}
diff --git a/base/process_linux.cc b/base/process_linux.cc
index dfdc20e..3f78a31 100644
--- a/base/process_linux.cc
+++ b/base/process_linux.cc
@@ -113,7 +113,7 @@ bool Process::SetProcessBackgrounded(bool background) {
setpriority(
PRIO_PROCESS, process_, current_priority + kPriorityAdjustment);
if (result == -1) {
- LOG(ERROR) << "Failed to lower priority, errno: " << errno;
+ DLOG(ERROR) << "Failed to lower priority, errno: " << errno;
return false;
}
saved_priority_ = current_priority;
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index f9d151b..2f433d9 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -84,7 +84,7 @@ int GetProcessCPU(pid_t pid) {
DIR* dir = opendir(path.value().c_str());
if (!dir) {
- PLOG(ERROR) << "opendir(" << path.value() << ")";
+ DPLOG(ERROR) << "opendir(" << path.value() << ")";
return -1;
}
@@ -273,7 +273,7 @@ ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) {
size_t ProcessMetrics::GetPagefileUsage() const {
std::vector<std::string> proc_stats;
if (!GetProcStats(process_, &proc_stats))
- LOG(WARNING) << "Failed to get process stats.";
+ DLOG(WARNING) << "Failed to get process stats.";
const size_t kVmSize = 22;
if (proc_stats.size() > kVmSize) {
int vm_size;
@@ -287,7 +287,7 @@ size_t ProcessMetrics::GetPagefileUsage() const {
size_t ProcessMetrics::GetPeakPagefileUsage() const {
std::vector<std::string> proc_stats;
if (!GetProcStats(process_, &proc_stats))
- LOG(WARNING) << "Failed to get process stats.";
+ DLOG(WARNING) << "Failed to get process stats.";
const size_t kVmPeak = 21;
if (proc_stats.size() > kVmPeak) {
int vm_peak;
@@ -301,7 +301,7 @@ size_t ProcessMetrics::GetPeakPagefileUsage() const {
size_t ProcessMetrics::GetWorkingSetSize() const {
std::vector<std::string> proc_stats;
if (!GetProcStats(process_, &proc_stats))
- LOG(WARNING) << "Failed to get process stats.";
+ DLOG(WARNING) << "Failed to get process stats.";
const size_t kVmRss = 23;
if (proc_stats.size() > kVmRss) {
int num_pages;
@@ -315,7 +315,7 @@ size_t ProcessMetrics::GetWorkingSetSize() const {
size_t ProcessMetrics::GetPeakWorkingSetSize() const {
std::vector<std::string> proc_stats;
if (!GetProcStats(process_, &proc_stats))
- LOG(WARNING) << "Failed to get process stats.";
+ DLOG(WARNING) << "Failed to get process stats.";
const size_t kVmHwm = 23;
if (proc_stats.size() > kVmHwm) {
int num_pages;
@@ -576,14 +576,14 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
FilePath meminfo_file("/proc/meminfo");
std::string meminfo_data;
if (!file_util::ReadFileToString(meminfo_file, &meminfo_data)) {
- LOG(WARNING) << "Failed to open /proc/meminfo.";
+ DLOG(WARNING) << "Failed to open /proc/meminfo.";
return false;
}
std::vector<std::string> meminfo_fields;
SplitStringAlongWhitespace(meminfo_data, &meminfo_fields);
if (meminfo_fields.size() < kMemCachedIndex) {
- LOG(WARNING) << "Failed to parse /proc/meminfo. Only found " <<
+ DLOG(WARNING) << "Failed to parse /proc/meminfo. Only found " <<
meminfo_fields.size() << " fields.";
return false;
}
@@ -752,7 +752,8 @@ bool AdjustOOMScore(ProcessId process, int score) {
FilePath oom_file = oom_path.AppendASCII("oom_score_adj");
if (file_util::PathExists(oom_file)) {
std::string score_str = base::IntToString(score);
- VLOG(1) << "Adjusting oom_score_adj of " << process << " to " << score_str;
+ DVLOG(1) << "Adjusting oom_score_adj of " << process << " to "
+ << score_str;
int score_len = static_cast<int>(score_str.length());
return (score_len == file_util::WriteFile(oom_file,
score_str.c_str(),
@@ -765,7 +766,7 @@ bool AdjustOOMScore(ProcessId process, int score) {
if (file_util::PathExists(oom_file)) {
std::string score_str = base::IntToString(
score * kMaxOldOomScore / kMaxOomScore);
- VLOG(1) << "Adjusting oom_adj of " << process << " to " << score_str;
+ DVLOG(1) << "Adjusting oom_adj of " << process << " to " << score_str;
int score_len = static_cast<int>(score_str.length());
return (score_len == file_util::WriteFile(oom_file,
score_str.c_str(),
diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm
index e364d1b..38203d8 100644
--- a/base/process_util_mac.mm
+++ b/base/process_util_mac.mm
@@ -75,7 +75,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* filter)
// Get the size of the buffer
size_t len = 0;
if (sysctl(mib, arraysize(mib), NULL, &len, NULL, 0) < 0) {
- LOG(ERROR) << "failed to get the size needed for the process list";
+ DLOG(ERROR) << "failed to get the size needed for the process list";
kinfo_procs_.resize(0);
done = true;
} else {
@@ -90,7 +90,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* filter)
// If we get a mem error, it just means we need a bigger buffer, so
// loop around again. Anything else is a real error and give up.
if (errno != ENOMEM) {
- LOG(ERROR) << "failed to get the process list";
+ DLOG(ERROR) << "failed to get the process list";
kinfo_procs_.resize(0);
done = true;
}
@@ -104,7 +104,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* filter)
} while (!done && (try_num++ < max_tries));
if (!done) {
- LOG(ERROR) << "failed to collect the process list in a few tries";
+ DLOG(ERROR) << "failed to collect the process list in a few tries";
kinfo_procs_.resize(0);
}
}
@@ -149,7 +149,7 @@ bool ProcessIterator::CheckForNextProcess() {
// to populate |entry_.exe_file_|.
size_t exec_name_end = data.find('\0');
if (exec_name_end == std::string::npos) {
- LOG(ERROR) << "command line data didn't match expected format";
+ DLOG(ERROR) << "command line data didn't match expected format";
continue;
}
@@ -248,7 +248,7 @@ static bool GetCPUTypeForProcess(pid_t pid, cpu_type_t* cpu_type) {
NULL,
0);
if (result != 0) {
- PLOG(ERROR) << "sysctlbyname(""sysctl.proc_cputype"")";
+ DPLOG(ERROR) << "sysctlbyname(""sysctl.proc_cputype"")";
return false;
}
@@ -280,7 +280,7 @@ bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes,
mach_port_t task = TaskForPid(process_);
if (task == MACH_PORT_NULL) {
- LOG(ERROR) << "Invalid process";
+ DLOG(ERROR) << "Invalid process";
return false;
}
@@ -319,7 +319,7 @@ bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes,
// We're at the end of the address space.
break;
} else if (kr != KERN_SUCCESS) {
- LOG(ERROR) << "Calling mach_vm_region failed with error: "
+ DLOG(ERROR) << "Calling mach_vm_region failed with error: "
<< mach_error_string(kr);
return false;
}
@@ -354,7 +354,7 @@ bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes,
vm_size_t page_size;
kr = host_page_size(task, &page_size);
if (kr != KERN_SUCCESS) {
- LOG(ERROR) << "Failed to fetch host page size, error: "
+ DLOG(ERROR) << "Failed to fetch host page size, error: "
<< mach_error_string(kr);
return false;
}
@@ -472,14 +472,14 @@ size_t GetSystemCommitCharge() {
reinterpret_cast<host_info_t>(&data),
&count);
if (kr) {
- LOG(WARNING) << "Failed to fetch host statistics.";
+ DLOG(WARNING) << "Failed to fetch host statistics.";
return 0;
}
vm_size_t page_size;
kr = host_page_size(host, &page_size);
if (kr) {
- LOG(ERROR) << "Failed to fetch host page size.";
+ DLOG(ERROR) << "Failed to fetch host page size.";
return 0;
}
@@ -497,7 +497,7 @@ const char* LookUpLibCPath() {
if (dladdr(addr, &info))
return info.dli_fname;
- LOG(WARNING) << "Could not find image path for malloc()";
+ DLOG(WARNING) << "Could not find image path for malloc()";
return NULL;
}
@@ -545,7 +545,7 @@ malloc_error_break_t LookUpMallocErrorBreak() {
void CrMallocErrorBreak() {
g_original_malloc_error_break();
- LOG(ERROR) <<
+ DLOG(ERROR) <<
"Terminating process due to a potential for future heap corruption";
int* death_ptr = NULL;
*death_ptr = 0xf00bad;
@@ -556,7 +556,7 @@ void CrMallocErrorBreak() {
void EnableTerminationOnHeapCorruption() {
malloc_error_break_t malloc_error_break = LookUpMallocErrorBreak();
if (!malloc_error_break) {
- LOG(WARNING) << "Could not find malloc_error_break";
+ DLOG(WARNING) << "Could not find malloc_error_break";
return;
}
@@ -566,7 +566,7 @@ void EnableTerminationOnHeapCorruption() {
(void**)&g_original_malloc_error_break);
if (err != err_none)
- LOG(WARNING) << "Could not override malloc_error_break; error = " << err;
+ DLOG(WARNING) << "Could not override malloc_error_break; error = " << err;
}
// ------------------------------------------------------------------------
@@ -976,7 +976,7 @@ ProcessId GetParentProcessId(ProcessHandle process) {
size_t length = sizeof(struct kinfo_proc);
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process };
if (sysctl(mib, 4, &info, &length, NULL, 0) < 0) {
- PLOG(ERROR) << "sysctl";
+ DPLOG(ERROR) << "sysctl";
return -1;
}
if (length == 0)
diff --git a/base/process_util_openbsd.cc b/base/process_util_openbsd.cc
index b442e93..d76e68f 100644
--- a/base/process_util_openbsd.cc
+++ b/base/process_util_openbsd.cc
@@ -64,7 +64,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* filter)
do {
size_t len = 0;
if (sysctl(mib, arraysize(mib), NULL, &len, NULL, 0) < 0) {
- LOG(ERROR) << "failed to get the size needed for the process list";
+ DLOG(ERROR) << "failed to get the size needed for the process list";
kinfo_procs_.resize(0);
done = true;
} else {
@@ -78,7 +78,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* filter)
// If we get a mem error, it just means we need a bigger buffer, so
// loop around again. Anything else is a real error and give up.
if (errno != ENOMEM) {
- LOG(ERROR) << "failed to get the process list";
+ DLOG(ERROR) << "failed to get the process list";
kinfo_procs_.resize(0);
done = true;
}
@@ -92,7 +92,7 @@ ProcessIterator::ProcessIterator(const ProcessFilter* filter)
} while (!done && (try_num++ < max_tries));
if (!done) {
- LOG(ERROR) << "failed to collect the process list in a few tries";
+ DDLOG(ERROR) << "failed to collect the process list in a few tries";
kinfo_procs_.resize(0);
}
}
@@ -137,7 +137,7 @@ bool ProcessIterator::CheckForNextProcess() {
// to populate |entry_.exe_file_|.
size_t exec_name_end = data.find('\0');
if (exec_name_end == std::string::npos) {
- LOG(ERROR) << "command line data didn't match expected format";
+ DLOG(ERROR) << "command line data didn't match expected format";
continue;
}
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 06fa779..055edcc 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -131,7 +131,7 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, ucontext_t* context) {
if (debug::BeingDebugged())
debug::BreakDebugger();
- LOG(ERROR) << "Received signal " << signal;
+ DLOG(ERROR) << "Received signal " << signal;
debug::StackTrace().PrintBacktrace();
// TODO(shess): Port to Linux.
@@ -296,7 +296,7 @@ bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
bool KillProcessGroup(ProcessHandle process_group_id) {
bool result = kill(-1 * process_group_id, SIGKILL) == 0;
if (!result)
- PLOG(ERROR) << "Unable to terminate process group " << process_group_id;
+ DPLOG(ERROR) << "Unable to terminate process group " << process_group_id;
return result;
}
@@ -565,11 +565,11 @@ bool LaunchProcess(const std::vector<std::string>& argv,
// synchronize means "return from LaunchProcess but don't let the child
// run until LaunchSynchronize is called". These two options are highly
// incompatible.
- CHECK(!options.wait);
+ DCHECK(!options.wait);
// Create the pipe used for synchronization.
if (HANDLE_EINTR(pipe(synchronization_pipe_fds)) != 0) {
- PLOG(ERROR) << "pipe";
+ DPLOG(ERROR) << "pipe";
return false;
}
@@ -594,7 +594,7 @@ bool LaunchProcess(const std::vector<std::string>& argv,
}
if (pid < 0) {
- PLOG(ERROR) << "fork";
+ DPLOG(ERROR) << "fork";
return false;
} else if (pid == 0) {
// Child process
@@ -749,7 +749,7 @@ void LaunchSynchronize(LaunchSynchronizationHandle handle) {
// Write a '\0' character to the pipe.
if (HANDLE_EINTR(write(synchronization_fd, "", 1)) != 1) {
- PLOG(ERROR) << "write";
+ DPLOG(ERROR) << "write";
}
}
#endif // defined(OS_MACOSX)
@@ -789,7 +789,7 @@ TerminationStatus GetTerminationStatus(ProcessHandle handle, int* exit_code) {
int status = 0;
const pid_t result = HANDLE_EINTR(waitpid(handle, &status, WNOHANG));
if (result == -1) {
- PLOG(ERROR) << "waitpid(" << handle << ")";
+ DPLOG(ERROR) << "waitpid(" << handle << ")";
if (exit_code)
*exit_code = 0;
return TERMINATION_STATUS_NORMAL_TERMINATION;
@@ -874,7 +874,7 @@ static bool WaitForSingleNonChildProcess(ProcessHandle handle,
int kq = kqueue();
if (kq == -1) {
- PLOG(ERROR) << "kqueue";
+ DPLOG(ERROR) << "kqueue";
return false;
}
file_util::ScopedFD kq_closer(&kq);
@@ -888,7 +888,7 @@ static bool WaitForSingleNonChildProcess(ProcessHandle handle,
return true;
}
- PLOG(ERROR) << "kevent (setup " << handle << ")";
+ DPLOG(ERROR) << "kevent (setup " << handle << ")";
return false;
}
@@ -928,11 +928,11 @@ static bool WaitForSingleNonChildProcess(ProcessHandle handle,
}
if (result < 0) {
- PLOG(ERROR) << "kevent (wait " << handle << ")";
+ DPLOG(ERROR) << "kevent (wait " << handle << ")";
return false;
} else if (result > 1) {
- LOG(ERROR) << "kevent (wait " << handle << "): unexpected result "
- << result;
+ DLOG(ERROR) << "kevent (wait " << handle << "): unexpected result "
+ << result;
return false;
} else if (result == 0) {
// Timed out.
@@ -944,10 +944,10 @@ static bool WaitForSingleNonChildProcess(ProcessHandle handle,
if (event.filter != EVFILT_PROC ||
(event.fflags & NOTE_EXIT) == 0 ||
event.ident != static_cast<uintptr_t>(handle)) {
- LOG(ERROR) << "kevent (wait " << handle
- << "): unexpected event: filter=" << event.filter
- << ", fflags=" << event.fflags
- << ", ident=" << event.ident;
+ DLOG(ERROR) << "kevent (wait " << handle
+ << "): unexpected event: filter=" << event.filter
+ << ", fflags=" << event.fflags
+ << ", ident=" << event.ident;
return false;
}
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index c6ce3f5..85aeace 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -276,7 +276,7 @@ bool LaunchProcess(const string16& cmdline,
if (options.job_handle) {
if (0 == AssignProcessToJobObject(options.job_handle,
process_info.hProcess)) {
- LOG(ERROR) << "Could not AssignProcessToObject.";
+ DLOG(ERROR) << "Could not AssignProcessToObject.";
KillProcess(process_info.hProcess, kProcessKilledExitCode, true);
return false;
}
@@ -902,7 +902,7 @@ size_t GetSystemCommitCharge() {
PERFORMANCE_INFORMATION info;
if (!InternalGetPerformanceInfo(&info, sizeof(info))) {
- LOG(ERROR) << "Failed to fetch internal performance info.";
+ DLOG(ERROR) << "Failed to fetch internal performance info.";
return 0;
}
return (info.CommitTotal * system_info.dwPageSize) / 1024;
diff --git a/base/rand_util_posix.cc b/base/rand_util_posix.cc
index 43dfd1e..f23330a 100644
--- a/base/rand_util_posix.cc
+++ b/base/rand_util_posix.cc
@@ -23,7 +23,7 @@ class URandomFd {
public:
URandomFd() {
fd_ = open("/dev/urandom", O_RDONLY);
- CHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno;
+ DCHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno;
}
~URandomFd() {
diff --git a/base/scoped_temp_dir.cc b/base/scoped_temp_dir.cc
index fc886e5a..6a51d6d 100644
--- a/base/scoped_temp_dir.cc
+++ b/base/scoped_temp_dir.cc
@@ -12,7 +12,7 @@ ScopedTempDir::ScopedTempDir() {
ScopedTempDir::~ScopedTempDir() {
if (!path_.empty() && !Delete())
- LOG(WARNING) << "Could not delete temp dir in dtor.";
+ DLOG(WARNING) << "Could not delete temp dir in dtor.";
}
bool ScopedTempDir::CreateUniqueTempDir() {
@@ -67,7 +67,7 @@ bool ScopedTempDir::Delete() {
// We only clear the path if deleted the directory.
path_.clear();
} else {
- LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value();
+ DLOG(ERROR) << "ScopedTempDir unable to delete " << path_.value();
}
return ret;
diff --git a/base/sha1_win.cc b/base/sha1_win.cc
index 2edfb3d..626f41b 100644
--- a/base/sha1_win.cc
+++ b/base/sha1_win.cc
@@ -18,20 +18,20 @@ std::string SHA1HashString(const std::string& str) {
ScopedHCRYPTPROV provider;
if (!CryptAcquireContext(provider.receive(), NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) {
- LOG(ERROR) << "CryptAcquireContext failed: " << GetLastError();
+ DLOG(ERROR) << "CryptAcquireContext failed: " << GetLastError();
return std::string(kSHA1Length, '\0');
}
{
ScopedHCRYPTHASH hash;
if (!CryptCreateHash(provider, CALG_SHA1, 0, 0, hash.receive())) {
- LOG(ERROR) << "CryptCreateHash failed: " << GetLastError();
+ DLOG(ERROR) << "CryptCreateHash failed: " << GetLastError();
return std::string(kSHA1Length, '\0');
}
if (!CryptHashData(hash, reinterpret_cast<CONST BYTE*>(str.data()),
static_cast<DWORD>(str.length()), 0)) {
- LOG(ERROR) << "CryptHashData failed: " << GetLastError();
+ DLOG(ERROR) << "CryptHashData failed: " << GetLastError();
return std::string(kSHA1Length, '\0');
}
@@ -40,7 +40,8 @@ std::string SHA1HashString(const std::string& str) {
if (!CryptGetHashParam(hash, HP_HASHSIZE,
reinterpret_cast<unsigned char*>(&hash_len),
&buffer_size, 0)) {
- LOG(ERROR) << "CryptGetHashParam(HP_HASHSIZE) failed: " << GetLastError();
+ DLOG(ERROR) << "CryptGetHashParam(HP_HASHSIZE) failed: "
+ << GetLastError();
return std::string(kSHA1Length, '\0');
}
@@ -50,13 +51,14 @@ std::string SHA1HashString(const std::string& str) {
// but so that result.length() is correctly set to |hash_len|.
reinterpret_cast<BYTE*>(WriteInto(&result, hash_len + 1)), &hash_len,
0))) {
- LOG(ERROR) << "CryptGetHashParam(HP_HASHVAL) failed: " << GetLastError();
+ DLOG(ERROR) << "CryptGetHashParam(HP_HASHVAL) failed: "
+ << GetLastError();
return std::string(kSHA1Length, '\0');
}
if (hash_len != kSHA1Length) {
- LOG(ERROR) << "Returned hash value is wrong length: " << hash_len
- << " should be " << kSHA1Length;
+ DLOG(ERROR) << "Returned hash value is wrong length: " << hash_len
+ << " should be " << kSHA1Length;
return std::string(kSHA1Length, '\0');
}
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index 942a04c..3e5699a 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -91,7 +91,7 @@ SharedMemoryHandle SharedMemory::NULLHandle() {
void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) {
DCHECK_GE(handle.fd, 0);
if (HANDLE_EINTR(close(handle.fd)) < 0)
- PLOG(ERROR) << "close";
+ DPLOG(ERROR) << "close";
}
bool SharedMemory::CreateAndMapAnonymous(uint32 size) {
@@ -175,7 +175,7 @@ bool SharedMemory::CreateNamed(const std::string& name,
PLOG(ERROR) << "Unable to access(W_OK|X_OK) " << dir.value();
if (dir.value() == "/dev/shm") {
LOG(FATAL) << "This is frequently caused by incorrect permissions on "
- << "/dev/shm. Try 'sudo chmod 1777 /dev/shm' to fix.";
+ << "/dev/shm. Try 'sudo chmod 1777 /dev/shm' to fix.";
}
}
#else
diff --git a/base/shared_memory_win.cc b/base/shared_memory_win.cc
index 526132c..3e5ad36 100644
--- a/base/shared_memory_win.cc
+++ b/base/shared_memory_win.cc
@@ -206,7 +206,7 @@ bool SharedMemory::Lock(uint32 timeout_ms, SECURITY_ATTRIBUTES* sec_attr) {
name.append(L"lock");
lock_ = CreateMutex(sec_attr, FALSE, name.c_str());
if (lock_ == NULL) {
- PLOG(ERROR) << "Could not create mutex.";
+ DPLOG(ERROR) << "Could not create mutex.";
return false; // there is nothing good we can do here.
}
}
diff --git a/base/sync_socket_posix.cc b/base/sync_socket_posix.cc
index 82ad91c..f50d20b 100644
--- a/base/sync_socket_posix.cc
+++ b/base/sync_socket_posix.cc
@@ -69,11 +69,11 @@ bool SyncSocket::CreatePair(SyncSocket* pair[2]) {
cleanup:
if (handles[0] != kInvalidHandle) {
if (HANDLE_EINTR(close(handles[0])) < 0)
- PLOG(ERROR) << "close";
+ DPLOG(ERROR) << "close";
}
if (handles[1] != kInvalidHandle) {
if (HANDLE_EINTR(close(handles[1])) < 0)
- PLOG(ERROR) << "close";
+ DPLOG(ERROR) << "close";
}
delete tmp_sockets[0];
delete tmp_sockets[1];
@@ -86,7 +86,7 @@ bool SyncSocket::Close() {
}
int retval = HANDLE_EINTR(close(handle_));
if (retval < 0)
- PLOG(ERROR) << "close";
+ DPLOG(ERROR) << "close";
handle_ = kInvalidHandle;
return (retval == 0);
}
diff --git a/base/synchronization/condition_variable_win.cc b/base/synchronization/condition_variable_win.cc
index 3030178..7b9919a 100644
--- a/base/synchronization/condition_variable_win.cc
+++ b/base/synchronization/condition_variable_win.cc
@@ -117,7 +117,7 @@ ConditionVariable::Event* ConditionVariable::GetEventForWaiting() {
cv_event = new Event();
cv_event->InitListElement();
allocation_counter_++;
- CHECK(cv_event->handle());
+ DCHECK(cv_event->handle());
} else {
cv_event = recycling_list_.PopFront();
recycling_list_size_--;
@@ -193,7 +193,7 @@ ConditionVariable::Event::~Event() {
void ConditionVariable::Event::InitListElement() {
DCHECK(!handle_);
handle_ = CreateEvent(NULL, false, false, NULL);
- CHECK(handle_);
+ DCHECK(handle_);
}
// Methods for use on lists.
diff --git a/base/system_monitor/system_monitor.cc b/base/system_monitor/system_monitor.cc
index 2631789..5131fbf 100644
--- a/base/system_monitor/system_monitor.cc
+++ b/base/system_monitor/system_monitor.cc
@@ -86,18 +86,18 @@ void SystemMonitor::RemoveObserver(PowerObserver* obs) {
}
void SystemMonitor::NotifyPowerStateChange() {
- VLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off")
- << " battery";
+ DVLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off")
+ << " battery";
observer_list_->Notify(&PowerObserver::OnPowerStateChange, BatteryPower());
}
void SystemMonitor::NotifySuspend() {
- VLOG(1) << "Power Suspending";
+ DVLOG(1) << "Power Suspending";
observer_list_->Notify(&PowerObserver::OnSuspend);
}
void SystemMonitor::NotifyResume() {
- VLOG(1) << "Power Resuming";
+ DVLOG(1) << "Power Resuming";
observer_list_->Notify(&PowerObserver::OnResume);
}
diff --git a/base/system_monitor/system_monitor_win.cc b/base/system_monitor/system_monitor_win.cc
index 84f2b2e..a8cd54a 100644
--- a/base/system_monitor/system_monitor_win.cc
+++ b/base/system_monitor/system_monitor_win.cc
@@ -41,7 +41,7 @@ void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) {
bool SystemMonitor::IsBatteryPower() {
SYSTEM_POWER_STATUS status;
if (!GetSystemPowerStatus(&status)) {
- LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError();
+ DLOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError();
return false;
}
return (status.ACLineStatus == 0);
diff --git a/base/test/test_file_util_mac.cc b/base/test/test_file_util_mac.cc
index 903b475..7145e51 100644
--- a/base/test/test_file_util_mac.cc
+++ b/base/test/test_file_util_mac.cc
@@ -19,27 +19,27 @@ bool EvictFileFromSystemCache(const FilePath& file) {
int64 length;
if (!file_util::GetFileSize(file, &length)) {
- LOG(ERROR) << "failed to get size of " << file.value();
+ DLOG(ERROR) << "failed to get size of " << file.value();
return false;
}
// When a file is empty, we do not need to evict it from cache.
// In fact, an attempt to map it to memory will result in error.
if (length == 0) {
- LOG(WARNING) << "file size is zero, will not attempt to map to memory";
+ DLOG(WARNING) << "file size is zero, will not attempt to map to memory";
return true;
}
file_util::MemoryMappedFile mapped_file;
if (!mapped_file.Initialize(file)) {
- LOG(WARNING) << "failed to memory map " << file.value();
+ DLOG(WARNING) << "failed to memory map " << file.value();
return false;
}
if (msync(const_cast<uint8*>(mapped_file.data()), mapped_file.length(),
MS_INVALIDATE) != 0) {
- LOG(WARNING) << "failed to invalidate memory map of " << file.value()
- << ", errno: " << errno;
+ DLOG(WARNING) << "failed to invalidate memory map of " << file.value()
+ << ", errno: " << errno;
return false;
}
diff --git a/base/test/test_file_util_posix.cc b/base/test/test_file_util_posix.cc
index cca17b59..0096c9e 100644
--- a/base/test/test_file_util_posix.cc
+++ b/base/test/test_file_util_posix.cc
@@ -73,8 +73,8 @@ bool CopyRecursiveDirNoCache(const FilePath& source_dir,
FileEnumerator::FindInfo info;
FilePath current = source_dir;
if (stat(source_dir.value().c_str(), &info.stat) < 0) {
- LOG(ERROR) << "CopyRecursiveDirNoCache() couldn't stat source directory: "
- << source_dir.value() << " errno = " << errno;
+ DLOG(ERROR) << "CopyRecursiveDirNoCache() couldn't stat source directory: "
+ << source_dir.value() << " errno = " << errno;
success = false;
}
@@ -92,8 +92,8 @@ bool CopyRecursiveDirNoCache(const FilePath& source_dir,
if (S_ISDIR(info.stat.st_mode)) {
if (mkdir(target_path.value().c_str(), info.stat.st_mode & 01777) != 0 &&
errno != EEXIST) {
- LOG(ERROR) << "CopyRecursiveDirNoCache() couldn't create directory: " <<
- target_path.value() << " errno = " << errno;
+ DLOG(ERROR) << "CopyRecursiveDirNoCache() couldn't create directory: "
+ << target_path.value() << " errno = " << errno;
success = false;
}
} else if (S_ISREG(info.stat.st_mode)) {
@@ -101,13 +101,13 @@ bool CopyRecursiveDirNoCache(const FilePath& source_dir,
success = EvictFileFromSystemCache(target_path);
DCHECK(success);
} else {
- LOG(ERROR) << "CopyRecursiveDirNoCache() couldn't create file: " <<
- target_path.value();
+ DLOG(ERROR) << "CopyRecursiveDirNoCache() couldn't create file: "
+ << target_path.value();
success = false;
}
} else {
- LOG(WARNING) << "CopyRecursiveDirNoCache() skipping non-regular file: " <<
- current.value();
+ DLOG(WARNING) << "CopyRecursiveDirNoCache() skipping non-regular file: "
+ << current.value();
}
current = traversal.Next();
diff --git a/base/threading/non_thread_safe_unittest.cc b/base/threading/non_thread_safe_unittest.cc
index 01efe28..3236278 100644
--- a/base/threading/non_thread_safe_unittest.cc
+++ b/base/threading/non_thread_safe_unittest.cc
@@ -20,7 +20,7 @@ class NonThreadSafeClass : public NonThreadSafe {
// Verifies that it was called on the same thread as the constructor.
void DoStuff() {
- CHECK(CalledOnValidThread());
+ DCHECK(CalledOnValidThread());
}
void DetachFromThread() {
diff --git a/base/threading/platform_thread_mac.mm b/base/threading/platform_thread_mac.mm
index cff7a1f..ef807eb 100644
--- a/base/threading/platform_thread_mac.mm
+++ b/base/threading/platform_thread_mac.mm
@@ -77,7 +77,7 @@ void SetPriorityNormal(mach_port_t mach_thread_id) {
THREAD_STANDARD_POLICY_COUNT);
if (result != KERN_SUCCESS)
- VLOG(1) << "thread_policy_set() failure: " << result;
+ DVLOG(1) << "thread_policy_set() failure: " << result;
}
// Enables time-contraint policy and priority suitable for low-latency,
@@ -100,7 +100,7 @@ void SetPriorityRealtimeAudio(mach_port_t mach_thread_id) {
(thread_policy_t)&policy,
THREAD_EXTENDED_POLICY_COUNT);
if (result != KERN_SUCCESS) {
- VLOG(1) << "thread_policy_set() failure: " << result;
+ DVLOG(1) << "thread_policy_set() failure: " << result;
return;
}
@@ -112,7 +112,7 @@ void SetPriorityRealtimeAudio(mach_port_t mach_thread_id) {
(thread_policy_t)&precedence,
THREAD_PRECEDENCE_POLICY_COUNT);
if (result != KERN_SUCCESS) {
- VLOG(1) << "thread_policy_set() failure: " << result;
+ DVLOG(1) << "thread_policy_set() failure: " << result;
return;
}
@@ -156,7 +156,7 @@ void SetPriorityRealtimeAudio(mach_port_t mach_thread_id) {
(thread_policy_t)&time_constraints,
THREAD_TIME_CONSTRAINT_POLICY_COUNT);
if (result != KERN_SUCCESS)
- VLOG(1) << "thread_policy_set() failure: " << result;
+ DVLOG(1) << "thread_policy_set() failure: " << result;
return;
}
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index d1fb7bb..e6b8e64 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -186,14 +186,14 @@ void PlatformThread::SetName(const char* name) {
int err = dynamic_pthread_setname_np(pthread_self(),
shortened_name.c_str());
if (err < 0)
- LOG(ERROR) << "pthread_setname_np: " << safe_strerror(err);
+ DLOG(ERROR) << "pthread_setname_np: " << safe_strerror(err);
} else {
// Implementing this function without glibc is simple enough. (We
// don't do the name length clipping as above because it will be
// truncated by the callee (see TASK_COMM_LEN above).)
int err = prctl(PR_SET_NAME, name);
if (err < 0)
- PLOG(ERROR) << "prctl(PR_SET_NAME)";
+ DPLOG(ERROR) << "prctl(PR_SET_NAME)";
}
}
#elif defined(OS_MACOSX)
diff --git a/base/threading/simple_thread.cc b/base/threading/simple_thread.cc
index 4441477..a5dd763 100644
--- a/base/threading/simple_thread.cc
+++ b/base/threading/simple_thread.cc
@@ -29,7 +29,7 @@ SimpleThread::~SimpleThread() {
void SimpleThread::Start() {
DCHECK(!HasBeenStarted()) << "Tried to Start a thread multiple times.";
bool success = PlatformThread::Create(options_.stack_size(), this, &thread_);
- CHECK(success);
+ DCHECK(success);
event_.Wait(); // Wait for the thread to complete initialization.
}
diff --git a/base/threading/thread_checker_unittest.cc b/base/threading/thread_checker_unittest.cc
index 2808048..e1e5715 100644
--- a/base/threading/thread_checker_unittest.cc
+++ b/base/threading/thread_checker_unittest.cc
@@ -20,7 +20,7 @@ class ThreadCheckerClass : public ThreadChecker {
// Verifies that it was called on the same thread as the constructor.
void DoStuff() {
- CHECK(CalledOnValidThread());
+ DCHECK(CalledOnValidThread());
}
void DetachFromThread() {
diff --git a/base/threading/thread_local_posix.cc b/base/threading/thread_local_posix.cc
index 2071ad8..4951006 100644
--- a/base/threading/thread_local_posix.cc
+++ b/base/threading/thread_local_posix.cc
@@ -32,7 +32,7 @@ void* ThreadLocalPlatform::GetValueFromSlot(SlotType& slot) {
// static
void ThreadLocalPlatform::SetValueInSlot(SlotType& slot, void* value) {
int error = pthread_setspecific(slot, value);
- CHECK_EQ(error, 0);
+ DCHECK_EQ(error, 0);
}
} // namespace internal
diff --git a/base/threading/thread_local_win.cc b/base/threading/thread_local_win.cc
index 56d3a3a..32cceeb 100644
--- a/base/threading/thread_local_win.cc
+++ b/base/threading/thread_local_win.cc
@@ -33,7 +33,7 @@ void* ThreadLocalPlatform::GetValueFromSlot(SlotType& slot) {
// static
void ThreadLocalPlatform::SetValueInSlot(SlotType& slot, void* value) {
if (!TlsSetValue(slot, value)) {
- LOG(FATAL) << "Failed to TlsSetValue().";
+ DLOG(FATAL) << "Failed to TlsSetValue().";
}
}
diff --git a/base/vlog.cc b/base/vlog.cc
index 41bf2a5..332de38 100644
--- a/base/vlog.cc
+++ b/base/vlog.cc
@@ -52,23 +52,23 @@ VlogInfo::VlogInfo(const std::string& v_switch,
if (base::StringToInt(v_switch, &vlog_level)) {
SetMaxVlogLevel(vlog_level);
} else {
- LOG(WARNING) << "Could not parse v switch \"" << v_switch << "\"";
+ DLOG(WARNING) << "Could not parse v switch \"" << v_switch << "\"";
}
}
std::vector<KVPair> kv_pairs;
if (!base::SplitStringIntoKeyValuePairs(
vmodule_switch, '=', ',', &kv_pairs)) {
- LOG(WARNING) << "Could not fully parse vmodule switch \""
- << vmodule_switch << "\"";
+ DLOG(WARNING) << "Could not fully parse vmodule switch \""
+ << vmodule_switch << "\"";
}
for (std::vector<KVPair>::const_iterator it = kv_pairs.begin();
it != kv_pairs.end(); ++it) {
VmodulePattern pattern(it->first);
if (!base::StringToInt(it->second, &pattern.vlog_level)) {
- LOG(WARNING) << "Parsed vlog level for \""
- << it->first << "=" << it->second
- << "\" as " << pattern.vlog_level;
+ DLOG(WARNING) << "Parsed vlog level for \""
+ << it->first << "=" << it->second
+ << "\" as " << pattern.vlog_level;
}
vmodule_levels_.push_back(pattern);
}
diff --git a/base/win/i18n.cc b/base/win/i18n.cc
index 59480f2..9e523a1 100644
--- a/base/win/i18n.cc
+++ b/base/win/i18n.cc
@@ -75,7 +75,7 @@ bool GetMUIPreferredUILanguageList(LanguageFunction function, ULONG flags,
<< "Failed getting size of preferred UI languages.";
}
} else {
- VLOG(2) << "MUI not available.";
+ DVLOG(2) << "MUI not available.";
}
} else {
NOTREACHED() << "kernel32.dll not found.";