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

favor DCHECK_CURRENTLY_ON for better logs in extensions/

BUG=466848

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

Cr-Commit-Position: refs/heads/master@{#322238}
parent 16408c28
...@@ -35,7 +35,7 @@ const char kStopDiscoveryFailed[] = "Failed to stop discovery"; ...@@ -35,7 +35,7 @@ const char kStopDiscoveryFailed[] = "Failed to stop discovery";
extensions::BluetoothEventRouter* GetEventRouter(BrowserContext* context) { extensions::BluetoothEventRouter* GetEventRouter(BrowserContext* context) {
// Note: |context| is valid on UI thread only. // 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(); return extensions::BluetoothAPI::Get(context)->event_router();
} }
...@@ -54,13 +54,13 @@ BluetoothAPI::GetFactoryInstance() { ...@@ -54,13 +54,13 @@ BluetoothAPI::GetFactoryInstance() {
// static // static
BluetoothAPI* BluetoothAPI::Get(BrowserContext* context) { BluetoothAPI* BluetoothAPI::Get(BrowserContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
return GetFactoryInstance()->Get(context); return GetFactoryInstance()->Get(context);
} }
BluetoothAPI::BluetoothAPI(content::BrowserContext* context) BluetoothAPI::BluetoothAPI(content::BrowserContext* context)
: browser_context_(context) { : browser_context_(context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
EventRouter* event_router = EventRouter::Get(browser_context_); EventRouter* event_router = EventRouter::Get(browser_context_);
event_router->RegisterObserver(this, event_router->RegisterObserver(this,
bluetooth::OnAdapterStateChanged::kEventName); bluetooth::OnAdapterStateChanged::kEventName);
...@@ -72,7 +72,7 @@ BluetoothAPI::BluetoothAPI(content::BrowserContext* context) ...@@ -72,7 +72,7 @@ BluetoothAPI::BluetoothAPI(content::BrowserContext* context)
BluetoothAPI::~BluetoothAPI() {} BluetoothAPI::~BluetoothAPI() {}
BluetoothEventRouter* BluetoothAPI::event_router() { BluetoothEventRouter* BluetoothAPI::event_router() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!event_router_) { if (!event_router_) {
event_router_.reset(new BluetoothEventRouter(browser_context_)); event_router_.reset(new BluetoothEventRouter(browser_context_));
} }
...@@ -80,18 +80,18 @@ BluetoothEventRouter* BluetoothAPI::event_router() { ...@@ -80,18 +80,18 @@ BluetoothEventRouter* BluetoothAPI::event_router() {
} }
void BluetoothAPI::Shutdown() { void BluetoothAPI::Shutdown() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
EventRouter::Get(browser_context_)->UnregisterObserver(this); EventRouter::Get(browser_context_)->UnregisterObserver(this);
} }
void BluetoothAPI::OnListenerAdded(const EventListenerInfo& details) { void BluetoothAPI::OnListenerAdded(const EventListenerInfo& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (event_router()->IsBluetoothSupported()) if (event_router()->IsBluetoothSupported())
event_router()->OnListenerAdded(); event_router()->OnListenerAdded();
} }
void BluetoothAPI::OnListenerRemoved(const EventListenerInfo& details) { void BluetoothAPI::OnListenerRemoved(const EventListenerInfo& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (event_router()->IsBluetoothSupported()) if (event_router()->IsBluetoothSupported())
event_router()->OnListenerRemoved(); event_router()->OnListenerRemoved();
} }
...@@ -113,7 +113,7 @@ BluetoothGetDevicesFunction::~BluetoothGetDevicesFunction() {} ...@@ -113,7 +113,7 @@ BluetoothGetDevicesFunction::~BluetoothGetDevicesFunction() {}
bool BluetoothGetDevicesFunction::DoWork( bool BluetoothGetDevicesFunction::DoWork(
scoped_refptr<BluetoothAdapter> adapter) { scoped_refptr<BluetoothAdapter> adapter) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::ListValue* device_list = new base::ListValue; base::ListValue* device_list = new base::ListValue;
SetResult(device_list); SetResult(device_list);
...@@ -140,7 +140,7 @@ BluetoothGetDeviceFunction::~BluetoothGetDeviceFunction() {} ...@@ -140,7 +140,7 @@ BluetoothGetDeviceFunction::~BluetoothGetDeviceFunction() {}
bool BluetoothGetDeviceFunction::DoWork( bool BluetoothGetDeviceFunction::DoWork(
scoped_refptr<BluetoothAdapter> adapter) { 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_)); scoped_ptr<GetDevice::Params> params(GetDevice::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); EXTENSION_FUNCTION_VALIDATE(params.get() != NULL);
......
...@@ -20,18 +20,18 @@ const char kPlatformNotSupported[] = ...@@ -20,18 +20,18 @@ const char kPlatformNotSupported[] =
extensions::BluetoothEventRouter* GetEventRouter( extensions::BluetoothEventRouter* GetEventRouter(
content::BrowserContext* context) { content::BrowserContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
return extensions::BluetoothAPI::Get(context)->event_router(); return extensions::BluetoothAPI::Get(context)->event_router();
} }
bool IsBluetoothSupported(content::BrowserContext* context) { bool IsBluetoothSupported(content::BrowserContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
return GetEventRouter(context)->IsBluetoothSupported(); return GetEventRouter(context)->IsBluetoothSupported();
} }
void GetAdapter(const device::BluetoothAdapterFactory::AdapterCallback callback, void GetAdapter(const device::BluetoothAdapterFactory::AdapterCallback callback,
content::BrowserContext* context) { content::BrowserContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
GetEventRouter(context)->GetAdapter(callback); GetEventRouter(context)->GetAdapter(callback);
} }
...@@ -47,7 +47,7 @@ BluetoothExtensionFunction::~BluetoothExtensionFunction() { ...@@ -47,7 +47,7 @@ BluetoothExtensionFunction::~BluetoothExtensionFunction() {
} }
bool BluetoothExtensionFunction::RunAsync() { bool BluetoothExtensionFunction::RunAsync() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!IsBluetoothSupported(browser_context())) { if (!IsBluetoothSupported(browser_context())) {
SetError(kPlatformNotSupported); SetError(kPlatformNotSupported);
...@@ -61,7 +61,7 @@ bool BluetoothExtensionFunction::RunAsync() { ...@@ -61,7 +61,7 @@ bool BluetoothExtensionFunction::RunAsync() {
void BluetoothExtensionFunction::RunOnAdapterReady( void BluetoothExtensionFunction::RunOnAdapterReady(
scoped_refptr<device::BluetoothAdapter> adapter) { scoped_refptr<device::BluetoothAdapter> adapter) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DoWork(adapter); DoWork(adapter);
} }
......
...@@ -91,7 +91,7 @@ std::string StatusToString(BluetoothLowEnergyEventRouter::Status status) { ...@@ -91,7 +91,7 @@ std::string StatusToString(BluetoothLowEnergyEventRouter::Status status) {
extensions::BluetoothLowEnergyEventRouter* GetEventRouter( extensions::BluetoothLowEnergyEventRouter* GetEventRouter(
BrowserContext* context) { BrowserContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
return extensions::BluetoothLowEnergyAPI::Get(context)->event_router(); return extensions::BluetoothLowEnergyAPI::Get(context)->event_router();
} }
...@@ -114,20 +114,20 @@ BluetoothLowEnergyAPI::GetFactoryInstance() { ...@@ -114,20 +114,20 @@ BluetoothLowEnergyAPI::GetFactoryInstance() {
// static // static
BluetoothLowEnergyAPI* BluetoothLowEnergyAPI::Get(BrowserContext* context) { BluetoothLowEnergyAPI* BluetoothLowEnergyAPI::Get(BrowserContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
return GetFactoryInstance()->Get(context); return GetFactoryInstance()->Get(context);
} }
BluetoothLowEnergyAPI::BluetoothLowEnergyAPI(BrowserContext* context) BluetoothLowEnergyAPI::BluetoothLowEnergyAPI(BrowserContext* context)
: event_router_(new BluetoothLowEnergyEventRouter(context)) { : event_router_(new BluetoothLowEnergyEventRouter(context)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
} }
BluetoothLowEnergyAPI::~BluetoothLowEnergyAPI() { BluetoothLowEnergyAPI::~BluetoothLowEnergyAPI() {
} }
void BluetoothLowEnergyAPI::Shutdown() { void BluetoothLowEnergyAPI::Shutdown() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
} }
namespace core_api { namespace core_api {
...@@ -139,7 +139,7 @@ BluetoothLowEnergyExtensionFunction::~BluetoothLowEnergyExtensionFunction() { ...@@ -139,7 +139,7 @@ BluetoothLowEnergyExtensionFunction::~BluetoothLowEnergyExtensionFunction() {
} }
bool BluetoothLowEnergyExtensionFunction::RunAsync() { bool BluetoothLowEnergyExtensionFunction::RunAsync() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!BluetoothManifestData::CheckLowEnergyPermitted(extension())) { if (!BluetoothManifestData::CheckLowEnergyPermitted(extension())) {
error_ = kErrorPermissionDenied; error_ = kErrorPermissionDenied;
...@@ -165,7 +165,7 @@ bool BluetoothLowEnergyExtensionFunction::RunAsync() { ...@@ -165,7 +165,7 @@ bool BluetoothLowEnergyExtensionFunction::RunAsync() {
} }
bool BluetoothLowEnergyConnectFunction::DoWork() { bool BluetoothLowEnergyConnectFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -208,7 +208,7 @@ void BluetoothLowEnergyConnectFunction::ErrorCallback( ...@@ -208,7 +208,7 @@ void BluetoothLowEnergyConnectFunction::ErrorCallback(
} }
bool BluetoothLowEnergyDisconnectFunction::DoWork() { bool BluetoothLowEnergyDisconnectFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -245,7 +245,7 @@ void BluetoothLowEnergyDisconnectFunction::ErrorCallback( ...@@ -245,7 +245,7 @@ void BluetoothLowEnergyDisconnectFunction::ErrorCallback(
} }
bool BluetoothLowEnergyGetServiceFunction::DoWork() { bool BluetoothLowEnergyGetServiceFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -278,7 +278,7 @@ bool BluetoothLowEnergyGetServiceFunction::DoWork() { ...@@ -278,7 +278,7 @@ bool BluetoothLowEnergyGetServiceFunction::DoWork() {
} }
bool BluetoothLowEnergyGetServicesFunction::DoWork() { bool BluetoothLowEnergyGetServicesFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -309,7 +309,7 @@ bool BluetoothLowEnergyGetServicesFunction::DoWork() { ...@@ -309,7 +309,7 @@ bool BluetoothLowEnergyGetServicesFunction::DoWork() {
} }
bool BluetoothLowEnergyGetCharacteristicFunction::DoWork() { bool BluetoothLowEnergyGetCharacteristicFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -346,7 +346,7 @@ bool BluetoothLowEnergyGetCharacteristicFunction::DoWork() { ...@@ -346,7 +346,7 @@ bool BluetoothLowEnergyGetCharacteristicFunction::DoWork() {
} }
bool BluetoothLowEnergyGetCharacteristicsFunction::DoWork() { bool BluetoothLowEnergyGetCharacteristicsFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -390,7 +390,7 @@ bool BluetoothLowEnergyGetCharacteristicsFunction::DoWork() { ...@@ -390,7 +390,7 @@ bool BluetoothLowEnergyGetCharacteristicsFunction::DoWork() {
} }
bool BluetoothLowEnergyGetIncludedServicesFunction::DoWork() { bool BluetoothLowEnergyGetIncludedServicesFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -423,7 +423,7 @@ bool BluetoothLowEnergyGetIncludedServicesFunction::DoWork() { ...@@ -423,7 +423,7 @@ bool BluetoothLowEnergyGetIncludedServicesFunction::DoWork() {
} }
bool BluetoothLowEnergyGetDescriptorFunction::DoWork() { bool BluetoothLowEnergyGetDescriptorFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -459,7 +459,7 @@ bool BluetoothLowEnergyGetDescriptorFunction::DoWork() { ...@@ -459,7 +459,7 @@ bool BluetoothLowEnergyGetDescriptorFunction::DoWork() {
} }
bool BluetoothLowEnergyGetDescriptorsFunction::DoWork() { bool BluetoothLowEnergyGetDescriptorsFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -502,7 +502,7 @@ bool BluetoothLowEnergyGetDescriptorsFunction::DoWork() { ...@@ -502,7 +502,7 @@ bool BluetoothLowEnergyGetDescriptorsFunction::DoWork() {
} }
bool BluetoothLowEnergyReadCharacteristicValueFunction::DoWork() { bool BluetoothLowEnergyReadCharacteristicValueFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -560,7 +560,7 @@ void BluetoothLowEnergyReadCharacteristicValueFunction::ErrorCallback( ...@@ -560,7 +560,7 @@ void BluetoothLowEnergyReadCharacteristicValueFunction::ErrorCallback(
} }
bool BluetoothLowEnergyWriteCharacteristicValueFunction::DoWork() { bool BluetoothLowEnergyWriteCharacteristicValueFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -604,7 +604,7 @@ void BluetoothLowEnergyWriteCharacteristicValueFunction::ErrorCallback( ...@@ -604,7 +604,7 @@ void BluetoothLowEnergyWriteCharacteristicValueFunction::ErrorCallback(
} }
bool BluetoothLowEnergyStartCharacteristicNotificationsFunction::DoWork() { bool BluetoothLowEnergyStartCharacteristicNotificationsFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -652,7 +652,7 @@ void BluetoothLowEnergyStartCharacteristicNotificationsFunction::ErrorCallback( ...@@ -652,7 +652,7 @@ void BluetoothLowEnergyStartCharacteristicNotificationsFunction::ErrorCallback(
} }
bool BluetoothLowEnergyStopCharacteristicNotificationsFunction::DoWork() { bool BluetoothLowEnergyStopCharacteristicNotificationsFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -694,7 +694,7 @@ void BluetoothLowEnergyStopCharacteristicNotificationsFunction::ErrorCallback( ...@@ -694,7 +694,7 @@ void BluetoothLowEnergyStopCharacteristicNotificationsFunction::ErrorCallback(
} }
bool BluetoothLowEnergyReadDescriptorValueFunction::DoWork() { bool BluetoothLowEnergyReadDescriptorValueFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
...@@ -751,7 +751,7 @@ void BluetoothLowEnergyReadDescriptorValueFunction::ErrorCallback( ...@@ -751,7 +751,7 @@ void BluetoothLowEnergyReadDescriptorValueFunction::ErrorCallback(
} }
bool BluetoothLowEnergyWriteDescriptorValueFunction::DoWork() { bool BluetoothLowEnergyWriteDescriptorValueFunction::DoWork() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
BluetoothLowEnergyEventRouter* event_router = BluetoothLowEnergyEventRouter* event_router =
GetEventRouter(browser_context()); GetEventRouter(browser_context());
......
...@@ -183,7 +183,7 @@ BluetoothSocketCreateFunction::BluetoothSocketCreateFunction() {} ...@@ -183,7 +183,7 @@ BluetoothSocketCreateFunction::BluetoothSocketCreateFunction() {}
BluetoothSocketCreateFunction::~BluetoothSocketCreateFunction() {} BluetoothSocketCreateFunction::~BluetoothSocketCreateFunction() {}
bool BluetoothSocketCreateFunction::Prepare() { bool BluetoothSocketCreateFunction::Prepare() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
params_ = bluetooth_socket::Create::Params::Create(*args_); params_ = bluetooth_socket::Create::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get()); EXTENSION_FUNCTION_VALIDATE(params_.get());
...@@ -264,7 +264,7 @@ BluetoothSocketListenFunction::BluetoothSocketListenFunction() {} ...@@ -264,7 +264,7 @@ BluetoothSocketListenFunction::BluetoothSocketListenFunction() {}
BluetoothSocketListenFunction::~BluetoothSocketListenFunction() {} BluetoothSocketListenFunction::~BluetoothSocketListenFunction() {}
bool BluetoothSocketListenFunction::Prepare() { bool BluetoothSocketListenFunction::Prepare() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!CreateParams()) if (!CreateParams())
return false; return false;
socket_event_dispatcher_ = GetSocketEventDispatcher(browser_context()); socket_event_dispatcher_ = GetSocketEventDispatcher(browser_context());
...@@ -443,7 +443,7 @@ BluetoothSocketAbstractConnectFunction:: ...@@ -443,7 +443,7 @@ BluetoothSocketAbstractConnectFunction::
~BluetoothSocketAbstractConnectFunction() {} ~BluetoothSocketAbstractConnectFunction() {}
bool BluetoothSocketAbstractConnectFunction::Prepare() { bool BluetoothSocketAbstractConnectFunction::Prepare() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
params_ = bluetooth_socket::Connect::Params::Create(*args_); params_ = bluetooth_socket::Connect::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get()); EXTENSION_FUNCTION_VALIDATE(params_.get());
...@@ -540,7 +540,7 @@ BluetoothSocketDisconnectFunction::BluetoothSocketDisconnectFunction() {} ...@@ -540,7 +540,7 @@ BluetoothSocketDisconnectFunction::BluetoothSocketDisconnectFunction() {}
BluetoothSocketDisconnectFunction::~BluetoothSocketDisconnectFunction() {} BluetoothSocketDisconnectFunction::~BluetoothSocketDisconnectFunction() {}
bool BluetoothSocketDisconnectFunction::Prepare() { bool BluetoothSocketDisconnectFunction::Prepare() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
params_ = bluetooth_socket::Disconnect::Params::Create(*args_); params_ = bluetooth_socket::Disconnect::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get()); EXTENSION_FUNCTION_VALIDATE(params_.get());
return true; return true;
...@@ -592,7 +592,7 @@ BluetoothSocketSendFunction::BluetoothSocketSendFunction() ...@@ -592,7 +592,7 @@ BluetoothSocketSendFunction::BluetoothSocketSendFunction()
BluetoothSocketSendFunction::~BluetoothSocketSendFunction() {} BluetoothSocketSendFunction::~BluetoothSocketSendFunction() {}
bool BluetoothSocketSendFunction::Prepare() { bool BluetoothSocketSendFunction::Prepare() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
params_ = bluetooth_socket::Send::Params::Create(*args_); params_ = bluetooth_socket::Send::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_.get()); EXTENSION_FUNCTION_VALIDATE(params_.get());
......
...@@ -355,7 +355,7 @@ void BluetoothSocketEventDispatcher::DispatchEvent( ...@@ -355,7 +355,7 @@ void BluetoothSocketEventDispatcher::DispatchEvent(
void* browser_context_id, void* browser_context_id,
const std::string& extension_id, const std::string& extension_id,
scoped_ptr<Event> event) { scoped_ptr<Event> event) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
content::BrowserContext* context = content::BrowserContext* context =
reinterpret_cast<content::BrowserContext*>(browser_context_id); reinterpret_cast<content::BrowserContext*>(browser_context_id);
......
...@@ -70,7 +70,7 @@ void GuestViewMessageFilter::OnAttachGuest( ...@@ -70,7 +70,7 @@ void GuestViewMessageFilter::OnAttachGuest(
int element_instance_id, int element_instance_id,
int guest_instance_id, int guest_instance_id,
const base::DictionaryValue& params) { const base::DictionaryValue& params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto manager = GuestViewManager::FromBrowserContext(browser_context_); auto manager = GuestViewManager::FromBrowserContext(browser_context_);
if (!manager) if (!manager)
return; return;
...@@ -86,7 +86,7 @@ void GuestViewMessageFilter::OnCreateMimeHandlerViewGuest( ...@@ -86,7 +86,7 @@ void GuestViewMessageFilter::OnCreateMimeHandlerViewGuest(
const std::string& view_id, const std::string& view_id,
int element_instance_id, int element_instance_id,
const gfx::Size& element_size) { const gfx::Size& element_size) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto manager = GuestViewManager::FromBrowserContext(browser_context_); auto manager = GuestViewManager::FromBrowserContext(browser_context_);
if (!manager) if (!manager)
return; return;
......
...@@ -72,7 +72,7 @@ void ShellSpeechRecognitionManagerDelegate::GetDiagnosticInformation( ...@@ -72,7 +72,7 @@ void ShellSpeechRecognitionManagerDelegate::GetDiagnosticInformation(
void ShellSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( void ShellSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
int session_id, int session_id,
base::Callback<void(bool ask_user, bool is_allowed)> callback) { base::Callback<void(bool ask_user, bool is_allowed)> callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_CURRENTLY_ON(BrowserThread::IO);
const content::SpeechRecognitionSessionContext& context = const content::SpeechRecognitionSessionContext& context =
SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id);
...@@ -104,7 +104,7 @@ void ShellSpeechRecognitionManagerDelegate::CheckRenderViewType( ...@@ -104,7 +104,7 @@ void ShellSpeechRecognitionManagerDelegate::CheckRenderViewType(
base::Callback<void(bool ask_user, bool is_allowed)> callback, base::Callback<void(bool ask_user, bool is_allowed)> callback,
int render_process_id, int render_process_id,
int render_view_id) { int render_view_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_CURRENTLY_ON(BrowserThread::UI);
const content::RenderViewHost* render_view_host = const content::RenderViewHost* render_view_host =
content::RenderViewHost::FromID(render_process_id, render_view_id); content::RenderViewHost::FromID(render_process_id, render_view_id);
bool allowed = false; bool allowed = false;
......
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