diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-25 03:06:12 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-25 03:06:12 +0000 |
commit | 2f4a8e1220d91ba95c2c46ec232dd53d27807ecd (patch) | |
tree | a353800ca5728e7c26423af7cccedf9812404d9a /base | |
parent | 27488c22fe34d431fa34576032d8a0fc92b61572 (diff) | |
download | chromium_src-2f4a8e1220d91ba95c2c46ec232dd53d27807ecd.zip chromium_src-2f4a8e1220d91ba95c2c46ec232dd53d27807ecd.tar.gz chromium_src-2f4a8e1220d91ba95c2c46ec232dd53d27807ecd.tar.bz2 |
Revert 107042 - 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
TBR=brettw@chromium.org
Review URL: http://codereview.chromium.org/8351025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
56 files changed, 248 insertions, 254 deletions
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc index 97bbf90..b7973e8 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); - DCHECK_EQ(0, ret_val); + CHECK_EQ(0, ret_val); } #endif // ENABLE_DYNAMIC_ALLOCATOR_SWITCHING } diff --git a/base/allocator/allocator_unittests.cc b/base/allocator/allocator_unittests.cc index d6556ce..d935cf9 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]); - ASSERT_TRUE(p); + CHECK(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]); - ASSERT_EQ(p, new_p); // realloc should not allocate new memory + CHECK_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]); - ASSERT_EQ(p, new_p); // realloc should not allocate new memory + CHECK_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 ae2f185..08cb42e 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); - DCHECK(byte_array); + CHECK(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 4ce3bd7..b082eb3 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 { - DLOG(WARNING) << "CR_SOURCE_ROOT is set, but it appears to not " - << "point to the correct source root directory."; + LOG(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; } - DLOG(ERROR) << "Couldn't find your source root. " - << "Try running from your chromium/src directory."; + LOG(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 0237ffe..22977af 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)) { - DLOG(WARNING) << "Value of switch (" << switch_string << ") must be ASCII."; - return std::string(); + LOG(WARNING) << "Value of switch (" << switch_string << ") must be ASCII."; + return ""; } #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); - DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: " - << command_line; + PLOG_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 a0d8a92..3777fa1 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. - DLOG(INFO) << "DebugUtil::WaitForDebugger(pid=" << static_cast<int>(getpid()) - << ")"; + LOG(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 63f057f..8b24cca 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){ - DCHECK(!g_category_already_shutdown->enabled); + CHECK(!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 a6adfdb..5aefb9a 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); - ASSERT_TRUE(dir); + CHECK(dir); const int prev_wd = open(".", O_RDONLY | O_DIRECTORY); - DCHECK_GE(prev_wd, 0); + CHECK_GE(prev_wd, 0); PCHECK(chdir(dir) == 0); diff --git a/base/event_recorder_win.cc b/base/event_recorder_win.cc index 11bf0f0..b2473809 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) { - DCHECK(EventRecorder::current()); + CHECK(EventRecorder::current()); return EventRecorder::current()->RecordWndProc(nCode, wParam, lParam); } LRESULT CALLBACK StaticPlaybackWndProc(int nCode, WPARAM wParam, LPARAM lParam) { - DCHECK(EventRecorder::current()); + CHECK(EventRecorder::current()); return EventRecorder::current()->PlaybackWndProc(nCode, wParam, lParam); } diff --git a/base/file_util.cc b/base/file_util.cc index dc186d9..e9f1d4e 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) { - DLOG(ERROR) << "Couldn't open " << file_name.value(); + LOG(ERROR) << "Couldn't open " << file_name.value(); return false; } diff --git a/base/file_util.h b/base/file_util.h index 90ec1ae..b0c2459 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) - DPLOG(ERROR) << "close"; + PLOG(ERROR) << "close"; } } }; diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index c365869a..8d9fb29 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) { - DPLOG(ERROR) << "Failed to get information on path " - << path.value(); + PLOG(ERROR) << "Failed to get information on path " + << path.value(); return false; } if (S_ISLNK(stat_info.st_mode)) { - DLOG(ERROR) << "Path " << path.value() + LOG(ERROR) << "Path " << path.value() << " is a symbolic link."; return false; } if (stat_info.st_uid != owner_uid) { - DLOG(ERROR) << "Path " << path.value() - << " is owned by the wrong user."; + LOG(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)) { - DLOG(ERROR) << "Path " << path.value() - << " is writable by an unprivileged group."; + LOG(ERROR) << "Path " << path.value() + << " is writable by an unprivileged group."; return false; } if (stat_info.st_mode & S_IWOTH) { - DLOG(ERROR) << "Path " << path.value() - << " is writable by any user."; + LOG(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) { - DPLOG(ERROR) << "stat64 failed"; + PLOG(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) { - DLOG(ERROR) << "CopyDirectory() couldn't stat source directory: " - << from_path.value() << " errno = " << errno; + LOG(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) { - DLOG(ERROR) << "CopyDirectory() couldn't create directory: " - << target_path.value() << " errno = " << errno; + LOG(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)) { - DLOG(ERROR) << "CopyDirectory() couldn't create file: " - << target_path.value(); + LOG(ERROR) << "CopyDirectory() couldn't create file: " << + target_path.value(); success = false; } } else { - DLOG(WARNING) << "CopyDirectory() skipping non-regular file: " - << current.value(); + LOG(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(). - DCHECK(name_tmpl.find("XXXXXX") != FilePath::StringType::npos) - << "Directory name template must contain \"XXXXXX\"."; + CHECK(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)) { - DPLOG(ERROR) << "Couldn't stat " - << source.Append(dent->d_name).value(); + PLOG(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) { - DLOG(ERROR) << "Couldn't fstat " << file_ << ", errno " << errno; + LOG(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) - DLOG(ERROR) << "Couldn't mmap " << file_ << ", errno " << errno; + LOG(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) - DLOG(WARNING) << "OS_ANDROID: Home directory lookup not yet implemented."; + LOG(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)) { - DLOG(ERROR) << "|base| must be a subdirectory of |path|. base = \"" - << base.value() << "\", path = \"" << path.value() << "\""; + LOG(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. - DCHECK(ip != path_components.end()); - DCHECK(*ip == *ib); + CHECK(ip != path_components.end()); + CHECK(*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) { - DPLOG(ERROR) << "Could not get the group ID of group \"" - << kAdminGroupNames[i] << "\"."; + PLOG(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 8d9fbdef..19e15fc 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)) { - DLOG(ERROR) << "Failed to get drive mapping."; + LOG(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)) { - DPLOG(WARNING) << "Failed to get temporary file name in " << dir.value(); + PLOG(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) { - DPLOG(WARNING) << "Failed to get long path name for " << temp_name; + PLOG(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; } - DLOG(WARNING) << "CreateDirectory(" << full_path_str << "), " - << "conflicts with existing file."; + LOG(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 { - DLOG(WARNING) << "Failed to create directory " << full_path_str - << ", last error is " << error_code << "."; + LOG(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) { - DLOG(WARNING) << "CreateFile failed for path " << filename.value() - << " error code=" << GetLastError(); + LOG(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. - DLOG(WARNING) << "writing file " << filename.value() - << " failed, error code=" << GetLastError(); + LOG(WARNING) << "writing file " << filename.value() + << " failed, error code=" << GetLastError(); } else { // Didn't write all the bytes. - DLOG(WARNING) << "wrote" << written << " bytes to " - << filename.value() << " expected " << size; + LOG(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) { - DLOG(ERROR) << "Couldn't open " << file_name.value(); + LOG(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 07a4dd2..3413e8a 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) { - DPLOG(ERROR) << "close"; + PLOG(ERROR) << "close"; } *fd = -1; } @@ -203,7 +203,7 @@ void FilePathWatcherImpl::CloseFileDescriptor(int *fd) { bool FilePathWatcherImpl::AreKeventValuesValid(struct kevent* kevents, int count) { if (count < 0) { - DPLOG(ERROR) << "kevent"; + PLOG(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)); } - DLOG(ERROR) << "Error: " << kevents[i].data << " for " << path_name; + LOG(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()); - DCHECK_EQ(fd, kqueue_); - DCHECK(events_.size()); + CHECK_EQ(fd, kqueue_); + CHECK(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) { - DPLOG(ERROR) << "kqueue"; + PLOG(ERROR) << "kqueue"; return false; } int last_entry = EventsForPath(target_, &events_); - DCHECK_NE(last_entry, 0); + CHECK_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 84a5398..b87654e 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. - DPLOG(ERROR) << "FindFirstChangeNotification failed for " - << dir.value(); + PLOG(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) { - DLOG(ERROR) << "Reached the root directory"; + LOG(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 d8884a5..65e7955 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) - DLOG(FATAL) << "Unknown global descriptor: " << key; + LOG(FATAL) << "Unknown global descriptor: " << key; return ret; } diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc index e5bbe17..4f17f177 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) { - DLOG(ERROR) << "Failed to load " << ICU_UTIL_DATA_SHARED_MODULE_NAME; + LOG(ERROR) << "Failed to load " << ICU_UTIL_DATA_SHARED_MODULE_NAME; return false; } FARPROC addr = GetProcAddress(module, ICU_UTIL_DATA_SYMBOL); if (!addr) { - DLOG(ERROR) << ICU_UTIL_DATA_SYMBOL << ": not found in " + LOG(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()) { - DLOG(ERROR) << ICU_UTIL_DATA_FILE_NAME << " not found in bundle"; + LOG(ERROR) << ICU_UTIL_DATA_FILE_NAME << " not found in bundle"; return false; } if (!mapped_file.Initialize(data_path)) { - DLOG(ERROR) << "Couldn't mmap " << data_path.value(); + LOG(ERROR) << "Couldn't mmap " << data_path.value(); return false; } } diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc index 9906dba..419e8db 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)); - DCHECK(U_SUCCESS(status)); + CHECK(U_SUCCESS(status)); const char* base_pattern = (type == k12HourClock ? "ahm" : "Hm"); icu::UnicodeString generated_pattern = generator->getBestPattern(icu::UnicodeString(base_pattern), status); - DCHECK(U_SUCCESS(status)); + CHECK(U_SUCCESS(status)); // Then, format the time using the generated pattern. icu::SimpleDateFormat formatter(generated_pattern, status); - DCHECK(U_SUCCESS(status)); + CHECK(U_SUCCESS(status)); if (ampm == kKeepAmPm) { return TimeFormat(&formatter, time); } else { diff --git a/base/linux_util.cc b/base/linux_util.cc index 6751469..c0757fa 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) { - DLOG(WARNING) << "Failed to read the inode number for a socket from /proc" + LOG(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) { - DLOG(WARNING) << "The descriptor passed from the crashing process wasn't " - " a UNIX domain socket."; + LOG(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) { - DLOG(WARNING) << "Failed to parse a socket's inode number: the number " - "was too large. Please report this bug: " << buf; + LOG(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) { - DLOG(WARNING) << "Cannot open /proc"; + LOG(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) { - DLOG(WARNING) << "Cannot open " << buf; + LOG(WARNING) << "Cannot open " << buf; return -1; } diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm index 8a4ce47..37b001b 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) { - DLOG(ERROR) << "GetProcessBundleLocation failed: error " << pbErr; + LOG(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) { - DLOG(ERROR) << "FSGetCatalogInfo failed: error " << fsErr; + LOG(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]; - DCHECK(bundle) << "Failed to load the bundle at " << file_path.value(); + CHECK(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)) { - DLOG(WARNING) << "Could not get user library path"; + LOG(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))); - DLOG(WARNING) << "Expected value for key " + LOG(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 66fbf11..57e07a6 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()) { - DLOG(ERROR) << "Couldn't get a Login Items list."; + LOG(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); - DLOG_IF(ERROR, !g_color_space_sRGB) << "Couldn't get the sRGB color space"; + LOG_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) { - DLOG(WARNING) << + LOG(WARNING) << "Couldn't get the main display's color space, using generic"; } else { - DLOG(ERROR) << "Couldn't get any color space"; + LOG(ERROR) << "Couldn't get any color space"; } } @@ -216,7 +216,7 @@ void ActivateProcess(pid_t pid) { if (status == noErr) { SetFrontProcess(&process); } else { - DLOG(WARNING) << "Unable to get process for pid " << pid; + LOG(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) { - DLOG(WARNING) << "GetFrontProcess: " << err; + LOG(WARNING) << "GetFrontProcess: " << err; return false; } @@ -233,7 +233,7 @@ bool AmIForeground() { Boolean result = FALSE; err = SameProcess(&foreground_psn, &my_psn, &result); if (err != noErr) { - DLOG(WARNING) << "SameProcess: " << err; + LOG(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) { - DLOG(WARNING) << "Failed to set backup exclusion for file '" + LOG(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) { - DLOG(ERROR) << "Failed to look up LaunchServices bundle"; + LOG(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) - DLOG(ERROR) << "Could not find _LSGetCurrentApplicationASN"; + LOG(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) - DLOG(ERROR) << "Could not find _LSSetApplicationInformationItem"; + LOG(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) - DLOG(ERROR) << "Could not find _kLSDisplayNameKey"; + LOG(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 */); - DLOG_IF(ERROR, err) << "Call to set process name failed, err " << err; + LOG_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()) { - DLOG(ERROR) << "Couldn't get a Login Items list."; + LOG(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()) { - DLOG(ERROR) << "Couldn't insert current app into Login Items list."; + LOG(ERROR) << "Couldn't insert current app into Login Items list."; } } @@ -443,7 +443,7 @@ void RemoveFromLoginItems() { NULL, kLSSharedFileListSessionLoginItems, NULL)); if (!login_items.get()) { - DLOG(ERROR) << "Couldn't get a Login Items list."; + LOG(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()) - DLOG(ERROR) << + LOG(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) { - DPLOG(ERROR) << "uname"; + PLOG(ERROR) << "uname"; return 0; } if (strcmp(uname_info.sysname, "Darwin") != 0) { - DLOG(ERROR) << "unexpected uname sysname " << uname_info.sysname; + LOG(ERROR) << "unexpected uname sysname " << uname_info.sysname; return 0; } @@ -527,7 +527,7 @@ int DarwinMajorVersionInternal() { } if (!dot) { - DLOG(ERROR) << "could not parse uname release " << uname_info.release; + LOG(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; - DLOG_IF(WARNING, darwin_major_version > 11) << "Assuming Darwin " + LOG_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 f7ee88f..bd7a750 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() { - DCHECK(object_); - DCHECK(class_); + CHECK(object_); + CHECK(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); - DCHECK(instance_variable); + CHECK(instance_variable); [instance_value release]; } } diff --git a/base/message_loop.cc b/base/message_loop.cc index 553efb1..593c03c9 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) { - DCHECK(task); + CHECK(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) { - DCHECK(task); + CHECK(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) { - DCHECK(task); + CHECK(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) { - DCHECK(task); + CHECK(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) { - DCHECK(!task.is_null()) << from_here.ToString(); + CHECK(!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) { - DCHECK(!task.is_null()) << from_here.ToString(); + CHECK(!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) { - DCHECK(!task.is_null()) << from_here.ToString(); + CHECK(!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) { - DCHECK(!task.is_null()) << from_here.ToString(); + CHECK(!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 19a0eea..20fc8ea9 100644 --- a/base/message_pump_glib.cc +++ b/base/message_pump_glib.cc @@ -145,10 +145,7 @@ MessagePumpGlib::MessagePumpGlib() wakeup_gpollfd_(new GPollFD) { // Create our wakeup pipe, which is used to flag when work was scheduled. int fds[2]; - int ret = pipe(fds); - DCHECK_EQ(ret, 0); - (void)ret; // Prevent warning in release mode. - + CHECK_EQ(pipe(fds), 0); 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 9bef229..1b4c023 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) - DPLOG(ERROR) << "close"; + PLOG(ERROR) << "close"; } if (wakeup_pipe_out_ >= 0) { if (HANDLE_EINTR(close(wakeup_pipe_out_)) < 0) - DPLOG(ERROR) << "close"; + PLOG(ERROR) << "close"; } event_base_free(event_base_); } diff --git a/base/message_pump_x.cc b/base/message_pump_x.cc index 15276e4..a9b1b8a 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)) { - DVLOG(1) << "X Input extension not available."; + VLOG(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) { - DVLOG(1) << "XInput2 not supported in the server."; + VLOG(1) << "XInput2 not supported in the server."; xiopcode = -1; return; } #if defined(USE_XI2_MT) if (major < 2 || (major == 2 && minor < USE_XI2_MT)) { - DVLOG(1) << "XI version on server is " << major << "." << minor << ". " + VLOG(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(); - DCHECK(display) << "Unable to get connection to X server"; + CHECK(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) { - DVLOG(1) << "Event (" << xev->type << ") not handled."; + VLOG(1) << "Event (" << xev->type << ") not handled."; } DidProcessXEvent(xev); } diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc index 7077b09..484d095 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)) { - DLOG(ERROR) << "Pickle error decoding Histogram: " << histogram_name; + LOG(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) { - DLOG(ERROR) << "Values error decoding Histogram: " << histogram_name; + LOG(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 { - DLOG(ERROR) << "Error Deserializing Histogram Unknown histogram_type: " - << histogram_type; + LOG(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); - DLOG(INFO) << output; + LOG(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); - DLOG(INFO) << output; + LOG(INFO) << output; } // Clean up. HistogramMap* histograms = NULL; diff --git a/base/metrics/stats_table.cc b/base/metrics/stats_table.cc index 2bccc90..3db008e 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_) - DPLOG(ERROR) << "StatsTable did not initialize"; + PLOG(ERROR) << "StatsTable did not initialize"; } StatsTable::~StatsTable() { diff --git a/base/mime_util_xdg.cc b/base/mime_util_xdg.cc index 294638d..a25a0d5 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) { - DLOG(WARNING) << "Invalid index.theme: blank subdir"; + LOG(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) { - DLOG(WARNING) << "Invalid index.theme: blank subdir"; + LOG(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 4b82ff4..bcc4ffb 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) { - DLOG(ERROR) << "dlclose failed: " << dlerror(); + LOG(ERROR) << "dlclose failed: " << dlerror(); NOTREACHED(); } } diff --git a/base/process_linux.cc b/base/process_linux.cc index 3f78a31..dfdc20e 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) { - DLOG(ERROR) << "Failed to lower priority, errno: " << errno; + LOG(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 2f433d9..f9d151b 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) { - DPLOG(ERROR) << "opendir(" << path.value() << ")"; + PLOG(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)) - DLOG(WARNING) << "Failed to get process stats."; + LOG(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)) - DLOG(WARNING) << "Failed to get process stats."; + LOG(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)) - DLOG(WARNING) << "Failed to get process stats."; + LOG(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)) - DLOG(WARNING) << "Failed to get process stats."; + LOG(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)) { - DLOG(WARNING) << "Failed to open /proc/meminfo."; + LOG(WARNING) << "Failed to open /proc/meminfo."; return false; } std::vector<std::string> meminfo_fields; SplitStringAlongWhitespace(meminfo_data, &meminfo_fields); if (meminfo_fields.size() < kMemCachedIndex) { - DLOG(WARNING) << "Failed to parse /proc/meminfo. Only found " << + LOG(WARNING) << "Failed to parse /proc/meminfo. Only found " << meminfo_fields.size() << " fields."; return false; } @@ -752,8 +752,7 @@ 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); - DVLOG(1) << "Adjusting oom_score_adj of " << process << " to " - << score_str; + VLOG(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(), @@ -766,7 +765,7 @@ bool AdjustOOMScore(ProcessId process, int score) { if (file_util::PathExists(oom_file)) { std::string score_str = base::IntToString( score * kMaxOldOomScore / kMaxOomScore); - DVLOG(1) << "Adjusting oom_adj of " << process << " to " << score_str; + VLOG(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 38203d8..e364d1b 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) { - DLOG(ERROR) << "failed to get the size needed for the process list"; + LOG(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) { - DLOG(ERROR) << "failed to get the process list"; + LOG(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) { - DLOG(ERROR) << "failed to collect the process list in a few tries"; + LOG(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) { - DLOG(ERROR) << "command line data didn't match expected format"; + LOG(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) { - DPLOG(ERROR) << "sysctlbyname(""sysctl.proc_cputype"")"; + PLOG(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) { - DLOG(ERROR) << "Invalid process"; + LOG(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) { - DLOG(ERROR) << "Calling mach_vm_region failed with error: " + LOG(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) { - DLOG(ERROR) << "Failed to fetch host page size, error: " + LOG(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) { - DLOG(WARNING) << "Failed to fetch host statistics."; + LOG(WARNING) << "Failed to fetch host statistics."; return 0; } vm_size_t page_size; kr = host_page_size(host, &page_size); if (kr) { - DLOG(ERROR) << "Failed to fetch host page size."; + LOG(ERROR) << "Failed to fetch host page size."; return 0; } @@ -497,7 +497,7 @@ const char* LookUpLibCPath() { if (dladdr(addr, &info)) return info.dli_fname; - DLOG(WARNING) << "Could not find image path for malloc()"; + LOG(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(); - DLOG(ERROR) << + LOG(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) { - DLOG(WARNING) << "Could not find malloc_error_break"; + LOG(WARNING) << "Could not find malloc_error_break"; return; } @@ -566,7 +566,7 @@ void EnableTerminationOnHeapCorruption() { (void**)&g_original_malloc_error_break); if (err != err_none) - DLOG(WARNING) << "Could not override malloc_error_break; error = " << err; + LOG(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) { - DPLOG(ERROR) << "sysctl"; + PLOG(ERROR) << "sysctl"; return -1; } if (length == 0) diff --git a/base/process_util_openbsd.cc b/base/process_util_openbsd.cc index d76e68f..b442e93 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) { - DLOG(ERROR) << "failed to get the size needed for the process list"; + LOG(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) { - DLOG(ERROR) << "failed to get the process list"; + LOG(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) { - DDLOG(ERROR) << "failed to collect the process list in a few tries"; + LOG(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) { - DLOG(ERROR) << "command line data didn't match expected format"; + LOG(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 055edcc..06fa779 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(); - DLOG(ERROR) << "Received signal " << signal; + LOG(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) - DPLOG(ERROR) << "Unable to terminate process group " << process_group_id; + PLOG(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. - DCHECK(!options.wait); + CHECK(!options.wait); // Create the pipe used for synchronization. if (HANDLE_EINTR(pipe(synchronization_pipe_fds)) != 0) { - DPLOG(ERROR) << "pipe"; + PLOG(ERROR) << "pipe"; return false; } @@ -594,7 +594,7 @@ bool LaunchProcess(const std::vector<std::string>& argv, } if (pid < 0) { - DPLOG(ERROR) << "fork"; + PLOG(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) { - DPLOG(ERROR) << "write"; + PLOG(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) { - DPLOG(ERROR) << "waitpid(" << handle << ")"; + PLOG(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) { - DPLOG(ERROR) << "kqueue"; + PLOG(ERROR) << "kqueue"; return false; } file_util::ScopedFD kq_closer(&kq); @@ -888,7 +888,7 @@ static bool WaitForSingleNonChildProcess(ProcessHandle handle, return true; } - DPLOG(ERROR) << "kevent (setup " << handle << ")"; + PLOG(ERROR) << "kevent (setup " << handle << ")"; return false; } @@ -928,11 +928,11 @@ static bool WaitForSingleNonChildProcess(ProcessHandle handle, } if (result < 0) { - DPLOG(ERROR) << "kevent (wait " << handle << ")"; + PLOG(ERROR) << "kevent (wait " << handle << ")"; return false; } else if (result > 1) { - DLOG(ERROR) << "kevent (wait " << handle << "): unexpected result " - << result; + LOG(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)) { - DLOG(ERROR) << "kevent (wait " << handle - << "): unexpected event: filter=" << event.filter - << ", fflags=" << event.fflags - << ", ident=" << event.ident; + LOG(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 85aeace..c6ce3f5 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)) { - DLOG(ERROR) << "Could not AssignProcessToObject."; + LOG(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))) { - DLOG(ERROR) << "Failed to fetch internal performance info."; + LOG(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 f23330a..43dfd1e 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); - DCHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno; + CHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno; } ~URandomFd() { diff --git a/base/scoped_temp_dir.cc b/base/scoped_temp_dir.cc index 6a51d6d..fc886e5a 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()) - DLOG(WARNING) << "Could not delete temp dir in dtor."; + LOG(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 { - DLOG(ERROR) << "ScopedTempDir unable to delete " << path_.value(); + LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value(); } return ret; diff --git a/base/sha1_win.cc b/base/sha1_win.cc index 626f41b..2edfb3d 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)) { - DLOG(ERROR) << "CryptAcquireContext failed: " << GetLastError(); + LOG(ERROR) << "CryptAcquireContext failed: " << GetLastError(); return std::string(kSHA1Length, '\0'); } { ScopedHCRYPTHASH hash; if (!CryptCreateHash(provider, CALG_SHA1, 0, 0, hash.receive())) { - DLOG(ERROR) << "CryptCreateHash failed: " << GetLastError(); + LOG(ERROR) << "CryptCreateHash failed: " << GetLastError(); return std::string(kSHA1Length, '\0'); } if (!CryptHashData(hash, reinterpret_cast<CONST BYTE*>(str.data()), static_cast<DWORD>(str.length()), 0)) { - DLOG(ERROR) << "CryptHashData failed: " << GetLastError(); + LOG(ERROR) << "CryptHashData failed: " << GetLastError(); return std::string(kSHA1Length, '\0'); } @@ -40,8 +40,7 @@ std::string SHA1HashString(const std::string& str) { if (!CryptGetHashParam(hash, HP_HASHSIZE, reinterpret_cast<unsigned char*>(&hash_len), &buffer_size, 0)) { - DLOG(ERROR) << "CryptGetHashParam(HP_HASHSIZE) failed: " - << GetLastError(); + LOG(ERROR) << "CryptGetHashParam(HP_HASHSIZE) failed: " << GetLastError(); return std::string(kSHA1Length, '\0'); } @@ -51,14 +50,13 @@ 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))) { - DLOG(ERROR) << "CryptGetHashParam(HP_HASHVAL) failed: " - << GetLastError(); + LOG(ERROR) << "CryptGetHashParam(HP_HASHVAL) failed: " << GetLastError(); return std::string(kSHA1Length, '\0'); } if (hash_len != kSHA1Length) { - DLOG(ERROR) << "Returned hash value is wrong length: " << hash_len - << " should be " << kSHA1Length; + LOG(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 3e5699a..942a04c 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) - DPLOG(ERROR) << "close"; + PLOG(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 3e5ad36..526132c 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) { - DPLOG(ERROR) << "Could not create mutex."; + PLOG(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 f50d20b..82ad91c 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) - DPLOG(ERROR) << "close"; + PLOG(ERROR) << "close"; } if (handles[1] != kInvalidHandle) { if (HANDLE_EINTR(close(handles[1])) < 0) - DPLOG(ERROR) << "close"; + PLOG(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) - DPLOG(ERROR) << "close"; + PLOG(ERROR) << "close"; handle_ = kInvalidHandle; return (retval == 0); } diff --git a/base/synchronization/condition_variable_win.cc b/base/synchronization/condition_variable_win.cc index 7b9919a..3030178 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_++; - DCHECK(cv_event->handle()); + CHECK(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); - DCHECK(handle_); + CHECK(handle_); } // Methods for use on lists. diff --git a/base/system_monitor/system_monitor.cc b/base/system_monitor/system_monitor.cc index 5131fbf..2631789 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() { - DVLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off") - << " battery"; + VLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off") + << " battery"; observer_list_->Notify(&PowerObserver::OnPowerStateChange, BatteryPower()); } void SystemMonitor::NotifySuspend() { - DVLOG(1) << "Power Suspending"; + VLOG(1) << "Power Suspending"; observer_list_->Notify(&PowerObserver::OnSuspend); } void SystemMonitor::NotifyResume() { - DVLOG(1) << "Power Resuming"; + VLOG(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 a8cd54a..84f2b2e 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)) { - DLOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError(); + LOG(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 7145e51..903b475 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)) { - DLOG(ERROR) << "failed to get size of " << file.value(); + LOG(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) { - DLOG(WARNING) << "file size is zero, will not attempt to map to memory"; + LOG(WARNING) << "file size is zero, will not attempt to map to memory"; return true; } file_util::MemoryMappedFile mapped_file; if (!mapped_file.Initialize(file)) { - DLOG(WARNING) << "failed to memory map " << file.value(); + LOG(WARNING) << "failed to memory map " << file.value(); return false; } if (msync(const_cast<uint8*>(mapped_file.data()), mapped_file.length(), MS_INVALIDATE) != 0) { - DLOG(WARNING) << "failed to invalidate memory map of " << file.value() - << ", errno: " << errno; + LOG(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 0096c9e..cca17b59 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) { - DLOG(ERROR) << "CopyRecursiveDirNoCache() couldn't stat source directory: " - << source_dir.value() << " errno = " << errno; + LOG(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) { - DLOG(ERROR) << "CopyRecursiveDirNoCache() couldn't create directory: " - << target_path.value() << " errno = " << errno; + LOG(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 { - DLOG(ERROR) << "CopyRecursiveDirNoCache() couldn't create file: " - << target_path.value(); + LOG(ERROR) << "CopyRecursiveDirNoCache() couldn't create file: " << + target_path.value(); success = false; } } else { - DLOG(WARNING) << "CopyRecursiveDirNoCache() skipping non-regular file: " - << current.value(); + LOG(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 3236278..01efe28 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() { - DCHECK(CalledOnValidThread()); + CHECK(CalledOnValidThread()); } void DetachFromThread() { diff --git a/base/threading/platform_thread_mac.mm b/base/threading/platform_thread_mac.mm index ef807eb..cff7a1f 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) - DVLOG(1) << "thread_policy_set() failure: " << result; + VLOG(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) { - DVLOG(1) << "thread_policy_set() failure: " << result; + VLOG(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) { - DVLOG(1) << "thread_policy_set() failure: " << result; + VLOG(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) - DVLOG(1) << "thread_policy_set() failure: " << result; + VLOG(1) << "thread_policy_set() failure: " << result; return; } diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc index e6b8e64..d1fb7bb 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) - DLOG(ERROR) << "pthread_setname_np: " << safe_strerror(err); + LOG(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) - DPLOG(ERROR) << "prctl(PR_SET_NAME)"; + PLOG(ERROR) << "prctl(PR_SET_NAME)"; } } #elif defined(OS_MACOSX) diff --git a/base/threading/simple_thread.cc b/base/threading/simple_thread.cc index a5dd763..4441477 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_); - DCHECK(success); + CHECK(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 e1e5715..2808048 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() { - DCHECK(CalledOnValidThread()); + CHECK(CalledOnValidThread()); } void DetachFromThread() { diff --git a/base/threading/thread_local_posix.cc b/base/threading/thread_local_posix.cc index 4951006..2071ad8 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); - DCHECK_EQ(error, 0); + CHECK_EQ(error, 0); } } // namespace internal diff --git a/base/threading/thread_local_win.cc b/base/threading/thread_local_win.cc index 32cceeb..56d3a3a 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)) { - DLOG(FATAL) << "Failed to TlsSetValue()."; + LOG(FATAL) << "Failed to TlsSetValue()."; } } diff --git a/base/vlog.cc b/base/vlog.cc index 332de38..41bf2a5 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 { - DLOG(WARNING) << "Could not parse v switch \"" << v_switch << "\""; + LOG(WARNING) << "Could not parse v switch \"" << v_switch << "\""; } } std::vector<KVPair> kv_pairs; if (!base::SplitStringIntoKeyValuePairs( vmodule_switch, '=', ',', &kv_pairs)) { - DLOG(WARNING) << "Could not fully parse vmodule switch \"" - << vmodule_switch << "\""; + LOG(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)) { - DLOG(WARNING) << "Parsed vlog level for \"" - << it->first << "=" << it->second - << "\" as " << pattern.vlog_level; + LOG(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 9e523a1..59480f2 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 { - DVLOG(2) << "MUI not available."; + VLOG(2) << "MUI not available."; } } else { NOTREACHED() << "kernel32.dll not found."; |