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

Side by Side Diff: content/renderer/bluetooth/bluetooth_dispatcher.cc

Issue 1611443002: bluetooth: Update BluetoothGATTCharacteristic.value on writeValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@useDataview
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/bluetooth/bluetooth_dispatcher.h ('k') | third_party/WebKit/LayoutTests/bluetooth/writeValue.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698