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

Unified Diff: content/browser/bluetooth/bluetooth_dispatcher_host.h

Issue 1775953004: bluetooth: Move writeValue to mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Address scheib's comments Created 4 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 | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_dispatcher_host.h
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.h b/content/browser/bluetooth/bluetooth_dispatcher_host.h
index b0cf2122e6c2f0830dd052e0fbc7f8fc7e4cb8fd..9b40d654238af081e0aec99816e81ec6f674e0bd 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.h
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h
@@ -14,6 +14,8 @@
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
#include "content/browser/bluetooth/bluetooth_allowed_devices_map.h"
+#include "content/browser/bluetooth/bluetooth_metrics.h"
+#include "content/common/bluetooth/bluetooth_messages.h"
#include "content/public/browser/bluetooth_chooser.h"
#include "content/public/browser/browser_message_filter.h"
#include "device/bluetooth/bluetooth_adapter.h"
@@ -53,6 +55,29 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
void SetBluetoothAdapterForTesting(
scoped_refptr<device::BluetoothAdapter> mock_adapter);
+ // TODO(ortuno): We temporarily make this a public struct so that
+ // both BluetoothDispatcherHost and WebBluetoothServiceImpl can use it,
+ // while we move functions from BluetoothDispatcherHost to
+ // WebBluetoothServiceImpl.
+ // https://crbug.com/508771
+ struct CacheQueryResult {
+ CacheQueryResult();
+ CacheQueryResult(CacheQueryOutcome outcome);
+ ~CacheQueryResult();
+ blink::WebBluetoothError GetWebError() const;
+ device::BluetoothDevice* device = nullptr;
+ device::BluetoothGattService* service = nullptr;
+ device::BluetoothGattCharacteristic* characteristic = nullptr;
+ CacheQueryOutcome outcome = CacheQueryOutcome::SUCCESS;
+ };
+
+ // Queries the platform cache for a characteristic with
+ // |characteristic_instance_id|. Fills in the |outcome| field, and |device|,
+ // |service| and |characteristic| fields if successful.
+ CacheQueryResult QueryCacheForCharacteristic(
+ const url::Origin& origin,
+ const std::string& characteristic_instance_id);
+
protected:
~BluetoothDispatcherHost() override;
@@ -60,7 +85,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
friend class base::DeleteHelper<BluetoothDispatcherHost>;
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
- struct CacheQueryResult;
struct RequestDeviceSession;
struct PrimaryServicesRequest;
@@ -129,11 +153,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
int request_id,
int frame_routing_id,
const std::string& characteristic_instance_id);
- void OnWriteValue(int thread_id,
- int request_id,
- int frame_routing_id,
- const std::string& characteristic_instance_id,
- const std::vector<uint8_t>& value);
void OnStartNotifications(int thread_id,
int request_id,
int frame_routing_id,
@@ -211,12 +230,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
int request_id,
device::BluetoothGattService::GattErrorCode);
- // Callbacks for BluetoothGattCharacteristic::WriteRemoteCharacteristic.
- void OnWriteValueSuccess(int thread_id, int request_id);
- void OnWriteValueFailed(int thread_id,
- int request_id,
- device::BluetoothGattService::GattErrorCode);
-
// Callbacks for BluetoothGattCharacteristic::StartNotifySession.
void OnStartNotifySessionSuccess(
int thread_id,
@@ -248,12 +261,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
// in the |outcome| field, and |device| and |service| fields if successful.
CacheQueryResult QueryCacheForService(const url::Origin& origin,
const std::string& service_instance_id);
- // Queries the platform cache for a characteristic with
- // |characteristic_instance_id|. Fills in the |outcome| field, and |device|,
- // |service| and |characteristic| fields if successful.
- CacheQueryResult QueryCacheForCharacteristic(
- const url::Origin& origin,
- const std::string& characteristic_instance_id);
// Adds the PrimaryServicesRequest to the vector of pending services requests
// for that device.
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698