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

Unified Diff: content/renderer/bluetooth/bluetooth_dispatcher.cc

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 | « content/renderer/bluetooth/bluetooth_dispatcher.h ('k') | content/renderer/bluetooth/web_bluetooth_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/bluetooth/bluetooth_dispatcher.cc
diff --git a/content/renderer/bluetooth/bluetooth_dispatcher.cc b/content/renderer/bluetooth/bluetooth_dispatcher.cc
index 5c4e81bcd48e485c028caa6046b00c7efd04a1ed..a4b7b4756cb6591e7f38064b6f0f8eefd9616b92 100644
--- a/content/renderer/bluetooth/bluetooth_dispatcher.cc
+++ b/content/renderer/bluetooth/bluetooth_dispatcher.cc
@@ -76,17 +76,6 @@ struct BluetoothCharacteristicsRequest {
scoped_ptr<blink::WebBluetoothGetCharacteristicsCallbacks> callbacks;
};
-// Struct that holds a pending WriteValue request.
-struct BluetoothWriteValueRequest {
- BluetoothWriteValueRequest(const blink::WebVector<uint8_t>& value,
- blink::WebBluetoothWriteValueCallbacks* callbacks)
- : value(value), callbacks(callbacks) {}
- ~BluetoothWriteValueRequest() {}
-
- const blink::WebVector<uint8_t> value;
- scoped_ptr<blink::WebBluetoothWriteValueCallbacks> callbacks;
-};
-
// Struct that holds a pending Start/StopNotifications request.
struct BluetoothNotificationsRequest {
BluetoothNotificationsRequest(
@@ -198,10 +187,6 @@ void BluetoothDispatcher::OnMessageReceived(const IPC::Message& msg) {
OnReadValueSuccess);
IPC_MESSAGE_HANDLER(BluetoothMsg_ReadCharacteristicValueError,
OnReadValueError);
- IPC_MESSAGE_HANDLER(BluetoothMsg_WriteCharacteristicValueSuccess,
- OnWriteValueSuccess);
- IPC_MESSAGE_HANDLER(BluetoothMsg_WriteCharacteristicValueError,
- OnWriteValueError);
IPC_MESSAGE_HANDLER(BluetoothMsg_StartNotificationsSuccess,
OnStartNotificationsSuccess)
IPC_MESSAGE_HANDLER(BluetoothMsg_StartNotificationsError,
@@ -306,19 +291,6 @@ void BluetoothDispatcher::readValue(
characteristic_instance_id.utf8()));
}
-void BluetoothDispatcher::writeValue(
- int frame_routing_id,
- const blink::WebString& characteristic_instance_id,
- const blink::WebVector<uint8_t>& value,
- blink::WebBluetoothWriteValueCallbacks* callbacks) {
- int request_id = pending_write_value_requests_.Add(
- new BluetoothWriteValueRequest(value, callbacks));
- Send(new BluetoothHostMsg_WriteValue(
- CurrentWorkerId(), request_id, frame_routing_id,
- characteristic_instance_id.utf8(),
- std::vector<uint8_t>(value.begin(), value.end())));
-}
-
void BluetoothDispatcher::startNotifications(
int frame_routing_id,
const blink::WebString& characteristic_instance_id,
@@ -767,28 +739,6 @@ void BluetoothDispatcher::OnReadValueError(int thread_id,
pending_read_value_requests_.Remove(request_id);
}
-void BluetoothDispatcher::OnWriteValueSuccess(int thread_id, int request_id) {
- DCHECK(pending_write_value_requests_.Lookup(request_id)) << request_id;
-
- BluetoothWriteValueRequest* request =
- pending_write_value_requests_.Lookup(request_id);
- request->callbacks->onSuccess(request->value);
-
- pending_write_value_requests_.Remove(request_id);
-}
-
-void BluetoothDispatcher::OnWriteValueError(int thread_id,
- int request_id,
- WebBluetoothError error) {
- DCHECK(pending_write_value_requests_.Lookup(request_id)) << request_id;
-
- BluetoothWriteValueRequest* request =
- pending_write_value_requests_.Lookup(request_id);
- request->callbacks->onError(WebBluetoothError(error));
-
- pending_write_value_requests_.Remove(request_id);
-}
-
void BluetoothDispatcher::OnStartNotificationsSuccess(int thread_id,
int request_id) {
DCHECK(pending_notifications_requests_.Lookup(request_id)) << request_id;
« no previous file with comments | « content/renderer/bluetooth/bluetooth_dispatcher.h ('k') | content/renderer/bluetooth/web_bluetooth_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698