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

Unified Diff: trunk/src/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc

Issue 227493006: Revert 262175 "* Replace "read" method with onReceiveXxx events." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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
Index: trunk/src/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc
===================================================================
--- trunk/src/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc (revision 262179)
+++ trunk/src/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc (working copy)
@@ -7,12 +7,9 @@
#include "base/memory/ref_counted.h"
#include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
#include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h"
-#include "content/public/browser/browser_thread.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
-using content::BrowserThread;
-
namespace {
const char kPlatformNotSupported[] =
@@ -20,24 +17,22 @@
extensions::BluetoothEventRouter* GetEventRouter(
content::BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- return extensions::BluetoothAPI::Get(context)->event_router();
+ return extensions::BluetoothAPI::Get(context)->bluetooth_event_router();
}
bool IsBluetoothSupported(content::BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
return GetEventRouter(context)->IsBluetoothSupported();
}
void GetAdapter(const device::BluetoothAdapterFactory::AdapterCallback callback,
content::BrowserContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
GetEventRouter(context)->GetAdapter(callback);
}
} // namespace
namespace extensions {
+
namespace api {
BluetoothExtensionFunction::BluetoothExtensionFunction() {
@@ -47,8 +42,6 @@
}
bool BluetoothExtensionFunction::RunImpl() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
if (!IsBluetoothSupported(browser_context())) {
SetError(kPlatformNotSupported);
return false;
@@ -61,9 +54,9 @@
void BluetoothExtensionFunction::RunOnAdapterReady(
scoped_refptr<device::BluetoothAdapter> adapter) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DoWork(adapter);
}
} // namespace api
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698