summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/browser/api/bluetooth/bluetooth_api.cc18
-rw-r--r--extensions/browser/api/bluetooth/bluetooth_extension_function.cc10
-rw-r--r--extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.cc40
-rw-r--r--extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc58
-rw-r--r--extensions/browser/api/bluetooth_socket/bluetooth_socket_api.cc10
-rw-r--r--extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc2
-rw-r--r--extensions/browser/guest_view/guest_view_message_filter.cc4
-rw-r--r--extensions/shell/browser/shell_speech_recognition_manager_delegate.cc4
8 files changed, 73 insertions, 73 deletions
diff --git a/extensions/browser/api/bluetooth/bluetooth_api.cc b/extensions/browser/api/bluetooth/bluetooth_api.cc
index 2e1e4bc..048bd11 100644
--- a/extensions/browser/api/bluetooth/bluetooth_api.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_api.cc
@@ -35,7 +35,7 @@ const char kStopDiscoveryFailed[] = "Failed to stop discovery";
extensions::BluetoothEventRouter* GetEventRouter(BrowserContext* context) {
// Note: |context| is valid on UI thread only.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return extensions::BluetoothAPI::Get(context)->event_router();
}
@@ -54,13 +54,13 @@ BluetoothAPI::GetFactoryInstance() {
// static
BluetoothAPI* BluetoothAPI::Get(BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return GetFactoryInstance()->Get(context);
}
BluetoothAPI::BluetoothAPI(content::BrowserContext* context)
: browser_context_(context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
EventRouter* event_router = EventRouter::Get(browser_context_);
event_router->RegisterObserver(this,
bluetooth::OnAdapterStateChanged::kEventName);
@@ -72,7 +72,7 @@ BluetoothAPI::BluetoothAPI(content::BrowserContext* context)
BluetoothAPI::~BluetoothAPI() {}
BluetoothEventRouter* BluetoothAPI::event_router() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!event_router_) {
event_router_.reset(new BluetoothEventRouter(browser_context_));
}
@@ -80,18 +80,18 @@ BluetoothEventRouter* BluetoothAPI::event_router() {
}
void BluetoothAPI::Shutdown() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
EventRouter::Get(browser_context_)->UnregisterObserver(this);
}
void BluetoothAPI::OnListenerAdded(const EventListenerInfo& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (event_router()->IsBluetoothSupported())
event_router()->OnListenerAdded();
}
void BluetoothAPI::OnListenerRemoved(const EventListenerInfo& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (event_router()->IsBluetoothSupported())
event_router()->OnListenerRemoved();
}
@@ -113,7 +113,7 @@ BluetoothGetDevicesFunction::~BluetoothGetDevicesFunction() {}
bool BluetoothGetDevicesFunction::DoWork(
scoped_refptr<BluetoothAdapter> adapter) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::ListValue* device_list = new base::ListValue;
SetResult(device_list);
@@ -140,7 +140,7 @@ BluetoothGetDeviceFunction::~BluetoothGetDeviceFunction() {}
bool BluetoothGetDeviceFunction::DoWork(
scoped_refptr<BluetoothAdapter> adapter) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
scoped_ptr<GetDevice::Params> params(GetDevice::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get() != NULL);
diff --git a/extensions/browser/api/bluetooth/bluetooth_extension_function.cc b/extensions/browser/api/bluetooth/bluetooth_extension_function.cc
index 7a5eefe..b51b647a 100644
--- a/extensions/browser/api/bluetooth/bluetooth_extension_function.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_extension_function.cc
@@ -20,18 +20,18 @@ const char kPlatformNotSupported[] =
extensions::BluetoothEventRouter* GetEventRouter(
content::BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return extensions::BluetoothAPI::Get(context)->event_router();
}
bool IsBluetoothSupported(content::BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return GetEventRouter(context)->IsBluetoothSupported();
}
void GetAdapter(const device::BluetoothAdapterFactory::AdapterCallback callback,
content::BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
GetEventRouter(context)->GetAdapter(callback);
}
@@ -47,7 +47,7 @@ BluetoothExtensionFunction::~BluetoothExtensionFunction() {
}
bool BluetoothExtensionFunction::RunAsync() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!IsBluetoothSupported(browser_context())) {
SetError(kPlatformNotSupported);
@@ -61,7 +61,7 @@ bool BluetoothExtensionFunction::RunAsync() {
void BluetoothExtensionFunction::RunOnAdapterReady(
scoped_refptr<device::BluetoothAdapter> adapter) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DoWork(adapter);
}
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.cc b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.cc
index face89a..71529ad 100644
--- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.cc
+++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.cc
@@ -91,7 +91,7 @@ std::string StatusToString(BluetoothLowEnergyEventRouter::Status status) {
extensions::BluetoothLowEnergyEventRouter* GetEventRouter(
BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return extensions::BluetoothLowEnergyAPI::Get(context)->event_router();
}
@@ -114,20 +114,20 @@ BluetoothLowEnergyAPI::GetFactoryInstance() {
// static
BluetoothLowEnergyAPI* BluetoothLowEnergyAPI::Get(BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return GetFactoryInstance()->Get(context);
}
BluetoothLowEnergyAPI::BluetoothLowEnergyAPI(BrowserContext* context)
: event_router_(new BluetoothLowEnergyEventRouter(context)) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
BluetoothLowEnergyAPI::~BluetoothLowEnergyAPI() {
}
void BluetoothLowEnergyAPI::Shutdown() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
namespace core_api {
@@ -139,7 +139,7 @@ BluetoothLowEnergyExtensionFunction::~BluetoothLowEnergyExtensionFunction() {
}
bool BluetoothLowEnergyExtensionFunction::RunAsync() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!BluetoothManifestData::CheckLowEnergyPermitted(extension())) {
error_ = kErrorPermissionDenied;
@@ -165,7 +165,7 @@ bool BluetoothLowEnergyExtensionFunction::RunAsync() {
}
bool BluetoothLowEnergyConnectFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -208,7 +208,7 @@ void BluetoothLowEnergyConnectFunction::ErrorCallback(
}
bool BluetoothLowEnergyDisconnectFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -245,7 +245,7 @@ void BluetoothLowEnergyDisconnectFunction::ErrorCallback(
}
bool BluetoothLowEnergyGetServiceFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -278,7 +278,7 @@ bool BluetoothLowEnergyGetServiceFunction::DoWork() {
}
bool BluetoothLowEnergyGetServicesFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -309,7 +309,7 @@ bool BluetoothLowEnergyGetServicesFunction::DoWork() {
}
bool BluetoothLowEnergyGetCharacteristicFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -346,7 +346,7 @@ bool BluetoothLowEnergyGetCharacteristicFunction::DoWork() {
}
bool BluetoothLowEnergyGetCharacteristicsFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -390,7 +390,7 @@ bool BluetoothLowEnergyGetCharacteristicsFunction::DoWork() {
}
bool BluetoothLowEnergyGetIncludedServicesFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -423,7 +423,7 @@ bool BluetoothLowEnergyGetIncludedServicesFunction::DoWork() {
}
bool BluetoothLowEnergyGetDescriptorFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -459,7 +459,7 @@ bool BluetoothLowEnergyGetDescriptorFunction::DoWork() {
}
bool BluetoothLowEnergyGetDescriptorsFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -502,7 +502,7 @@ bool BluetoothLowEnergyGetDescriptorsFunction::DoWork() {
}
bool BluetoothLowEnergyReadCharacteristicValueFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -560,7 +560,7 @@ void BluetoothLowEnergyReadCharacteristicValueFunction::ErrorCallback(
}
bool BluetoothLowEnergyWriteCharacteristicValueFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -604,7 +604,7 @@ void BluetoothLowEnergyWriteCharacteristicValueFunction::ErrorCallback(
}
bool BluetoothLowEnergyStartCharacteristicNotificationsFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -652,7 +652,7 @@ void BluetoothLowEnergyStartCharacteristicNotificationsFunction::ErrorCallback(
}
bool BluetoothLowEnergyStopCharacteristicNotificationsFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -694,7 +694,7 @@ void BluetoothLowEnergyStopCharacteristicNotificationsFunction::ErrorCallback(
}
bool BluetoothLowEnergyReadDescriptorValueFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
@@ -751,7 +751,7 @@ void BluetoothLowEnergyReadDescriptorValueFunction::ErrorCallback(
}
bool BluetoothLowEnergyWriteDescriptorValueFunction::DoWork() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context());
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
index 727532c..e1f59fb 100644
--- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
+++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
@@ -187,7 +187,7 @@ namespace extensions {
BluetoothLowEnergyEventRouter::BluetoothLowEnergyEventRouter(
content::BrowserContext* context)
: adapter_(NULL), browser_context_(context), weak_ptr_factory_(this) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(browser_context_);
VLOG(1) << "Initializing BluetoothLowEnergyEventRouter.";
@@ -198,7 +198,7 @@ BluetoothLowEnergyEventRouter::BluetoothLowEnergyEventRouter(
}
BluetoothLowEnergyEventRouter::~BluetoothLowEnergyEventRouter() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!adapter_.get())
return;
@@ -207,7 +207,7 @@ BluetoothLowEnergyEventRouter::~BluetoothLowEnergyEventRouter() {
}
bool BluetoothLowEnergyEventRouter::IsBluetoothSupported() const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return adapter_.get() ||
BluetoothAdapterFactory::IsBluetoothAdapterAvailable();
}
@@ -239,7 +239,7 @@ void BluetoothLowEnergyEventRouter::Connect(
const std::string& device_address,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
error_callback.Run(kStatusErrorFailed);
@@ -294,7 +294,7 @@ void BluetoothLowEnergyEventRouter::Disconnect(
const std::string& device_address,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
error_callback.Run(kStatusErrorFailed);
@@ -329,7 +329,7 @@ void BluetoothLowEnergyEventRouter::Disconnect(
bool BluetoothLowEnergyEventRouter::GetServices(
const std::string& device_address,
ServiceList* out_services) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(out_services);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
@@ -364,7 +364,7 @@ bool BluetoothLowEnergyEventRouter::GetServices(
BluetoothLowEnergyEventRouter::Status BluetoothLowEnergyEventRouter::GetService(
const std::string& instance_id,
apibtle::Service* out_service) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(out_service);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
@@ -385,7 +385,7 @@ BluetoothLowEnergyEventRouter::Status
BluetoothLowEnergyEventRouter::GetIncludedServices(
const std::string& instance_id,
ServiceList* out_services) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(out_services);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
@@ -422,7 +422,7 @@ BluetoothLowEnergyEventRouter::GetCharacteristics(
const Extension* extension,
const std::string& instance_id,
CharacteristicList* out_characteristics) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(extension);
DCHECK(out_characteristics);
if (!adapter_.get()) {
@@ -468,7 +468,7 @@ BluetoothLowEnergyEventRouter::GetCharacteristic(
const Extension* extension,
const std::string& instance_id,
apibtle::Characteristic* out_characteristic) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(extension);
DCHECK(out_characteristic);
if (!adapter_.get()) {
@@ -500,7 +500,7 @@ BluetoothLowEnergyEventRouter::GetDescriptors(
const Extension* extension,
const std::string& instance_id,
DescriptorList* out_descriptors) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(extension);
DCHECK(out_descriptors);
if (!adapter_.get()) {
@@ -547,7 +547,7 @@ BluetoothLowEnergyEventRouter::GetDescriptor(
const Extension* extension,
const std::string& instance_id,
core_api::bluetooth_low_energy::Descriptor* out_descriptor) const {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(extension);
DCHECK(out_descriptor);
if (!adapter_.get()) {
@@ -578,7 +578,7 @@ void BluetoothLowEnergyEventRouter::ReadCharacteristicValue(
const std::string& instance_id,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(extension);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
@@ -618,7 +618,7 @@ void BluetoothLowEnergyEventRouter::WriteCharacteristicValue(
const std::vector<uint8>& value,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(extension);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
@@ -657,7 +657,7 @@ void BluetoothLowEnergyEventRouter::StartCharacteristicNotifications(
const std::string& instance_id,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
error_callback.Run(kStatusErrorFailed);
@@ -722,7 +722,7 @@ void BluetoothLowEnergyEventRouter::StopCharacteristicNotifications(
const std::string& instance_id,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
error_callback.Run(kStatusErrorFailed);
@@ -753,7 +753,7 @@ void BluetoothLowEnergyEventRouter::ReadDescriptorValue(
const std::string& instance_id,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(extension);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
@@ -792,7 +792,7 @@ void BluetoothLowEnergyEventRouter::WriteDescriptorValue(
const std::vector<uint8>& value,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(extension);
if (!adapter_.get()) {
VLOG(1) << "BluetoothAdapter not ready.";
@@ -834,7 +834,7 @@ void BluetoothLowEnergyEventRouter::GattServiceAdded(
BluetoothAdapter* adapter,
BluetoothDevice* device,
BluetoothGattService* service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT service added: " << service->GetIdentifier();
@@ -849,7 +849,7 @@ void BluetoothLowEnergyEventRouter::GattServiceRemoved(
BluetoothAdapter* adapter,
BluetoothDevice* device,
BluetoothGattService* service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT service removed: " << service->GetIdentifier();
@@ -874,7 +874,7 @@ void BluetoothLowEnergyEventRouter::GattServiceRemoved(
void BluetoothLowEnergyEventRouter::GattDiscoveryCompleteForService(
BluetoothAdapter* adapter,
BluetoothGattService* service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT service discovery complete: " << service->GetIdentifier();
@@ -895,7 +895,7 @@ void BluetoothLowEnergyEventRouter::GattDiscoveryCompleteForService(
void BluetoothLowEnergyEventRouter::GattServiceChanged(
BluetoothAdapter* adapter,
BluetoothGattService* service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT service changed: " << service->GetIdentifier();
DCHECK(service_id_to_device_address_.find(service->GetIdentifier()) !=
@@ -915,7 +915,7 @@ void BluetoothLowEnergyEventRouter::GattServiceChanged(
void BluetoothLowEnergyEventRouter::GattCharacteristicAdded(
BluetoothAdapter* adapter,
BluetoothGattCharacteristic* characteristic) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT characteristic added: " << characteristic->GetIdentifier();
@@ -934,7 +934,7 @@ void BluetoothLowEnergyEventRouter::GattCharacteristicAdded(
void BluetoothLowEnergyEventRouter::GattCharacteristicRemoved(
BluetoothAdapter* adapter,
BluetoothGattCharacteristic* characteristic) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT characteristic removed: " << characteristic->GetIdentifier();
@@ -952,7 +952,7 @@ void BluetoothLowEnergyEventRouter::GattCharacteristicRemoved(
void BluetoothLowEnergyEventRouter::GattDescriptorAdded(
BluetoothAdapter* adapter,
BluetoothGattDescriptor* descriptor) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT descriptor added: " << descriptor->GetIdentifier();
@@ -971,7 +971,7 @@ void BluetoothLowEnergyEventRouter::GattDescriptorAdded(
void BluetoothLowEnergyEventRouter::GattDescriptorRemoved(
BluetoothAdapter* adapter,
BluetoothGattDescriptor* descriptor) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT descriptor removed: " << descriptor->GetIdentifier();
@@ -990,7 +990,7 @@ void BluetoothLowEnergyEventRouter::GattCharacteristicValueChanged(
BluetoothAdapter* adapter,
BluetoothGattCharacteristic* characteristic,
const std::vector<uint8>& value) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT characteristic value changed: "
<< characteristic->GetIdentifier();
@@ -1024,7 +1024,7 @@ void BluetoothLowEnergyEventRouter::GattDescriptorValueChanged(
BluetoothAdapter* adapter,
BluetoothGattDescriptor* descriptor,
const std::vector<uint8>& value) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(adapter, adapter_.get());
VLOG(2) << "GATT descriptor value changed: " << descriptor->GetIdentifier();
@@ -1065,7 +1065,7 @@ void BluetoothLowEnergyEventRouter::OnGetAdapter(
}
void BluetoothLowEnergyEventRouter::InitializeIdentifierMappings() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(service_id_to_device_address_.empty());
DCHECK(chrc_id_to_service_id_.empty());
diff --git a/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.cc b/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.cc
index 77d19d1..c9c70b9 100644
--- a/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.cc
+++ b/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.cc
@@ -183,7 +183,7 @@ BluetoothSocketCreateFunction::BluetoothSocketCreateFunction() {}
BluetoothSocketCreateFunction::~BluetoothSocketCreateFunction() {}
bool BluetoothSocketCreateFunction::Prepare() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
params_ = bluetooth_socket::Create::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get());
@@ -264,7 +264,7 @@ BluetoothSocketListenFunction::BluetoothSocketListenFunction() {}
BluetoothSocketListenFunction::~BluetoothSocketListenFunction() {}
bool BluetoothSocketListenFunction::Prepare() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!CreateParams())
return false;
socket_event_dispatcher_ = GetSocketEventDispatcher(browser_context());
@@ -443,7 +443,7 @@ BluetoothSocketAbstractConnectFunction::
~BluetoothSocketAbstractConnectFunction() {}
bool BluetoothSocketAbstractConnectFunction::Prepare() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
params_ = bluetooth_socket::Connect::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get());
@@ -540,7 +540,7 @@ BluetoothSocketDisconnectFunction::BluetoothSocketDisconnectFunction() {}
BluetoothSocketDisconnectFunction::~BluetoothSocketDisconnectFunction() {}
bool BluetoothSocketDisconnectFunction::Prepare() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
params_ = bluetooth_socket::Disconnect::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get());
return true;
@@ -592,7 +592,7 @@ BluetoothSocketSendFunction::BluetoothSocketSendFunction()
BluetoothSocketSendFunction::~BluetoothSocketSendFunction() {}
bool BluetoothSocketSendFunction::Prepare() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
params_ = bluetooth_socket::Send::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get());
diff --git a/extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc b/extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc
index 3daadf3..662b9b7 100644
--- a/extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc
+++ b/extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc
@@ -355,7 +355,7 @@ void BluetoothSocketEventDispatcher::DispatchEvent(
void* browser_context_id,
const std::string& extension_id,
scoped_ptr<Event> event) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
content::BrowserContext* context =
reinterpret_cast<content::BrowserContext*>(browser_context_id);
diff --git a/extensions/browser/guest_view/guest_view_message_filter.cc b/extensions/browser/guest_view/guest_view_message_filter.cc
index 52f8d6b..e7c505c 100644
--- a/extensions/browser/guest_view/guest_view_message_filter.cc
+++ b/extensions/browser/guest_view/guest_view_message_filter.cc
@@ -70,7 +70,7 @@ void GuestViewMessageFilter::OnAttachGuest(
int element_instance_id,
int guest_instance_id,
const base::DictionaryValue& params) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto manager = GuestViewManager::FromBrowserContext(browser_context_);
if (!manager)
return;
@@ -86,7 +86,7 @@ void GuestViewMessageFilter::OnCreateMimeHandlerViewGuest(
const std::string& view_id,
int element_instance_id,
const gfx::Size& element_size) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto manager = GuestViewManager::FromBrowserContext(browser_context_);
if (!manager)
return;
diff --git a/extensions/shell/browser/shell_speech_recognition_manager_delegate.cc b/extensions/shell/browser/shell_speech_recognition_manager_delegate.cc
index 7a96874..9fc2f65 100644
--- a/extensions/shell/browser/shell_speech_recognition_manager_delegate.cc
+++ b/extensions/shell/browser/shell_speech_recognition_manager_delegate.cc
@@ -72,7 +72,7 @@ void ShellSpeechRecognitionManagerDelegate::GetDiagnosticInformation(
void ShellSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
int session_id,
base::Callback<void(bool ask_user, bool is_allowed)> callback) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
const content::SpeechRecognitionSessionContext& context =
SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id);
@@ -104,7 +104,7 @@ void ShellSpeechRecognitionManagerDelegate::CheckRenderViewType(
base::Callback<void(bool ask_user, bool is_allowed)> callback,
int render_process_id,
int render_view_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
const content::RenderViewHost* render_view_host =
content::RenderViewHost::FromID(render_process_id, render_view_id);
bool allowed = false;