Commit ad1e8c96 authored by mostynb's avatar mostynb Committed by Commit bot

favor DCHECK_CURRENTLY_ON for better logs in components/

BUG=466848

Review URL: https://codereview.chromium.org/1004933003

Cr-Commit-Position: refs/heads/master@{#322240}
parent 558ef66f
......@@ -35,7 +35,7 @@ CrashDumpManager* CrashDumpManager::GetInstance() {
CrashDumpManager::CrashDumpManager(const base::FilePath& crash_dump_dir)
: crash_dump_dir_(crash_dump_dir) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!instance_);
instance_ = this;
......@@ -83,7 +83,7 @@ base::File CrashDumpManager::CreateMinidumpFile(int child_process_id) {
// static
void CrashDumpManager::ProcessMinidump(const base::FilePath& minidump_path,
base::ProcessHandle pid) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
CHECK(instance_);
int64 file_size = 0;
int r = base::GetFileSize(minidump_path, &file_size);
......
......@@ -402,7 +402,7 @@ void CrashHandlerHostLinux::WriteDumpFile(scoped_ptr<BreakpadInfo> info,
void CrashHandlerHostLinux::QueueCrashDumpTask(scoped_ptr<BreakpadInfo> info,
int signal_fd) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_CURRENTLY_ON(BrowserThread::IO);
// Send the done signal to the process: it can exit now.
struct msghdr msg = {0};
......
......@@ -44,7 +44,7 @@ void FeedbackData::OnFeedbackPageDataComplete() {
void FeedbackData::SetAndCompressSystemInfo(
scoped_ptr<FeedbackData::SystemLogsMap> sys_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (trace_id_ != 0) {
TracingManager* manager = TracingManager::Get();
......@@ -70,7 +70,7 @@ void FeedbackData::SetAndCompressSystemInfo(
void FeedbackData::SetAndCompressHistograms(
scoped_ptr<std::string> histograms) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!histograms.get())
return;
......@@ -87,7 +87,7 @@ void FeedbackData::SetAndCompressHistograms(
void FeedbackData::AttachAndCompressFileData(
scoped_ptr<std::string> attached_filedata) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!attached_filedata.get() || attached_filedata->empty())
return;
......@@ -107,7 +107,7 @@ void FeedbackData::AttachAndCompressFileData(
void FeedbackData::OnGetTraceData(
int trace_id,
scoped_refptr<base::RefCountedString> trace_data) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
TracingManager* manager = TracingManager::Get();
if (manager)
manager->DiscardTraceData(trace_id);
......@@ -124,7 +124,7 @@ void FeedbackData::OnGetTraceData(
}
void FeedbackData::OnCompressComplete() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
--pending_op_count_;
SendReport();
}
......@@ -134,7 +134,7 @@ bool FeedbackData::IsDataComplete() {
}
void FeedbackData::SendReport() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (IsDataComplete() && !report_sent_) {
report_sent_ = true;
send_report_.Run(this);
......
......@@ -54,23 +54,23 @@ class TrackingSynchronizer::RequestContext {
~RequestContext() {}
void SetReceivedProcessGroupCount(bool done) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
received_process_group_count_ = done;
}
// Methods for book keeping of processes_pending_.
void IncrementProcessesPending() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
++processes_pending_;
}
void AddProcessesPending(int processes_pending) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
processes_pending_ += processes_pending;
}
void DecrementProcessesPending() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
--processes_pending_;
}
......@@ -79,7 +79,7 @@ class TrackingSynchronizer::RequestContext {
// |processes_pending_| are zero, then delete the current object by calling
// Unregister.
void DeleteIfAllDone() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (processes_pending_ <= 0 && received_process_group_count_)
RequestContext::Unregister(sequence_number_);
......@@ -90,7 +90,7 @@ class TrackingSynchronizer::RequestContext {
static RequestContext* Register(
int sequence_number,
const base::WeakPtr<TrackingSynchronizerObserver>& callback_object) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContext* request = new RequestContext(
callback_object, sequence_number);
......@@ -102,7 +102,7 @@ class TrackingSynchronizer::RequestContext {
// Find the |RequestContext| in |outstanding_requests_| map for the given
// |sequence_number|.
static RequestContext* GetRequestContext(int sequence_number) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContextMap::iterator it =
outstanding_requests_.Get().find(sequence_number);
......@@ -118,7 +118,7 @@ class TrackingSynchronizer::RequestContext {
// |outstanding_requests_| map. This method is called when all changes have
// been acquired, or when the wait time expires (whichever is sooner).
static void Unregister(int sequence_number) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContextMap::iterator it =
outstanding_requests_.Get().find(sequence_number);
......@@ -198,7 +198,7 @@ TrackingSynchronizer::~TrackingSynchronizer() {
// static
void TrackingSynchronizer::FetchProfilerDataAsynchronously(
const base::WeakPtr<TrackingSynchronizerObserver>& callback_object) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!g_tracking_synchronizer) {
// System teardown is happening.
......@@ -219,7 +219,7 @@ void TrackingSynchronizer::FetchProfilerDataAsynchronously(
void TrackingSynchronizer::OnPendingProcesses(int sequence_number,
int pending_processes,
bool end) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContext* request = RequestContext::GetRequestContext(sequence_number);
if (!request)
......@@ -233,14 +233,14 @@ void TrackingSynchronizer::OnProfilerDataCollected(
int sequence_number,
const tracked_objects::ProcessDataSnapshot& profiler_data,
int process_type) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DecrementPendingProcessesAndSendData(sequence_number, profiler_data,
process_type);
}
int TrackingSynchronizer::RegisterAndNotifyAllProcesses(
const base::WeakPtr<TrackingSynchronizerObserver>& callback_object) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
int sequence_number = GetNextAvailableSequenceNumber();
......@@ -266,7 +266,7 @@ void TrackingSynchronizer::DecrementPendingProcessesAndSendData(
int sequence_number,
const tracked_objects::ProcessDataSnapshot& profiler_data,
int process_type) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestContext* request = RequestContext::GetRequestContext(sequence_number);
if (!request)
......@@ -283,7 +283,7 @@ void TrackingSynchronizer::DecrementPendingProcessesAndSendData(
}
int TrackingSynchronizer::GetNextAvailableSequenceNumber() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
++last_used_sequence_number_;
......
......@@ -49,7 +49,7 @@ void DoRegisterOpenedNaClExecutableFile(
IPC::Message* reply_msg,
WriteFileInfoReply write_reply_message) {
// IO thread owns the NaClBrowser singleton.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_CURRENTLY_ON(BrowserThread::IO);
nacl::NaClBrowser* nacl_browser = nacl::NaClBrowser::GetInstance();
uint64 file_token_lo = 0;
......
......@@ -147,7 +147,7 @@ void PnaclHost::OnCacheInitialized(int net_error) {
void PnaclHost::Init() {
// Extra check that we're on the real IO thread since this version of
// Init isn't used in unit tests.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(thread_checker_.CalledOnValidThread());
base::FilePath cache_path(GetCachePath());
if (cache_path.empty() || cache_state_ != CacheUninitialized)
......
......@@ -32,7 +32,7 @@ const void* kInterceptNavigationDelegateUserDataKey =
bool CheckIfShouldIgnoreNavigationOnUIThread(WebContents* source,
const NavigationParams& params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(source);
InterceptNavigationDelegate* intercept_navigation_delegate =
......
......@@ -73,7 +73,7 @@ InterceptNavigationResourceThrottle::InterceptNavigationResourceThrottle(
}
InterceptNavigationResourceThrottle::~InterceptNavigationResourceThrottle() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_CURRENTLY_ON(BrowserThread::IO);
}
void InterceptNavigationResourceThrottle::WillStartRequest(bool* defer) {
......@@ -134,7 +134,7 @@ bool InterceptNavigationResourceThrottle::CheckIfShouldIgnoreNavigation(
void InterceptNavigationResourceThrottle::OnResultObtained(
bool should_ignore_navigation) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (should_ignore_navigation) {
controller()->CancelAndIgnore();
......
......@@ -55,7 +55,7 @@ bool PrecacheManager::IsPrecachingEnabled() {
}
bool PrecacheManager::IsPrecachingAllowed() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
return user_prefs::UserPrefs::Get(browser_context_)->GetBoolean(
data_reduction_proxy::prefs::kDataReductionProxyEnabled);
}
......@@ -63,7 +63,7 @@ bool PrecacheManager::IsPrecachingAllowed() {
void PrecacheManager::StartPrecaching(
const PrecacheCompletionCallback& precache_completion_callback,
URLListProvider* url_list_provider) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (is_precaching_) {
DLOG(WARNING) << "Cannot start precaching because precaching is already "
......@@ -84,7 +84,7 @@ void PrecacheManager::StartPrecaching(
}
void PrecacheManager::CancelPrecaching() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!is_precaching_) {
// Do nothing if precaching is not in progress.
......@@ -100,7 +100,7 @@ void PrecacheManager::CancelPrecaching() {
}
bool PrecacheManager::IsPrecaching() const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
return is_precaching_;
}
......@@ -108,7 +108,7 @@ void PrecacheManager::RecordStatsForFetch(const GURL& url,
const base::Time& fetch_time,
int64 size,
bool was_cached) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (size == 0 || url.is_empty() || !url.SchemeIsHTTPOrHTTPS()) {
// Ignore empty responses, empty URLs, or URLs that aren't HTTP or HTTPS.
......@@ -142,7 +142,7 @@ void PrecacheManager::Shutdown() {
}
void PrecacheManager::OnDone() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// If OnDone has been called, then we should just be finishing precaching.
DCHECK(is_precaching_);
......@@ -156,7 +156,7 @@ void PrecacheManager::OnDone() {
}
void PrecacheManager::OnURLsReceived(const std::list<GURL>& urls) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!is_precaching_) {
// Don't start precaching if it was canceled while waiting for the list of
......
......@@ -55,7 +55,7 @@ base::FilePath::StringType FindRemovableStorageLocationById(
}
void FilterAttachedDevicesOnFileThread(MediaStorageUtil::DeviceIdSet* devices) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
MediaStorageUtil::DeviceIdSet missing_devices;
for (MediaStorageUtil::DeviceIdSet::const_iterator it = devices->begin();
......
......@@ -115,7 +115,7 @@ void StorageMonitorCros::Init() {
}
void StorageMonitorCros::CheckExistingMountPoints() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
const DiskMountManager::MountPointMap& mount_point_map =
DiskMountManager::GetInstance()->mount_points();
for (DiskMountManager::MountPointMap::const_iterator it =
......@@ -148,7 +148,7 @@ void StorageMonitorCros::OnMountEvent(
DiskMountManager::MountEvent event,
chromeos::MountError error_code,
const DiskMountManager::MountPointInfo& mount_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Ignore mount points that are not devices.
if (mount_info.mount_type != chromeos::MOUNT_TYPE_DEVICE)
......@@ -277,7 +277,7 @@ StorageMonitorCros::media_transfer_protocol_manager() {
void StorageMonitorCros::AddMountedPath(
const DiskMountManager::MountPointInfo& mount_info,
bool has_dcim) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (ContainsKey(mount_map_, mount_info.mount_path)) {
// CheckExistingMountPointsOnUIThread() added the mount point information
......
......@@ -119,7 +119,7 @@ uint64 GetDeviceStorageSize(const base::FilePath& device_path,
// Gets the device information using udev library.
scoped_ptr<StorageInfo> GetDeviceInfo(const base::FilePath& device_path,
const base::FilePath& mount_point) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DCHECK(!device_path.empty());
scoped_ptr<StorageInfo> storage_info;
......@@ -198,7 +198,7 @@ scoped_ptr<StorageInfo> GetDeviceInfo(const base::FilePath& device_path,
MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread(
const base::FilePath& mtab_path,
base::WeakPtr<MtabWatcherLinux::Delegate> delegate) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
// Owned by caller.
return new MtabWatcherLinux(mtab_path, delegate);
}
......@@ -206,7 +206,7 @@ MtabWatcherLinux* CreateMtabWatcherLinuxOnFileThread(
StorageMonitor::EjectStatus EjectPathOnFileThread(
const base::FilePath& path,
const base::FilePath& device) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
// Note: Linux LSB says umount should exist in /bin.
static const char kUmountBinary[] = "/bin/umount";
......@@ -244,11 +244,11 @@ StorageMonitorLinux::StorageMonitorLinux(const base::FilePath& path)
: mtab_path_(path),
get_device_info_callback_(base::Bind(&GetDeviceInfo)),
weak_ptr_factory_(this) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
StorageMonitorLinux::~StorageMonitorLinux() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
void StorageMonitorLinux::Init() {
......@@ -278,7 +278,7 @@ bool StorageMonitorLinux::GetStorageInfoForPath(
const base::FilePath& path,
StorageInfo* device_info) const {
DCHECK(device_info);
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// TODO(thestig) |media_transfer_protocol_device_observer_| should always be
// valid.
......@@ -359,12 +359,12 @@ void StorageMonitorLinux::EjectDevice(
}
void StorageMonitorLinux::OnMtabWatcherCreated(MtabWatcherLinux* watcher) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
mtab_watcher_.reset(watcher);
}
void StorageMonitorLinux::UpdateMtab(const MountPointDeviceMap& new_mtab) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Check existing mtab entries for unaccounted mount points.
// These mount points must have been removed in the new mtab.
......@@ -465,14 +465,14 @@ void StorageMonitorLinux::UpdateMtab(const MountPointDeviceMap& new_mtab) {
bool StorageMonitorLinux::IsDeviceAlreadyMounted(
const base::FilePath& mount_device) const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
return ContainsKey(mount_priority_map_, mount_device);
}
void StorageMonitorLinux::HandleDeviceMountedMultipleTimes(
const base::FilePath& mount_device,
const base::FilePath& mount_point) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
MountPriorityMap::iterator priority = mount_priority_map_.find(mount_device);
DCHECK(priority != mount_priority_map_.end());
......@@ -484,7 +484,7 @@ void StorageMonitorLinux::HandleDeviceMountedMultipleTimes(
void StorageMonitorLinux::AddNewMount(const base::FilePath& mount_device,
scoped_ptr<StorageInfo> storage_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!storage_info)
return;
......
......@@ -351,7 +351,7 @@ base::FilePath VolumeMountWatcherWin::DriveNumberToFilePath(int drive_number) {
// c) Retrieve metadata on the volumes and then
// d) Notify that metadata to listeners.
void VolumeMountWatcherWin::Init() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// When VolumeMountWatcherWin is created, the message pumps are not running
// so a posted task from the constructor would never run. Therefore, do all
......@@ -364,7 +364,7 @@ void VolumeMountWatcherWin::Init() {
void VolumeMountWatcherWin::AddDevicesOnUIThread(
std::vector<base::FilePath> removable_devices) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
for (size_t i = 0; i < removable_devices.size(); i++) {
if (ContainsKey(pending_device_checks_, removable_devices[i]))
......@@ -400,7 +400,7 @@ void VolumeMountWatcherWin::RetrieveInfoForDeviceAndAdd(
void VolumeMountWatcherWin::DeviceCheckComplete(
const base::FilePath& device_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
pending_device_checks_.erase(device_path);
if (pending_device_checks_.size() == 0) {
......@@ -421,7 +421,7 @@ VolumeMountWatcherWin::GetDeviceDetailsCallbackType
bool VolumeMountWatcherWin::GetDeviceInfo(const base::FilePath& device_path,
StorageInfo* info) const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(info);
base::FilePath path(device_path);
MountPointDeviceMetadataMap::const_iterator iter =
......@@ -439,7 +439,7 @@ bool VolumeMountWatcherWin::GetDeviceInfo(const base::FilePath& device_path,
}
void VolumeMountWatcherWin::OnWindowMessage(UINT event_type, LPARAM data) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
switch (event_type) {
case DBT_DEVICEARRIVAL: {
if (IsLogicalVolumeStructure(data)) {
......@@ -504,7 +504,7 @@ VolumeMountWatcherWin::~VolumeMountWatcherWin() {
void VolumeMountWatcherWin::HandleDeviceAttachEventOnUIThread(
const base::FilePath& device_path,
const StorageInfo& info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
device_metadata_[device_path] = info;
......@@ -516,7 +516,7 @@ void VolumeMountWatcherWin::HandleDeviceAttachEventOnUIThread(
void VolumeMountWatcherWin::HandleDeviceDetachEventOnUIThread(
const base::string16& device_location) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
MountPointDeviceMetadataMap::const_iterator device_info =
device_metadata_.find(base::FilePath(device_location));
......@@ -532,7 +532,7 @@ void VolumeMountWatcherWin::HandleDeviceDetachEventOnUIThread(
void VolumeMountWatcherWin::EjectDevice(
const std::string& device_id,
base::Callback<void(StorageMonitor::EjectStatus)> callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::FilePath device = MediaStorageUtil::FindDevicePathById(device_id);
if (device.empty()) {
callback.Run(StorageMonitor::EJECT_FAILURE);
......
......@@ -344,7 +344,7 @@ void WallpaperManagerBase::ClearDisposableWallpaperCache() {
}
bool WallpaperManagerBase::GetLoggedInUserWallpaperInfo(WallpaperInfo* info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (user_manager::UserManager::Get()->IsLoggedInAsStub()) {
info->location = current_user_wallpaper_info_.location = "";
......@@ -683,7 +683,7 @@ void WallpaperManagerBase::NotifyAnimationFinished() {
bool WallpaperManagerBase::GetWallpaperFromCache(const std::string& user_id,
gfx::ImageSkia* image) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
CustomWallpaperMap::const_iterator it = wallpaper_cache_.find(user_id);
if (it != wallpaper_cache_.end() && !(*it).second.second.isNull()) {
*image = (*it).second.second;
......@@ -694,7 +694,7 @@ bool WallpaperManagerBase::GetWallpaperFromCache(const std::string& user_id,
bool WallpaperManagerBase::GetPathFromCache(const std::string& user_id,
base::FilePath* path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
CustomWallpaperMap::const_iterator it = wallpaper_cache_.find(user_id);
if (it != wallpaper_cache_.end()) {
*path = (*it).second.first;
......@@ -709,7 +709,7 @@ int WallpaperManagerBase::loaded_wallpapers_for_test() const {
void WallpaperManagerBase::CacheUsersWallpapers() {
// TODO(dpolukhin): crbug.com/408734.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
user_manager::UserList users = user_manager::UserManager::Get()->GetUsers();
if (!users.empty()) {
......@@ -943,7 +943,7 @@ void WallpaperManagerBase::OnCustomizedDefaultWallpaperDecoded(
const GURL& wallpaper_url,
scoped_ptr<CustomizedWallpaperRescaledFiles> rescaled_files,
const user_manager::UserImage& wallpaper) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// If decoded wallpaper is empty, we have probably failed to decode the file.
if (wallpaper.image().isNull()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment