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

Unified Diff: chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review feedback. Created 6 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
Index: chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h
index 68822b02e303a4e6ced261197ec4fadf4f8628ac..396757060acd9aef991004740530e68eae702dc1 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h
@@ -55,17 +55,6 @@ class ExtensionBluetoothEventRouter
// Called when a bluetooth event listener is removed.
void OnListenerRemoved();
- // Register the BluetoothSocket |socket| for use by the extensions system.
- // This class will hold onto the socket for its lifetime until
- // ReleaseSocket is called for the socket, or until the extension associated
- // with the socket is disabled/ reloaded. Returns an id for the socket.
- int RegisterSocket(const std::string& extension_id,
- scoped_refptr<device::BluetoothSocket> socket);
-
- // Release the BluetoothSocket corresponding to |id|. Returns true if
- // the socket was found and released, false otherwise.
- bool ReleaseSocket(int id);
-
// Add the BluetoothProfile |bluetooth_profile| for use by the extension
// system. This class will hold onto the profile until RemoveProfile is
// called for the profile, or until the extension that added the profile
@@ -105,16 +94,6 @@ class ExtensionBluetoothEventRouter
// if the BluetoothProfile with |uuid| does not exist.
device::BluetoothProfile* GetProfile(const std::string& uuid) const;
- // Get the BluetoothSocket corresponding to |id|.
- scoped_refptr<device::BluetoothSocket> GetSocket(int id);
-
- // Dispatch an event that takes a connection socket as a parameter to the
- // extension that registered the profile that the socket has connected to.
- void DispatchConnectionEvent(const std::string& extension_id,
- const std::string& uuid,
- const device::BluetoothDevice* device,
- scoped_refptr<device::BluetoothSocket> socket);
-
// Override from device::BluetoothAdapter::Observer
virtual void AdapterPresentChanged(device::BluetoothAdapter* adapter,
bool present) OVERRIDE;
@@ -157,14 +136,6 @@ class ExtensionBluetoothEventRouter
int num_event_listeners_;
- // The next id to use for referring to a BluetoothSocket. We avoid using
- // the fd of the socket because we don't want to leak that information to
- // the extension javascript.
- int next_socket_id_;
-
- typedef std::map<int, ExtensionBluetoothSocketRecord> SocketMap;
- SocketMap socket_map_;
-
// A map that maps uuids to ExtensionBluetoothProfileRecord.
typedef std::map<std::string, ExtensionBluetoothProfileRecord>
BluetoothProfileMap;

Powered by Google App Engine
This is Rietveld 408576698