Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: content/browser/device_monitor_mac.mm

Issue 1008613002: favor DCHECK_CURRENTLY_ON for better logs in content/browser/[a-d]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/cross_site_transfer_browsertest.cc ('k') | content/browser/device_monitor_udev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/device_monitor_mac.mm
diff --git a/content/browser/device_monitor_mac.mm b/content/browser/device_monitor_mac.mm
index 2faea0ed7e65df6ce509db280475b3d4ccf2a416..c3c713c5714154547c99c9f860a85e9b91640ef3 100644
--- a/content/browser/device_monitor_mac.mm
+++ b/content/browser/device_monitor_mac.mm
@@ -283,12 +283,12 @@ class SuspendObserverDelegate :
SuspendObserverDelegate::SuspendObserverDelegate(DeviceMonitorMacImpl* monitor)
: avfoundation_monitor_impl_(monitor) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
void SuspendObserverDelegate::StartObserver(
const scoped_refptr<base::SingleThreadTaskRunner>& device_thread) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::Closure on_device_changed_callback =
base::Bind(&SuspendObserverDelegate::OnDeviceChanged,
@@ -308,7 +308,7 @@ void SuspendObserverDelegate::StartObserver(
void SuspendObserverDelegate::OnDeviceChanged(
const scoped_refptr<base::SingleThreadTaskRunner>& device_thread) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Enumerate the devices in Device thread and post the consolidation of the
// new devices and the old ones to be done on UI thread. The devices array
// is retained in |device_thread| and released in DoOnDeviceChanged().
@@ -320,17 +320,17 @@ void SuspendObserverDelegate::OnDeviceChanged(
}
void SuspendObserverDelegate::ResetDeviceMonitor() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
avfoundation_monitor_impl_ = NULL;
[suspend_observer_ clearOnDeviceChangedCallback];
}
SuspendObserverDelegate::~SuspendObserverDelegate() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
void SuspendObserverDelegate::DoStartObserver(NSArray* devices) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::scoped_nsobject<NSArray> auto_release(devices);
for (CrAVCaptureDevice* device in devices) {
base::scoped_nsobject<CrAVCaptureDevice> device_ptr([device retain]);
@@ -339,7 +339,7 @@ void SuspendObserverDelegate::DoStartObserver(NSArray* devices) {
}
void SuspendObserverDelegate::DoOnDeviceChanged(NSArray* devices) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::scoped_nsobject<NSArray> auto_release(devices);
std::vector<DeviceInfo> snapshot_devices;
for (CrAVCaptureDevice* device in devices) {
@@ -404,7 +404,7 @@ AVFoundationMonitorImpl::AVFoundationMonitorImpl(
: DeviceMonitorMacImpl(monitor),
device_task_runner_(device_task_runner),
suspend_observer_delegate_(new SuspendObserverDelegate(this)) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
device_arrival_ =
[nc addObserverForName:AVFoundationGlue::
@@ -424,7 +424,7 @@ AVFoundationMonitorImpl::AVFoundationMonitorImpl(
}
AVFoundationMonitorImpl::~AVFoundationMonitorImpl() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
suspend_observer_delegate_->ResetDeviceMonitor();
NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
[nc removeObserver:device_arrival_];
@@ -432,7 +432,7 @@ AVFoundationMonitorImpl::~AVFoundationMonitorImpl() {
}
void AVFoundationMonitorImpl::OnDeviceChanged() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
suspend_observer_delegate_->OnDeviceChanged(device_task_runner_);
}
@@ -441,7 +441,7 @@ void AVFoundationMonitorImpl::OnDeviceChanged() {
@implementation CrAVFoundationDeviceObserver
- (id)initWithOnChangedCallback:(const base::Closure&)callback {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if ((self = [super init])) {
DCHECK(!callback.is_null());
onDeviceChangedCallback_ = callback;
@@ -450,7 +450,7 @@ void AVFoundationMonitorImpl::OnDeviceChanged() {
}
- (void)dealloc {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::set<base::scoped_nsobject<CrAVCaptureDevice> >::iterator it =
monitoredDevices_.begin();
while (it != monitoredDevices_.end())
@@ -459,7 +459,7 @@ void AVFoundationMonitorImpl::OnDeviceChanged() {
}
- (void)startObserving:(base::scoped_nsobject<CrAVCaptureDevice>)device {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(device != nil);
// Skip this device if there are already observers connected to it.
if (std::find(monitoredDevices_.begin(), monitoredDevices_.end(), device) !=
@@ -478,7 +478,7 @@ void AVFoundationMonitorImpl::OnDeviceChanged() {
}
- (void)stopObserving:(CrAVCaptureDevice*)device {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(device != nil);
std::set<base::scoped_nsobject<CrAVCaptureDevice> >::iterator found =
@@ -489,12 +489,12 @@ void AVFoundationMonitorImpl::OnDeviceChanged() {
}
- (void)clearOnDeviceChangedCallback {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
onDeviceChangedCallback_.Reset();
}
- (void)removeObservers:(CrAVCaptureDevice*)device {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Check sanity of |device| via its -observationInfo. http://crbug.com/371271.
if ([device observationInfo]) {
[device removeObserver:self
@@ -508,7 +508,7 @@ void AVFoundationMonitorImpl::OnDeviceChanged() {
ofObject:(id)object
change:(NSDictionary*)change
context:(void*)context {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if ([keyPath isEqual:@"suspended"])
onDeviceChangedCallback_.Run();
if ([keyPath isEqual:@"connected"])
« no previous file with comments | « content/browser/cross_site_transfer_browsertest.cc ('k') | content/browser/device_monitor_udev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698