Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/bluetooth/bluetooth_dispatcher.h" | 5 #include "content/renderer/bluetooth/bluetooth_dispatcher.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 int request_id, | 656 int request_id, |
| 657 WebBluetoothError error) { | 657 WebBluetoothError error) { |
| 658 DCHECK(pending_read_value_requests_.Lookup(request_id)) << request_id; | 658 DCHECK(pending_read_value_requests_.Lookup(request_id)) << request_id; |
| 659 | 659 |
| 660 pending_read_value_requests_.Lookup(request_id) | 660 pending_read_value_requests_.Lookup(request_id) |
| 661 ->onError(WebBluetoothError(error)); | 661 ->onError(WebBluetoothError(error)); |
| 662 | 662 |
| 663 pending_read_value_requests_.Remove(request_id); | 663 pending_read_value_requests_.Remove(request_id); |
| 664 } | 664 } |
| 665 | 665 |
| 666 void BluetoothDispatcher::OnWriteValueSuccess(int thread_id, int request_id) { | 666 void BluetoothDispatcher::OnWriteValueSuccess( |
| 667 int thread_id, | |
| 668 int request_id, | |
| 669 const std::vector<uint8_t>& value) { | |
|
ortuno
2016/01/20 16:34:40
I don't think you need to send back the value. You
| |
| 667 DCHECK(pending_write_value_requests_.Lookup(request_id)) << request_id; | 670 DCHECK(pending_write_value_requests_.Lookup(request_id)) << request_id; |
| 668 | 671 |
| 669 pending_write_value_requests_.Lookup(request_id)->onSuccess(); | 672 pending_write_value_requests_.Lookup(request_id)->onSuccess(value); |
| 670 | 673 |
| 671 pending_write_value_requests_.Remove(request_id); | 674 pending_write_value_requests_.Remove(request_id); |
| 672 } | 675 } |
| 673 | 676 |
| 674 void BluetoothDispatcher::OnWriteValueError(int thread_id, | 677 void BluetoothDispatcher::OnWriteValueError(int thread_id, |
| 675 int request_id, | 678 int request_id, |
| 676 WebBluetoothError error) { | 679 WebBluetoothError error) { |
| 677 DCHECK(pending_write_value_requests_.Lookup(request_id)) << request_id; | 680 DCHECK(pending_write_value_requests_.Lookup(request_id)) << request_id; |
| 678 | 681 |
| 679 pending_write_value_requests_.Lookup(request_id) | 682 pending_write_value_requests_.Lookup(request_id) |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 762 int thread_id, | 765 int thread_id, |
| 763 const std::string& characteristic_instance_id, | 766 const std::string& characteristic_instance_id, |
| 764 const std::vector<uint8_t> new_value) { | 767 const std::vector<uint8_t> new_value) { |
| 765 auto active_iter = active_characteristics_.find(characteristic_instance_id); | 768 auto active_iter = active_characteristics_.find(characteristic_instance_id); |
| 766 if (active_iter != active_characteristics_.end()) { | 769 if (active_iter != active_characteristics_.end()) { |
| 767 active_iter->second->dispatchCharacteristicValueChanged(new_value); | 770 active_iter->second->dispatchCharacteristicValueChanged(new_value); |
| 768 } | 771 } |
| 769 } | 772 } |
| 770 | 773 |
| 771 } // namespace content | 774 } // namespace content |
| OLD | NEW |