diff options
author | ortuno <ortuno@chromium.org> | 2016-02-18 16:42:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-19 00:44:27 +0000 |
commit | 9c24d5df79c6e5a8432f93243543039387abe162 (patch) | |
tree | 7bb5434d4cfdc37d72aba6eab8589c6d506a5919 | |
parent | 56488de1008806820644724ff688491a68b361ad (diff) | |
download | chromium_src-9c24d5df79c6e5a8432f93243543039387abe162.zip chromium_src-9c24d5df79c6e5a8432f93243543039387abe162.tar.gz chromium_src-9c24d5df79c6e5a8432f93243543039387abe162.tar.bz2 |
bluetooth: Add "Remote" to Web Bluetooth class names
To conform to the new names in the spec:
* BluetoothGATTRemoteServer -> BluetoothRemoteGATTServer
* BluetoothGATTService -> BluetoothRemoteGATTService
* BluetoothGATTCharacteristic -> BluetoothRemoteGATTCharacteristic
BUG=582567
Review URL: https://codereview.chromium.org/1708053002
Cr-Commit-Position: refs/heads/master@{#376312}
29 files changed, 224 insertions, 220 deletions
diff --git a/content/renderer/bluetooth/bluetooth_dispatcher.cc b/content/renderer/bluetooth/bluetooth_dispatcher.cc index 966320f..d24a056 100644 --- a/content/renderer/bluetooth/bluetooth_dispatcher.cc +++ b/content/renderer/bluetooth/bluetooth_dispatcher.cc @@ -16,16 +16,16 @@ #include "third_party/WebKit/public/platform/WebPassOwnPtr.h" #include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothDevice.h" #include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothError.h" -#include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h" -#include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTCharacteristicInit.h" -#include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTService.h" +#include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristic.h" +#include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristicInit.h" +#include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTService.h" #include "third_party/WebKit/public/platform/modules/bluetooth/WebRequestDeviceOptions.h" using blink::WebBluetoothDevice; using blink::WebBluetoothError; -using blink::WebBluetoothGATTCharacteristicInit; -using blink::WebBluetoothGATTServerConnectCallbacks; -using blink::WebBluetoothGATTService; +using blink::WebBluetoothRemoteGATTCharacteristicInit; +using blink::WebBluetoothRemoteGATTServerConnectCallbacks; +using blink::WebBluetoothRemoteGATTService; using blink::WebBluetoothReadValueCallbacks; using blink::WebBluetoothRequestDeviceCallbacks; using blink::WebBluetoothScanFilter; @@ -81,7 +81,7 @@ struct BluetoothNotificationsRequest { BluetoothNotificationsRequest( int frame_routing_id, const std::string characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, blink::WebBluetoothNotificationsCallbacks* callbacks, NotificationsRequestType type) : frame_routing_id(frame_routing_id), @@ -99,7 +99,7 @@ struct BluetoothNotificationsRequest { // destroyed, which in turn calls characteristicObjectRemoved. // characteristicObjectRemoved will null any pointers to the object // and queue a stop notifications request if necessary. - blink::WebBluetoothGATTCharacteristic* characteristic; + blink::WebBluetoothRemoteGATTCharacteristic* characteristic; scoped_ptr<blink::WebBluetoothNotificationsCallbacks> callbacks; NotificationsRequestType type; }; @@ -232,7 +232,7 @@ void BluetoothDispatcher::requestDevice( void BluetoothDispatcher::connect( int frame_routing_id, const blink::WebString& device_id, - blink::WebBluetoothGATTServerConnectCallbacks* callbacks) { + blink::WebBluetoothRemoteGATTServerConnectCallbacks* callbacks) { int request_id = pending_connect_requests_.Add(callbacks); Send(new BluetoothHostMsg_GATTServerConnect( CurrentWorkerId(), request_id, frame_routing_id, device_id.utf8())); @@ -295,7 +295,7 @@ void BluetoothDispatcher::writeValue( void BluetoothDispatcher::startNotifications( int frame_routing_id, const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, blink::WebBluetoothNotificationsCallbacks* callbacks) { int request_id = QueueNotificationRequest( frame_routing_id, characteristic_instance_id.utf8(), characteristic, @@ -314,7 +314,7 @@ void BluetoothDispatcher::startNotifications( void BluetoothDispatcher::stopNotifications( int frame_routing_id, const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, blink::WebBluetoothNotificationsCallbacks* callbacks) { int request_id = QueueNotificationRequest( frame_routing_id, characteristic_instance_id.utf8(), characteristic, @@ -330,7 +330,7 @@ void BluetoothDispatcher::stopNotifications( void BluetoothDispatcher::characteristicObjectRemoved( int frame_routing_id, const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic) { + blink::WebBluetoothRemoteGATTCharacteristic* characteristic) { // We need to remove references to the object from the following: // 1) The set of active characteristics // 2) The queue waiting for a response @@ -394,7 +394,7 @@ void BluetoothDispatcher::characteristicObjectRemoved( void BluetoothDispatcher::registerCharacteristicObject( int frame_routing_id, const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic) { + blink::WebBluetoothRemoteGATTCharacteristic* characteristic) { // TODO(ortuno): After the Object manager is implemented, there will // only be one object per characteristic. But for now we remove // the previous object. @@ -415,7 +415,7 @@ void BluetoothDispatcher::WillStopCurrentWorkerThread() { int BluetoothDispatcher::QueueNotificationRequest( int frame_routing_id, const std::string& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, blink::WebBluetoothNotificationsCallbacks* callbacks, NotificationsRequestType type) { int request_id = @@ -478,14 +478,14 @@ bool BluetoothDispatcher::HasActiveNotificationSubscription( void BluetoothDispatcher::AddToActiveNotificationSubscriptions( const std::string& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic) { + blink::WebBluetoothRemoteGATTCharacteristic* characteristic) { active_notification_subscriptions_[characteristic_instance_id].insert( characteristic); } bool BluetoothDispatcher::RemoveFromActiveNotificationSubscriptions( const std::string& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic) { + blink::WebBluetoothRemoteGATTCharacteristic* characteristic) { auto active_map = active_notification_subscriptions_.find(characteristic_instance_id); @@ -510,7 +510,7 @@ void BluetoothDispatcher::ResolveOrSendStartNotificationRequest( const int frame_routing_id = request->frame_routing_id; const std::string& characteristic_instance_id = request->characteristic_instance_id; - blink::WebBluetoothGATTCharacteristic* characteristic = + blink::WebBluetoothRemoteGATTCharacteristic* characteristic = request->characteristic; blink::WebBluetoothNotificationsCallbacks* callbacks = request->callbacks.get(); @@ -544,7 +544,7 @@ void BluetoothDispatcher::ResolveOrSendStopNotificationsRequest( const int frame_routing_id = request->frame_routing_id; const std::string& characteristic_instance_id = request->characteristic_instance_id; - blink::WebBluetoothGATTCharacteristic* characteristic = + blink::WebBluetoothRemoteGATTCharacteristic* characteristic = request->characteristic; blink::WebBluetoothNotificationsCallbacks* callbacks = request->callbacks.get(); @@ -631,9 +631,10 @@ void BluetoothDispatcher::OnGetPrimaryServiceSuccess( DCHECK(pending_primary_service_requests_.Lookup(request_id)) << request_id; BluetoothPrimaryServiceRequest* request = pending_primary_service_requests_.Lookup(request_id); - request->callbacks->onSuccess(blink::adoptWebPtr(new WebBluetoothGATTService( - WebString::fromUTF8(service_instance_id), request->service_uuid, - true /* isPrimary */, request->device_id))); + request->callbacks->onSuccess( + blink::adoptWebPtr(new WebBluetoothRemoteGATTService( + WebString::fromUTF8(service_instance_id), request->service_uuid, + true /* isPrimary */, request->device_id))); pending_primary_service_requests_.Remove(request_id); } @@ -657,7 +658,7 @@ void BluetoothDispatcher::OnGetCharacteristicSuccess( BluetoothCharacteristicRequest* request = pending_characteristic_requests_.Lookup(request_id); request->callbacks->onSuccess( - blink::adoptWebPtr(new WebBluetoothGATTCharacteristicInit( + blink::adoptWebPtr(new WebBluetoothRemoteGATTCharacteristicInit( WebString::fromUTF8(characteristic_instance_id), request->service_instance_id, request->characteristic_uuid, characteristic_properties))); diff --git a/content/renderer/bluetooth/bluetooth_dispatcher.h b/content/renderer/bluetooth/bluetooth_dispatcher.h index 4668b5b..1054ac4 100644 --- a/content/renderer/bluetooth/bluetooth_dispatcher.h +++ b/content/renderer/bluetooth/bluetooth_dispatcher.h @@ -24,7 +24,7 @@ class TaskRunner; } namespace blink { -class WebBluetoothGATTCharacteristic; +class WebBluetoothRemoteGATTCharacteristic; } namespace IPC { @@ -67,7 +67,7 @@ class BluetoothDispatcher : public WorkerThread::Observer { blink::WebBluetoothRequestDeviceCallbacks* callbacks); void connect(int frame_routing_id, const blink::WebString& device_id, - blink::WebBluetoothGATTServerConnectCallbacks* callbacks); + blink::WebBluetoothRemoteGATTServerConnectCallbacks* callbacks); void disconnect(int frame_routing_id, const blink::WebString& device_id); void getPrimaryService( int frame_routing_id, @@ -89,20 +89,20 @@ class BluetoothDispatcher : public WorkerThread::Observer { blink::WebBluetoothWriteValueCallbacks*); void startNotifications(int frame_routing_id, const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* delegate, + blink::WebBluetoothRemoteGATTCharacteristic* delegate, blink::WebBluetoothNotificationsCallbacks*); void stopNotifications(int frame_routing_id, const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* delegate, + blink::WebBluetoothRemoteGATTCharacteristic* delegate, blink::WebBluetoothNotificationsCallbacks*); void characteristicObjectRemoved( int frame_routing_id, const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* delegate); + blink::WebBluetoothRemoteGATTCharacteristic* delegate); void registerCharacteristicObject( int frame_routing_id, const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic); + blink::WebBluetoothRemoteGATTCharacteristic* characteristic); // WorkerThread::Observer implementation. void WillStopCurrentWorkerThread() override; @@ -126,7 +126,7 @@ class BluetoothDispatcher : public WorkerThread::Observer { int QueueNotificationRequest( int frame_routing_id, const std::string& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, blink::WebBluetoothNotificationsCallbacks* callbacks, NotificationsRequestType type); // Pops the last requests and runs the next request in the queue. @@ -143,13 +143,13 @@ class BluetoothDispatcher : public WorkerThread::Observer { // notifications. void AddToActiveNotificationSubscriptions( const std::string& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic); + blink::WebBluetoothRemoteGATTCharacteristic* characteristic); // Removes the object from the set of subscribed object to the // characteristic's notifications. Returns true if the subscription // becomes inactive. bool RemoveFromActiveNotificationSubscriptions( const std::string& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic); + blink::WebBluetoothRemoteGATTCharacteristic* characteristic); // The following functions decide whether to resolve the request immediately // or send an IPC to change the subscription state. @@ -228,7 +228,7 @@ class BluetoothDispatcher : public WorkerThread::Observer { pending_requests_; // Tracks requests to connect to a device. // Owns callback objects. - IDMap<blink::WebBluetoothGATTServerConnectCallbacks, IDMapOwnPointer> + IDMap<blink::WebBluetoothRemoteGATTServerConnectCallbacks, IDMapOwnPointer> pending_connect_requests_; // Tracks requests to get a primary service from a device. // Owns request objects. @@ -246,19 +246,20 @@ class BluetoothDispatcher : public WorkerThread::Observer { pending_notifications_requests_; // Map of characteristic_instance_id to a set of - // WebBluetoothGATTCharacteristic pointers. Keeps track of which + // WebBluetoothRemoteGATTCharacteristic pointers. Keeps track of which // objects are subscribed to notifications. - std::map<std::string, std::set<blink::WebBluetoothGATTCharacteristic*>> + std::map<std::string, std::set<blink::WebBluetoothRemoteGATTCharacteristic*>> active_notification_subscriptions_; - // Map of characteristic_instance_ids to WebBluetoothGATTCharacteristics. + // Map of characteristic_instance_ids to + // WebBluetoothRemoteGATTCharacteristics. // Keeps track of what characteristics have listeners. // TODO(ortuno): We are assuming that there exists a single frame per // dispatcher, so there could be at most one characteristic object per // characteristic_instance_id. Change to a set when we support multiple // frames. // http://crbug.com/541388 - std::map<std::string, blink::WebBluetoothGATTCharacteristic*> + std::map<std::string, blink::WebBluetoothRemoteGATTCharacteristic*> active_characteristics_; DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcher); diff --git a/content/renderer/bluetooth/web_bluetooth_impl.cc b/content/renderer/bluetooth/web_bluetooth_impl.cc index 09fd817..d138492 100644 --- a/content/renderer/bluetooth/web_bluetooth_impl.cc +++ b/content/renderer/bluetooth/web_bluetooth_impl.cc @@ -29,7 +29,7 @@ void WebBluetoothImpl::requestDevice( void WebBluetoothImpl::connect( const blink::WebString& device_id, - blink::WebBluetoothGATTServerConnectCallbacks* callbacks) { + blink::WebBluetoothRemoteGATTServerConnectCallbacks* callbacks) { GetDispatcher()->connect(frame_routing_id_, device_id, callbacks); } @@ -70,7 +70,7 @@ void WebBluetoothImpl::writeValue( void WebBluetoothImpl::startNotifications( const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, blink::WebBluetoothNotificationsCallbacks* callbacks) { GetDispatcher()->startNotifications( frame_routing_id_, characteristic_instance_id, characteristic, callbacks); @@ -78,7 +78,7 @@ void WebBluetoothImpl::startNotifications( void WebBluetoothImpl::stopNotifications( const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, blink::WebBluetoothNotificationsCallbacks* callbacks) { GetDispatcher()->stopNotifications( frame_routing_id_, characteristic_instance_id, characteristic, callbacks); @@ -86,14 +86,14 @@ void WebBluetoothImpl::stopNotifications( void WebBluetoothImpl::characteristicObjectRemoved( const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic) { + blink::WebBluetoothRemoteGATTCharacteristic* characteristic) { GetDispatcher()->characteristicObjectRemoved( frame_routing_id_, characteristic_instance_id, characteristic); } void WebBluetoothImpl::registerCharacteristicObject( const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic) { + blink::WebBluetoothRemoteGATTCharacteristic* characteristic) { GetDispatcher()->registerCharacteristicObject( frame_routing_id_, characteristic_instance_id, characteristic); } diff --git a/content/renderer/bluetooth/web_bluetooth_impl.h b/content/renderer/bluetooth/web_bluetooth_impl.h index ca40070..5ba96eb 100644 --- a/content/renderer/bluetooth/web_bluetooth_impl.h +++ b/content/renderer/bluetooth/web_bluetooth_impl.h @@ -16,7 +16,7 @@ #include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h" namespace blink { -class WebBluetoothGATTCharacteristic; +class WebBluetoothRemoteGATTCharacteristic; } namespace content { @@ -39,7 +39,7 @@ class CONTENT_EXPORT WebBluetoothImpl blink::WebBluetoothRequestDeviceCallbacks* callbacks) override; void connect( const blink::WebString& device_id, - blink::WebBluetoothGATTServerConnectCallbacks* callbacks) override; + blink::WebBluetoothRemoteGATTServerConnectCallbacks* callbacks) override; void disconnect(const blink::WebString& device_id) override; void getPrimaryService( const blink::WebString& device_id, @@ -54,18 +54,20 @@ class CONTENT_EXPORT WebBluetoothImpl void writeValue(const blink::WebString& characteristic_instance_id, const blink::WebVector<uint8_t>& value, blink::WebBluetoothWriteValueCallbacks*) override; - void startNotifications(const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, - blink::WebBluetoothNotificationsCallbacks*) override; - void stopNotifications(const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic, - blink::WebBluetoothNotificationsCallbacks*) override; + void startNotifications( + const blink::WebString& characteristic_instance_id, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, + blink::WebBluetoothNotificationsCallbacks*) override; + void stopNotifications( + const blink::WebString& characteristic_instance_id, + blink::WebBluetoothRemoteGATTCharacteristic* characteristic, + blink::WebBluetoothNotificationsCallbacks*) override; void characteristicObjectRemoved( const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic) override; + blink::WebBluetoothRemoteGATTCharacteristic* characteristic) override; void registerCharacteristicObject( const blink::WebString& characteristic_instance_id, - blink::WebBluetoothGATTCharacteristic* characteristic) override; + blink::WebBluetoothRemoteGATTCharacteristic* characteristic) override; private: BluetoothDispatcher* GetDispatcher(); diff --git a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristic.html b/third_party/WebKit/LayoutTests/bluetooth/getCharacteristic.html index fd5c4ad..2906262 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/getCharacteristic.html +++ b/third_party/WebKit/LayoutTests/bluetooth/getCharacteristic.html @@ -112,7 +112,7 @@ promise_test(() => { return assert_promise_rejects_with_message( service.getCharacteristic('wrong_name'), new DOMException( 'Failed to execute \'getCharacteristic\' on ' + - '\'BluetoothGATTService\': Invalid Characteristic name: ' + + '\'BluetoothRemoteGATTService\': Invalid Characteristic name: ' + '\'wrong_name\'. ' + 'It must be a valid UUID alias (e.g. 0x1234), ' + 'UUID (lowercase hex characters e.g. ' + diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService.html index 354d48c..6b0cdbb 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService.html +++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService.html @@ -148,7 +148,7 @@ promise_test(() => { return assert_promise_rejects_with_message( gattServer.getPrimaryService('wrong_name'), new DOMException( 'Failed to execute \'getPrimaryService\' on ' + - '\'BluetoothGATTRemoteServer\': Invalid Service name: ' + + '\'BluetoothRemoteGATTServer\': Invalid Service name: ' + '\'wrong_name\'. ' + 'It must be a valid UUID alias (e.g. 0x1234), ' + 'UUID (lowercase hex characters e.g. ' + diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt index 446fb52..84af9c7 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt @@ -5837,9 +5837,9 @@ interface webkitURL attribute BluetoothAdvertisingData attribute BluetoothCharacteristicProperties attribute BluetoothDevice - attribute BluetoothGATTCharacteristic - attribute BluetoothGATTRemoteServer - attribute BluetoothGATTService + attribute BluetoothRemoteGATTCharacteristic + attribute BluetoothRemoteGATTServer + attribute BluetoothRemoteGATTService attribute BluetoothUUID attribute GCController attribute accessibilityController diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index a2a4524..436bd68 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt @@ -321,7 +321,7 @@ interface BluetoothDevice : EventTarget method connectGATT method constructor setter ongattserverdisconnected -interface BluetoothGATTCharacteristic : EventTarget +interface BluetoothRemoteGATTCharacteristic : EventTarget getter oncharacteristicvaluechanged getter properties getter uuid @@ -332,14 +332,14 @@ interface BluetoothGATTCharacteristic : EventTarget method stopNotifications method writeValue setter oncharacteristicvaluechanged -interface BluetoothGATTRemoteServer +interface BluetoothRemoteGATTServer getter connected getter device method connect method constructor method disconnect method getPrimaryService -interface BluetoothGATTService +interface BluetoothRemoteGATTService getter isPrimary getter uuid method constructor diff --git a/third_party/WebKit/Source/modules/EventTargetModulesFactory.in b/third_party/WebKit/Source/modules/EventTargetModulesFactory.in index 61414d0..7b35999 100644 --- a/third_party/WebKit/Source/modules/EventTargetModulesFactory.in +++ b/third_party/WebKit/Source/modules/EventTargetModulesFactory.in @@ -3,7 +3,7 @@ suffix="Modules" modules/battery/BatteryManager modules/bluetooth/BluetoothDevice -modules/bluetooth/BluetoothGATTCharacteristic +modules/bluetooth/BluetoothRemoteGATTCharacteristic modules/compositorworker/CompositorWorker modules/compositorworker/CompositorWorkerGlobalScope modules/encryptedmedia/MediaKeySession diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h index 7012f04..baf26f0 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothCharacteristicProperties.h @@ -10,7 +10,7 @@ namespace blink { -// Each BluetoothGATTCharacteristic exposes its characteristic properties +// Each BluetoothRemoteGATTCharacteristic exposes its characteristic properties // through a BluetoothCharacteristicProperties object. These properties express // what operations are valid on the characteristic. class BluetoothCharacteristicProperties final diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp index 0b5ac39..b763a3b 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp @@ -13,7 +13,7 @@ #include "core/events/Event.h" #include "core/page/PageVisibilityState.h" #include "modules/bluetooth/BluetoothError.h" -#include "modules/bluetooth/BluetoothGATTRemoteServer.h" +#include "modules/bluetooth/BluetoothRemoteGATTServer.h" #include "modules/bluetooth/BluetoothSupplement.h" #include "public/platform/modules/bluetooth/WebBluetooth.h" @@ -25,7 +25,7 @@ BluetoothDevice::BluetoothDevice(ExecutionContext* context, PassOwnPtr<WebBlueto , m_webDevice(webDevice) , m_adData(BluetoothAdvertisingData::create(m_webDevice->txPower, m_webDevice->rssi)) - , m_gatt(BluetoothGATTRemoteServer::create(this)) + , m_gatt(BluetoothRemoteGATTServer::create(this)) { // See example in Source/platform/heap/ThreadState.h ThreadState::current()->registerPreFinalizer(this); diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h index e83e0f3..bd38f71 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h @@ -10,7 +10,7 @@ #include "core/page/PageLifecycleObserver.h" #include "modules/EventTargetModules.h" #include "modules/bluetooth/BluetoothAdvertisingData.h" -#include "modules/bluetooth/BluetoothGATTRemoteServer.h" +#include "modules/bluetooth/BluetoothRemoteGATTServer.h" #include "platform/heap/Heap.h" #include "public/platform/modules/bluetooth/WebBluetoothDevice.h" #include "wtf/OwnPtr.h" @@ -19,7 +19,7 @@ namespace blink { -class BluetoothGATTRemoteServer; +class BluetoothRemoteGATTServer; class ScriptPromise; class ScriptPromiseResolver; class ScriptState; @@ -90,7 +90,7 @@ public: unsigned vendorID(bool& isNull); unsigned productID(bool& isNull); unsigned productVersion(bool& isNull); - BluetoothGATTRemoteServer* gatt() { return m_gatt; } + BluetoothRemoteGATTServer* gatt() { return m_gatt; } Vector<String> uuids(); // TODO(ortuno): Remove connectGATT // http://crbug.com/582292 @@ -101,7 +101,7 @@ public: private: OwnPtr<WebBluetoothDevice> m_webDevice; Member<BluetoothAdvertisingData> m_adData; - Member<BluetoothGATTRemoteServer> m_gatt; + Member<BluetoothRemoteGATTServer> m_gatt; }; } // namespace blink diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.idl b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.idl index 9753608..2bb26ce 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.idl +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.idl @@ -30,9 +30,9 @@ enum VendorIDSource { readonly attribute unsigned long? vendorID; readonly attribute unsigned long? productID; readonly attribute unsigned long? productVersion; - readonly attribute BluetoothGATTRemoteServer gatt; + readonly attribute BluetoothRemoteGATTServer gatt; readonly attribute UUID[] uuids; - [CallWith=ScriptState, DeprecateAs=BluetoothDeviceConnectGATT] Promise<BluetoothGATTRemoteServer> connectGATT (); + [CallWith=ScriptState, DeprecateAs=BluetoothDeviceConnectGATT] Promise<BluetoothRemoteGATTServer> connectGATT (); attribute EventHandler ongattserverdisconnected; }; diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTService.idl b/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTService.idl deleted file mode 100644 index 5ff18bc..0000000 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTService.idl +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattservice - -// Implement BluetoothGATTService interface: https://crbug.com/483342 - -[ - GarbageCollected, - RuntimeEnabled=WebBluetooth, - OriginTrialEnabled=WebBluetooth, -] interface BluetoothGATTService { // : ServiceEventHandlers { - readonly attribute UUID uuid; - readonly attribute boolean isPrimary; - // TODO(ortuno): Once device is implemented test that it matches - // the original device. - // readonly attribute BluetoothDevice device; - [RaisesException, CallWith=ScriptState] Promise<BluetoothGATTCharacteristic> getCharacteristic(BluetoothCharacteristicUUID characteristic); - // Promise<sequence<BluetoothGATTCharacteristic>> getCharacteristics(optional BluetoothCharacteristicUUID characteristic); - // Promise<BluetoothGATTService> getIncludedService(BluetoothServiceUUID service); - // Promise<sequence<BluetoothGATTService>> getIncludedServices(optional BluetoothServiceUUID service); -}; diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp index 27bcfc1..d457702 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "modules/bluetooth/BluetoothGATTCharacteristic.h" +#include "modules/bluetooth/BluetoothRemoteGATTCharacteristic.h" #include "bindings/core/v8/CallbackPromiseAdapter.h" #include "bindings/core/v8/ScriptPromise.h" @@ -31,7 +31,7 @@ PassRefPtr<DOMDataView> ConvertWebVectorToDataView( } // anonymous namespace -BluetoothGATTCharacteristic::BluetoothGATTCharacteristic(ExecutionContext* context, PassOwnPtr<WebBluetoothGATTCharacteristicInit> webCharacteristic) +BluetoothRemoteGATTCharacteristic::BluetoothRemoteGATTCharacteristic(ExecutionContext* context, PassOwnPtr<WebBluetoothRemoteGATTCharacteristicInit> webCharacteristic) : ActiveDOMObject(context) , m_webCharacteristic(webCharacteristic) , m_stopped(false) @@ -41,24 +41,24 @@ BluetoothGATTCharacteristic::BluetoothGATTCharacteristic(ExecutionContext* conte ThreadState::current()->registerPreFinalizer(this); } -BluetoothGATTCharacteristic* BluetoothGATTCharacteristic::take(ScriptPromiseResolver* resolver, PassOwnPtr<WebBluetoothGATTCharacteristicInit> webCharacteristic) +BluetoothRemoteGATTCharacteristic* BluetoothRemoteGATTCharacteristic::take(ScriptPromiseResolver* resolver, PassOwnPtr<WebBluetoothRemoteGATTCharacteristicInit> webCharacteristic) { if (!webCharacteristic) { return nullptr; } - BluetoothGATTCharacteristic* characteristic = new BluetoothGATTCharacteristic(resolver->executionContext(), webCharacteristic); + BluetoothRemoteGATTCharacteristic* characteristic = new BluetoothRemoteGATTCharacteristic(resolver->executionContext(), webCharacteristic); // See note in ActiveDOMObject about suspendIfNeeded. characteristic->suspendIfNeeded(); return characteristic; } -void BluetoothGATTCharacteristic::setValue( +void BluetoothRemoteGATTCharacteristic::setValue( const PassRefPtr<DOMDataView>& domDataView) { m_value = domDataView; } -void BluetoothGATTCharacteristic::dispatchCharacteristicValueChanged( +void BluetoothRemoteGATTCharacteristic::dispatchCharacteristicValueChanged( const WebVector<uint8_t>& value) { RefPtr<DOMDataView> domDataView = ConvertWebVectorToDataView(value); @@ -66,17 +66,17 @@ void BluetoothGATTCharacteristic::dispatchCharacteristicValueChanged( dispatchEvent(Event::create(EventTypeNames::characteristicvaluechanged)); } -void BluetoothGATTCharacteristic::stop() +void BluetoothRemoteGATTCharacteristic::stop() { notifyCharacteristicObjectRemoved(); } -void BluetoothGATTCharacteristic::dispose() +void BluetoothRemoteGATTCharacteristic::dispose() { notifyCharacteristicObjectRemoved(); } -void BluetoothGATTCharacteristic::notifyCharacteristicObjectRemoved() +void BluetoothRemoteGATTCharacteristic::notifyCharacteristicObjectRemoved() { if (!m_stopped) { m_stopped = true; @@ -85,17 +85,17 @@ void BluetoothGATTCharacteristic::notifyCharacteristicObjectRemoved() } } -const WTF::AtomicString& BluetoothGATTCharacteristic::interfaceName() const +const WTF::AtomicString& BluetoothRemoteGATTCharacteristic::interfaceName() const { - return EventTargetNames::BluetoothGATTCharacteristic; + return EventTargetNames::BluetoothRemoteGATTCharacteristic; } -ExecutionContext* BluetoothGATTCharacteristic::executionContext() const +ExecutionContext* BluetoothRemoteGATTCharacteristic::executionContext() const { return ActiveDOMObject::executionContext(); } -bool BluetoothGATTCharacteristic::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) +bool BluetoothRemoteGATTCharacteristic::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) { // We will also need to unregister a characteristic once all the event // listeners have been removed. See http://crbug.com/541390 @@ -108,7 +108,7 @@ bool BluetoothGATTCharacteristic::addEventListenerInternal(const AtomicString& e class ReadValueCallback : public WebBluetoothReadValueCallbacks { public: - ReadValueCallback(BluetoothGATTCharacteristic* characteristic, ScriptPromiseResolver* resolver) : m_webCharacteristic(characteristic), m_resolver(resolver) {} + ReadValueCallback(BluetoothRemoteGATTCharacteristic* characteristic, ScriptPromiseResolver* resolver) : m_webCharacteristic(characteristic), m_resolver(resolver) {} void onSuccess(const WebVector<uint8_t>& value) override { @@ -130,11 +130,11 @@ public: } private: - WeakPersistent<BluetoothGATTCharacteristic> m_webCharacteristic; + WeakPersistent<BluetoothRemoteGATTCharacteristic> m_webCharacteristic; Persistent<ScriptPromiseResolver> m_resolver; }; -ScriptPromise BluetoothGATTCharacteristic::readValue(ScriptState* scriptState) +ScriptPromise BluetoothRemoteGATTCharacteristic::readValue(ScriptState* scriptState) { WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState); @@ -147,7 +147,7 @@ ScriptPromise BluetoothGATTCharacteristic::readValue(ScriptState* scriptState) class WriteValueCallback : public WebBluetoothWriteValueCallbacks { public: - WriteValueCallback(BluetoothGATTCharacteristic* characteristic, ScriptPromiseResolver* resolver) : m_webCharacteristic(characteristic), m_resolver(resolver) {} + WriteValueCallback(BluetoothRemoteGATTCharacteristic* characteristic, ScriptPromiseResolver* resolver) : m_webCharacteristic(characteristic), m_resolver(resolver) {} void onSuccess(const WebVector<uint8_t>& value) override { @@ -168,11 +168,11 @@ public: } private: - WeakPersistent<BluetoothGATTCharacteristic> m_webCharacteristic; + WeakPersistent<BluetoothRemoteGATTCharacteristic> m_webCharacteristic; Persistent<ScriptPromiseResolver> m_resolver; }; -ScriptPromise BluetoothGATTCharacteristic::writeValue(ScriptState* scriptState, const DOMArrayPiece& value) +ScriptPromise BluetoothRemoteGATTCharacteristic::writeValue(ScriptState* scriptState, const DOMArrayPiece& value) { WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState); // Partial implementation of writeValue algorithm: @@ -195,7 +195,7 @@ ScriptPromise BluetoothGATTCharacteristic::writeValue(ScriptState* scriptState, return promise; } -ScriptPromise BluetoothGATTCharacteristic::startNotifications(ScriptState* scriptState) +ScriptPromise BluetoothRemoteGATTCharacteristic::startNotifications(ScriptState* scriptState) { WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); @@ -204,7 +204,7 @@ ScriptPromise BluetoothGATTCharacteristic::startNotifications(ScriptState* scrip return promise; } -ScriptPromise BluetoothGATTCharacteristic::stopNotifications(ScriptState* scriptState) +ScriptPromise BluetoothRemoteGATTCharacteristic::stopNotifications(ScriptState* scriptState) { WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); @@ -213,9 +213,9 @@ ScriptPromise BluetoothGATTCharacteristic::stopNotifications(ScriptState* script return promise; } -DEFINE_TRACE(BluetoothGATTCharacteristic) +DEFINE_TRACE(BluetoothRemoteGATTCharacteristic) { - RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothGATTCharacteristic>::trace(visitor); + RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothRemoteGATTCharacteristic>::trace(visitor); ActiveDOMObject::trace(visitor); visitor->trace(m_properties); } diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h index 0ff5428..3d7d20b 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BluetoothGATTCharacteristic_h -#define BluetoothGATTCharacteristic_h +#ifndef BluetoothRemoteGATTCharacteristic_h +#define BluetoothRemoteGATTCharacteristic_h #include "bindings/core/v8/ScriptWrappable.h" #include "core/dom/ActiveDOMObject.h" @@ -11,8 +11,8 @@ #include "core/dom/DOMDataView.h" #include "modules/EventTargetModules.h" #include "platform/heap/Handle.h" -#include "public/platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h" -#include "public/platform/modules/bluetooth/WebBluetoothGATTCharacteristicInit.h" +#include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristic.h" +#include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristicInit.h" #include "wtf/OwnPtr.h" #include "wtf/PassOwnPtr.h" #include "wtf/text/WTFString.h" @@ -25,33 +25,33 @@ class ScriptPromise; class ScriptPromiseResolver; class ScriptState; -// BluetoothGATTCharacteristic represents a GATT Characteristic, which is a +// BluetoothRemoteGATTCharacteristic represents a GATT Characteristic, which is a // basic data element that provides further information about a peripheral's // service. // -// Callbacks providing WebBluetoothGATTCharacteristicInit objects are handled by +// Callbacks providing WebBluetoothRemoteGATTCharacteristicInit objects are handled by // CallbackPromiseAdapter templatized with this class. See this class's // "Interface required by CallbackPromiseAdapter" section and the // CallbackPromiseAdapter class comments. -class BluetoothGATTCharacteristic final - : public RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothGATTCharacteristic> +class BluetoothRemoteGATTCharacteristic final + : public RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothRemoteGATTCharacteristic> , public ActiveDOMObject - , public WebBluetoothGATTCharacteristic { - USING_PRE_FINALIZER(BluetoothGATTCharacteristic, dispose); + , public WebBluetoothRemoteGATTCharacteristic { + USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose); DEFINE_WRAPPERTYPEINFO(); - REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothGATTCharacteristic); - WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothGATTCharacteristic); + REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(BluetoothRemoteGATTCharacteristic); + WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic); public: - explicit BluetoothGATTCharacteristic(ExecutionContext*, PassOwnPtr<WebBluetoothGATTCharacteristicInit>); + explicit BluetoothRemoteGATTCharacteristic(ExecutionContext*, PassOwnPtr<WebBluetoothRemoteGATTCharacteristicInit>); // Interface required by CallbackPromiseAdapter. - using WebType = OwnPtr<WebBluetoothGATTCharacteristicInit>; - static BluetoothGATTCharacteristic* take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoothGATTCharacteristicInit>); + using WebType = OwnPtr<WebBluetoothRemoteGATTCharacteristicInit>; + static BluetoothRemoteGATTCharacteristic* take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoothRemoteGATTCharacteristicInit>); // Save value. void setValue(const PassRefPtr<DOMDataView>&); - // WebBluetoothGATTCharacteristic interface: + // WebBluetoothRemoteGATTCharacteristic interface: void dispatchCharacteristicValueChanged(const WebVector<uint8_t>&) override; // ActiveDOMObject interface. @@ -89,7 +89,7 @@ protected: bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener>, const EventListenerOptions&) override; private: - OwnPtr<WebBluetoothGATTCharacteristicInit> m_webCharacteristic; + OwnPtr<WebBluetoothRemoteGATTCharacteristicInit> m_webCharacteristic; bool m_stopped; Member<BluetoothCharacteristicProperties> m_properties; RefPtr<DOMDataView> m_value; @@ -97,4 +97,4 @@ private: } // namespace blink -#endif // BluetoothGATTCharacteristic_h +#endif // BluetoothRemoteGATTCharacteristic_h diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.idl b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.idl index ebdd256..dad100f 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.idl +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.idl @@ -4,22 +4,22 @@ // https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattcharacteristic -// Implement BluetoothGATTCharacteristic interface: https://crbug.com/483344 +// Implement BluetoothRemoteGATTCharacteristic interface: https://crbug.com/483344 [ GarbageCollected, ActiveDOMObject, RuntimeEnabled=WebBluetooth, OriginTrialEnabled=WebBluetooth, -] interface BluetoothGATTCharacteristic : EventTarget {//: CharacteristicEventHandlers { +] interface BluetoothRemoteGATTCharacteristic : EventTarget {//: CharacteristicEventHandlers { // TODO(ortuno): Add test to make sure service matches the service // used to call getCharacteristic. - // readonly attribute BluetoothGATTService service; + // readonly attribute BluetoothRemoteGATTService service; readonly attribute UUID uuid; readonly attribute BluetoothCharacteristicProperties properties; readonly attribute DataView? value; - // Promise<BluetoothGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor); - // Promise<sequence<BluetoothGATTDescriptor>> getDescriptors(optional BluetoothDescriptorUUID descriptor); + // Promise<BluetoothRemoteGATTDescriptor> getDescriptor(BluetoothDescriptorUUID descriptor); + // Promise<sequence<BluetoothRemoteGATTDescriptor>> getDescriptors(optional BluetoothDescriptorUUID descriptor); [CallWith=ScriptState] Promise<DataView> readValue(); [CallWith=ScriptState] Promise<void> writeValue(BufferSource value); [CallWith=ScriptState] Promise<void> startNotifications(); diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp index 4a107fe..9ca7aad 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "modules/bluetooth/BluetoothGATTRemoteServer.h" +#include "modules/bluetooth/BluetoothRemoteGATTServer.h" #include "bindings/core/v8/CallbackPromiseAdapter.h" #include "bindings/core/v8/ScriptPromise.h" @@ -12,7 +12,7 @@ #include "core/dom/ExceptionCode.h" #include "core/page/Page.h" #include "modules/bluetooth/BluetoothError.h" -#include "modules/bluetooth/BluetoothGATTService.h" +#include "modules/bluetooth/BluetoothRemoteGATTService.h" #include "modules/bluetooth/BluetoothSupplement.h" #include "modules/bluetooth/BluetoothUUID.h" #include "public/platform/modules/bluetooth/WebBluetooth.h" @@ -25,23 +25,23 @@ const char kPageHiddenError[] = "Connection is only allowed while the page is vi } -BluetoothGATTRemoteServer::BluetoothGATTRemoteServer(BluetoothDevice* device) +BluetoothRemoteGATTServer::BluetoothRemoteGATTServer(BluetoothDevice* device) : m_device(device) , m_connected(false) { } -BluetoothGATTRemoteServer* BluetoothGATTRemoteServer::create(BluetoothDevice* device) +BluetoothRemoteGATTServer* BluetoothRemoteGATTServer::create(BluetoothDevice* device) { - return new BluetoothGATTRemoteServer(device); + return new BluetoothRemoteGATTServer(device); } -DEFINE_TRACE(BluetoothGATTRemoteServer) +DEFINE_TRACE(BluetoothRemoteGATTServer) { visitor->trace(m_device); } -class ConnectCallback : public WebBluetoothGATTServerConnectCallbacks { +class ConnectCallback : public WebBluetoothRemoteGATTServerConnectCallbacks { public: ConnectCallback(BluetoothDevice* device, ScriptPromiseResolver* resolver) : m_device(device) @@ -75,7 +75,7 @@ private: Persistent<ScriptPromiseResolver> m_resolver; }; -ScriptPromise BluetoothGATTRemoteServer::connect(ScriptState* scriptState) +ScriptPromise BluetoothRemoteGATTServer::connect(ScriptState* scriptState) { // TODO(ortuno): Allow connections when the tab is in the background. // This is a short term solution instead of implementing a tab indicator @@ -95,14 +95,14 @@ ScriptPromise BluetoothGATTRemoteServer::connect(ScriptState* scriptState) return promise; } -void BluetoothGATTRemoteServer::disconnect(ScriptState* scriptState) +void BluetoothRemoteGATTServer::disconnect(ScriptState* scriptState) { m_connected = false; WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState); webbluetooth->disconnect(device()->id()); } -ScriptPromise BluetoothGATTRemoteServer::getPrimaryService(ScriptState* scriptState, const StringOrUnsignedLong& service, ExceptionState& exceptionState) +ScriptPromise BluetoothRemoteGATTServer::getPrimaryService(ScriptState* scriptState, const StringOrUnsignedLong& service, ExceptionState& exceptionState) { WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState); @@ -112,7 +112,7 @@ ScriptPromise BluetoothGATTRemoteServer::getPrimaryService(ScriptState* scriptSt ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - webbluetooth->getPrimaryService(device()->id(), serviceUUID, new CallbackPromiseAdapter<BluetoothGATTService, BluetoothError>(resolver)); + webbluetooth->getPrimaryService(device()->id(), serviceUUID, new CallbackPromiseAdapter<BluetoothRemoteGATTService, BluetoothError>(resolver)); return promise; } diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.h index 6683586..417f2e5 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BluetoothGATTRemoteServer_h -#define BluetoothGATTRemoteServer_h +#ifndef BluetoothRemoteGATTServer_h +#define BluetoothRemoteGATTServer_h #include "bindings/core/v8/ScriptWrappable.h" #include "bindings/modules/v8/UnionTypesModules.h" @@ -20,15 +20,15 @@ class ScriptPromise; class ScriptPromiseResolver; class ScriptState; -// BluetoothGATTRemoteServer provides a way to interact with a connected bluetooth peripheral. -class BluetoothGATTRemoteServer final - : public GarbageCollectedFinalized<BluetoothGATTRemoteServer> +// BluetoothRemoteGATTServer provides a way to interact with a connected bluetooth peripheral. +class BluetoothRemoteGATTServer final + : public GarbageCollectedFinalized<BluetoothRemoteGATTServer> , public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: - BluetoothGATTRemoteServer(BluetoothDevice*); + BluetoothRemoteGATTServer(BluetoothDevice*); - static BluetoothGATTRemoteServer* create(BluetoothDevice*); + static BluetoothRemoteGATTServer* create(BluetoothDevice*); void setConnected(bool connected) { m_connected = connected; } diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.idl b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.idl index 3c609df..fee90a2 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.idl +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.idl @@ -10,12 +10,12 @@ GarbageCollected, RuntimeEnabled=WebBluetooth, OriginTrialEnabled=WebBluetooth, -] interface BluetoothGATTRemoteServer +] interface BluetoothRemoteGATTServer { readonly attribute BluetoothDevice device; readonly attribute boolean connected; - [CallWith=ScriptState] Promise<BluetoothGATTRemoteServer> connect(); + [CallWith=ScriptState] Promise<BluetoothRemoteGATTServer> connect(); [CallWith=ScriptState] void disconnect(); - [CallWith=ScriptState, RaisesException] Promise<BluetoothGATTService> getPrimaryService (BluetoothServiceUUID service); - // Promise<sequence<BluetoothGATTService>> getPrimaryServices (optional BluetoothServiceUUID service); + [CallWith=ScriptState, RaisesException] Promise<BluetoothRemoteGATTService> getPrimaryService (BluetoothServiceUUID service); + // Promise<sequence<BluetoothRemoteGATTService>> getPrimaryServices (optional BluetoothServiceUUID service); }; diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTService.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp index 13d2fee..9c71c57 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTService.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "modules/bluetooth/BluetoothGATTService.h" +#include "modules/bluetooth/BluetoothRemoteGATTService.h" #include "bindings/core/v8/CallbackPromiseAdapter.h" #include "bindings/core/v8/ScriptPromise.h" @@ -10,27 +10,27 @@ #include "core/dom/DOMException.h" #include "core/dom/ExceptionCode.h" #include "modules/bluetooth/BluetoothError.h" -#include "modules/bluetooth/BluetoothGATTCharacteristic.h" +#include "modules/bluetooth/BluetoothRemoteGATTCharacteristic.h" #include "modules/bluetooth/BluetoothSupplement.h" #include "modules/bluetooth/BluetoothUUID.h" #include "public/platform/modules/bluetooth/WebBluetooth.h" namespace blink { -BluetoothGATTService::BluetoothGATTService(PassOwnPtr<WebBluetoothGATTService> webService) +BluetoothRemoteGATTService::BluetoothRemoteGATTService(PassOwnPtr<WebBluetoothRemoteGATTService> webService) : m_webService(webService) { } -BluetoothGATTService* BluetoothGATTService::take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoothGATTService> webService) +BluetoothRemoteGATTService* BluetoothRemoteGATTService::take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoothRemoteGATTService> webService) { if (!webService) { return nullptr; } - return new BluetoothGATTService(webService); + return new BluetoothRemoteGATTService(webService); } -ScriptPromise BluetoothGATTService::getCharacteristic(ScriptState* scriptState, +ScriptPromise BluetoothRemoteGATTService::getCharacteristic(ScriptState* scriptState, const StringOrUnsignedLong& characteristic, ExceptionState& exceptionState) { WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState); @@ -41,7 +41,7 @@ ScriptPromise BluetoothGATTService::getCharacteristic(ScriptState* scriptState, ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - webbluetooth->getCharacteristic(m_webService->serviceInstanceID, characteristicUUID, new CallbackPromiseAdapter<BluetoothGATTCharacteristic, BluetoothError>(resolver)); + webbluetooth->getCharacteristic(m_webService->serviceInstanceID, characteristicUUID, new CallbackPromiseAdapter<BluetoothRemoteGATTCharacteristic, BluetoothError>(resolver)); return promise; } diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTService.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.h index f547dc8..55d64d0 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTService.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BluetoothGATTService_h -#define BluetoothGATTService_h +#ifndef BluetoothRemoteGATTService_h +#define BluetoothRemoteGATTService_h #include "bindings/core/v8/ScriptWrappable.h" #include "bindings/modules/v8/UnionTypesModules.h" #include "platform/heap/Handle.h" -#include "public/platform/modules/bluetooth/WebBluetoothGATTService.h" +#include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTService.h" #include "wtf/OwnPtr.h" #include "wtf/PassOwnPtr.h" #include "wtf/text/WTFString.h" @@ -23,20 +23,20 @@ class ScriptState; // characteristics and relationships to other services that encapsulate the // behavior of part of a device. // -// Callbacks providing WebBluetoothGATTService objects are handled by +// Callbacks providing WebBluetoothRemoteGATTService objects are handled by // CallbackPromiseAdapter templatized with this class. See this class's // "Interface required by CallbackPromiseAdapter" section and the // CallbackPromiseAdapter class comments. -class BluetoothGATTService final - : public GarbageCollectedFinalized<BluetoothGATTService> +class BluetoothRemoteGATTService final + : public GarbageCollectedFinalized<BluetoothRemoteGATTService> , public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: - explicit BluetoothGATTService(PassOwnPtr<WebBluetoothGATTService>); + explicit BluetoothRemoteGATTService(PassOwnPtr<WebBluetoothRemoteGATTService>); // Interface required by CallbackPromiseAdapter: - using WebType = OwnPtr<WebBluetoothGATTService>; - static BluetoothGATTService* take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoothGATTService>); + using WebType = OwnPtr<WebBluetoothRemoteGATTService>; + static BluetoothRemoteGATTService* take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoothRemoteGATTService>); // Interface required by garbage collection. DEFINE_INLINE_TRACE() { } @@ -47,9 +47,9 @@ public: ScriptPromise getCharacteristic(ScriptState*, const StringOrUnsignedLong& characteristic, ExceptionState&); private: - OwnPtr<WebBluetoothGATTService> m_webService; + OwnPtr<WebBluetoothRemoteGATTService> m_webService; }; } // namespace blink -#endif // BluetoothGATTService_h +#endif // BluetoothRemoteGATTService_h diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.idl b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.idl new file mode 100644 index 0000000..6579a6c --- /dev/null +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.idl @@ -0,0 +1,23 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattservice + +// Implement BluetoothRemoteGATTService interface: https://crbug.com/483342 + +[ + GarbageCollected, + RuntimeEnabled=WebBluetooth, + OriginTrialEnabled=WebBluetooth, +] interface BluetoothRemoteGATTService { // : ServiceEventHandlers { + readonly attribute UUID uuid; + readonly attribute boolean isPrimary; + // TODO(ortuno): Once device is implemented test that it matches + // the original device. + // readonly attribute BluetoothDevice device; + [RaisesException, CallWith=ScriptState] Promise<BluetoothRemoteGATTCharacteristic> getCharacteristic(BluetoothCharacteristicUUID characteristic); + // Promise<sequence<BluetoothRemoteGATTCharacteristic>> getCharacteristics(optional BluetoothCharacteristicUUID characteristic); + // Promise<BluetoothRemoteGATTService> getIncludedService(BluetoothServiceUUID service); + // Promise<sequence<BluetoothRemoteGATTService>> getIncludedServices(optional BluetoothServiceUUID service); +}; diff --git a/third_party/WebKit/Source/modules/modules.gypi b/third_party/WebKit/Source/modules/modules.gypi index 27eb83c..b4a7ee5 100644 --- a/third_party/WebKit/Source/modules/modules.gypi +++ b/third_party/WebKit/Source/modules/modules.gypi @@ -23,9 +23,9 @@ 'bluetooth/BluetoothAdvertisingData.idl', 'bluetooth/BluetoothDevice.idl', 'bluetooth/BluetoothCharacteristicProperties.idl', - 'bluetooth/BluetoothGATTCharacteristic.idl', - 'bluetooth/BluetoothGATTRemoteServer.idl', - 'bluetooth/BluetoothGATTService.idl', + 'bluetooth/BluetoothRemoteGATTCharacteristic.idl', + 'bluetooth/BluetoothRemoteGATTServer.idl', + 'bluetooth/BluetoothRemoteGATTService.idl', 'bluetooth/BluetoothUUID.idl', 'cachestorage/Cache.idl', 'cachestorage/CacheStorage.idl', @@ -808,12 +808,12 @@ 'bluetooth/BluetoothDevice.h', 'bluetooth/BluetoothError.cpp', 'bluetooth/BluetoothError.h', - 'bluetooth/BluetoothGATTCharacteristic.cpp', - 'bluetooth/BluetoothGATTCharacteristic.h', - 'bluetooth/BluetoothGATTRemoteServer.cpp', - 'bluetooth/BluetoothGATTRemoteServer.h', - 'bluetooth/BluetoothGATTService.cpp', - 'bluetooth/BluetoothGATTService.h', + 'bluetooth/BluetoothRemoteGATTCharacteristic.cpp', + 'bluetooth/BluetoothRemoteGATTCharacteristic.h', + 'bluetooth/BluetoothRemoteGATTServer.cpp', + 'bluetooth/BluetoothRemoteGATTServer.h', + 'bluetooth/BluetoothRemoteGATTService.cpp', + 'bluetooth/BluetoothRemoteGATTService.h', 'bluetooth/BluetoothSupplement.cpp', 'bluetooth/BluetoothSupplement.h', 'bluetooth/BluetoothUUID.cpp', diff --git a/third_party/WebKit/public/blink_headers.gypi b/third_party/WebKit/public/blink_headers.gypi index 42912c5..80c4ade 100644 --- a/third_party/WebKit/public/blink_headers.gypi +++ b/third_party/WebKit/public/blink_headers.gypi @@ -233,9 +233,9 @@ "platform/modules/bluetooth/WebBluetooth.h", "platform/modules/bluetooth/WebBluetoothDevice.h", "platform/modules/bluetooth/WebBluetoothError.h", - "platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h", - "platform/modules/bluetooth/WebBluetoothGATTCharacteristicInit.h", - "platform/modules/bluetooth/WebBluetoothGATTService.h", + "platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristic.h", + "platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristicInit.h", + "platform/modules/bluetooth/WebBluetoothRemoteGATTService.h", "platform/modules/bluetooth/WebRequestDeviceOptions.h", "platform/modules/device_orientation/WebDeviceMotionData.h", "platform/modules/device_orientation/WebDeviceMotionListener.h", diff --git a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h index b750d27..090e5c6 100644 --- a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h +++ b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h @@ -13,24 +13,24 @@ namespace blink { -class WebBluetoothGATTCharacteristic; +class WebBluetoothRemoteGATTCharacteristic; struct WebBluetoothDevice; -struct WebBluetoothGATTCharacteristicInit; -struct WebBluetoothGATTService; +struct WebBluetoothRemoteGATTCharacteristicInit; +struct WebBluetoothRemoteGATTService; struct WebRequestDeviceOptions; // Success and failure callbacks for requestDevice. using WebBluetoothRequestDeviceCallbacks = WebCallbacks<WebPassOwnPtr<WebBluetoothDevice>, const WebBluetoothError&>; // Success and failure callbacks for connectGATT. -using WebBluetoothGATTServerConnectCallbacks = WebCallbacks<void, const WebBluetoothError&>; +using WebBluetoothRemoteGATTServerConnectCallbacks = WebCallbacks<void, const WebBluetoothError&>; // Success and failure callbacks for getPrimaryService. -using WebBluetoothGetPrimaryServiceCallbacks = WebCallbacks<WebPassOwnPtr<WebBluetoothGATTService>, const WebBluetoothError&>; +using WebBluetoothGetPrimaryServiceCallbacks = WebCallbacks<WebPassOwnPtr<WebBluetoothRemoteGATTService>, const WebBluetoothError&>; // Success and failure callbacks for getCharacteristic. -using WebBluetoothGetCharacteristicCallbacks = WebCallbacks<WebPassOwnPtr<WebBluetoothGATTCharacteristicInit>, const WebBluetoothError&>; +using WebBluetoothGetCharacteristicCallbacks = WebCallbacks<WebPassOwnPtr<WebBluetoothRemoteGATTCharacteristicInit>, const WebBluetoothError&>; // Success and failure callbacks for readValue. using WebBluetoothReadValueCallbacks = WebCallbacks<const WebVector<uint8_t>&, const WebBluetoothError&>; @@ -53,23 +53,23 @@ public: // BluetoothDevice methods: - // BluetoothGATTRemoteServer methods: + // BluetoothRemoteGATTServer methods: // See https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattremoteserver virtual void connect(const WebString& deviceId, - WebBluetoothGATTServerConnectCallbacks*) { } + WebBluetoothRemoteGATTServerConnectCallbacks*) { } virtual void disconnect(const WebString& deviceId) = 0; virtual void getPrimaryService(const WebString& deviceId, const WebString& serviceUUID, WebBluetoothGetPrimaryServiceCallbacks*) { } // virtual void getPrimaryServices() { } - // BluetoothGATTService methods: + // BluetoothRemoteGATTService methods: // See https://webbluetoothchrome.github.io/web-bluetooth/#idl-def-bluetoothgattservice virtual void getCharacteristic(const WebString& serviceInstanceID, const WebString& characteristicUUID, WebBluetoothGetCharacteristicCallbacks*) { } - // BluetoothGATTCharacteristic methods: + // BluetoothRemoteGATTCharacteristic methods: // See https://webbluetoothchrome.github.io/web-bluetooth/#bluetoothgattcharacteristic virtual void readValue(const WebString& characteristicInstanceID, WebBluetoothReadValueCallbacks*) { } @@ -77,19 +77,19 @@ public: const WebVector<uint8_t>& value, WebBluetoothWriteValueCallbacks*) {} virtual void startNotifications(const WebString& characteristicInstanceID, - WebBluetoothGATTCharacteristic*, + WebBluetoothRemoteGATTCharacteristic*, WebBluetoothNotificationsCallbacks*) {} virtual void stopNotifications(const WebString& characteristicInstanceID, - WebBluetoothGATTCharacteristic*, + WebBluetoothRemoteGATTCharacteristic*, WebBluetoothNotificationsCallbacks*) {} // Called when addEventListener is called on a characteristic. virtual void registerCharacteristicObject( const WebString& characteristicInstanceID, - WebBluetoothGATTCharacteristic*) = 0; + WebBluetoothRemoteGATTCharacteristic*) = 0; virtual void characteristicObjectRemoved( const WebString& characteristicInstanceID, - WebBluetoothGATTCharacteristic*) {} + WebBluetoothRemoteGATTCharacteristic*) {} }; } // namespace blink diff --git a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristic.h index 2f4154c..d7a02fa 100644 --- a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTCharacteristic.h +++ b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristic.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WebBluetoothGATTCharacteristic_h -#define WebBluetoothGATTCharacteristic_h +#ifndef WebBluetoothRemoteGATTCharacteristic_h +#define WebBluetoothRemoteGATTCharacteristic_h #include "public/platform/WebVector.h" @@ -11,7 +11,7 @@ namespace blink { // An object through which the embedder can trigger events on a Document-bound // Web Bluetooth GATT Characteristic object. -class WebBluetoothGATTCharacteristic { +class WebBluetoothRemoteGATTCharacteristic { public: // Used to notify blink that the characteristic's value changed. virtual void dispatchCharacteristicValueChanged(const WebVector<uint8_t>&) = 0; @@ -19,4 +19,4 @@ public: } // namespace blink -#endif // WebBluetoothGATTCharacteristicDelegate_h +#endif // WebBluetoothRemoteGATTCharacteristicDelegate_h diff --git a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTCharacteristicInit.h b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristicInit.h index cc31db0..a07f917 100644 --- a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTCharacteristicInit.h +++ b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristicInit.h @@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WebBluetoothGATTCharacteristicInit_h -#define WebBluetoothGATTCharacteristicInit_h +#ifndef WebBluetoothRemoteGATTCharacteristicInit_h +#define WebBluetoothRemoteGATTCharacteristicInit_h #include "public/platform/WebString.h" #include "public/platform/WebVector.h" namespace blink { -// Contains members corresponding to BluetoothGATTCharacteristic attributes as +// Contains members corresponding to BluetoothRemoteGATTCharacteristic attributes as // specified in the IDL. -struct WebBluetoothGATTCharacteristicInit { - WebBluetoothGATTCharacteristicInit(const WebString& characteristicInstanceID, +struct WebBluetoothRemoteGATTCharacteristicInit { + WebBluetoothRemoteGATTCharacteristicInit(const WebString& characteristicInstanceID, const WebString& serviceInstanceID, const WebString& uuid, uint32_t characteristicProperties) @@ -33,4 +33,4 @@ struct WebBluetoothGATTCharacteristicInit { } // namespace blink -#endif // WebBluetoothGATTCharacteristicInit_h +#endif // WebBluetoothRemoteGATTCharacteristicInit_h diff --git a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTService.h b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTService.h index 4171faa..723babd 100644 --- a/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothGATTService.h +++ b/third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothRemoteGATTService.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WebBluetoothGATTService_h -#define WebBluetoothGATTService_h +#ifndef WebBluetoothRemoteGATTService_h +#define WebBluetoothRemoteGATTService_h #include "public/platform/WebString.h" namespace blink { -struct WebBluetoothGATTService { - WebBluetoothGATTService(const WebString& serviceInstanceID, +struct WebBluetoothRemoteGATTService { + WebBluetoothRemoteGATTService(const WebString& serviceInstanceID, const WebString& uuid, bool isPrimary, const WebString& deviceInstanceID) @@ -21,7 +21,7 @@ struct WebBluetoothGATTService { { } - // Members corresponding to BluetoothGATTService attributes as + // Members corresponding to BluetoothRemoteGATTService attributes as // specified in the IDL. const WebString serviceInstanceID; const WebString uuid; @@ -31,4 +31,4 @@ struct WebBluetoothGATTService { } // namespace blink -#endif // WebBluetoothGATTService_h +#endif // WebBluetoothRemoteGATTService_h |