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 #ifndef BluetoothDevice_h | 5 #ifndef BluetoothDevice_h |
| 6 #define BluetoothDevice_h | 6 #define BluetoothDevice_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "platform/heap/Heap.h" | 9 #include "platform/heap/Heap.h" |
| 10 #include "public/platform/modules/bluetooth/WebBluetoothDevice.h" | 10 #include "public/platform/modules/bluetooth/WebBluetoothDevice.h" |
| 11 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class ScriptPromise; | |
| 16 class ScriptState; | |
| 17 | |
|
scheib
2015/04/21 17:57:29
remove blank line, sort block.
ortuno
2015/04/21 19:54:07
Done.
| |
| 15 class ScriptPromiseResolver; | 18 class ScriptPromiseResolver; |
| 16 | 19 |
| 17 // BluetoothDevice represents a physical bluetooth device in the DOM. See IDL. | 20 // BluetoothDevice represents a physical bluetooth device in the DOM. See IDL. |
| 18 // | 21 // |
| 19 // Callbacks providing WebBluetoothDevice objects are handled by | 22 // Callbacks providing WebBluetoothDevice objects are handled by |
| 20 // CallbackPromiseAdapter templatized with this class. See this class's | 23 // CallbackPromiseAdapter templatized with this class. See this class's |
| 21 // "Interface required by CallbackPromiseAdapter" section and the | 24 // "Interface required by CallbackPromiseAdapter" section and the |
| 22 // CallbackPromiseAdapter class comments. | 25 // CallbackPromiseAdapter class comments. |
| 23 class BluetoothDevice final | 26 class BluetoothDevice final |
| 24 : public GarbageCollectedFinalized<BluetoothDevice> | 27 : public GarbageCollectedFinalized<BluetoothDevice> |
| 25 , public ScriptWrappable { | 28 , public ScriptWrappable { |
| 26 DEFINE_WRAPPERTYPEINFO(); | 29 DEFINE_WRAPPERTYPEINFO(); |
| 27 public: | 30 public: |
| 28 BluetoothDevice(const WebBluetoothDevice&); | 31 BluetoothDevice(const WebBluetoothDevice&); |
| 29 | 32 |
| 30 static BluetoothDevice* create(const WebBluetoothDevice&); | 33 static BluetoothDevice* create(const WebBluetoothDevice&); |
| 31 | 34 |
| 35 ScriptPromise connectGATT(ScriptState*); | |
| 36 | |
| 32 // Interface required by CallbackPromiseAdapter: | 37 // Interface required by CallbackPromiseAdapter: |
| 33 typedef WebBluetoothDevice WebType; | 38 typedef WebBluetoothDevice WebType; |
| 34 static BluetoothDevice* take(ScriptPromiseResolver*, WebBluetoothDevice*); | 39 static BluetoothDevice* take(ScriptPromiseResolver*, WebBluetoothDevice*); |
| 35 static void dispose(WebBluetoothDevice*); | 40 static void dispose(WebBluetoothDevice*); |
| 36 | 41 |
| 37 // Interface required by Garbage Collection: | 42 // Interface required by Garbage Collection: |
| 38 DEFINE_INLINE_TRACE() { } | 43 DEFINE_INLINE_TRACE() { } |
| 39 | 44 |
| 40 // IDL exposed interface: | 45 // IDL exposed interface: |
| 41 String instanceID() { return m_webDevice.instanceID; } | 46 String instanceID() { return m_webDevice.instanceID; } |
| 42 String name() { return m_webDevice.name; } | 47 String name() { return m_webDevice.name; } |
| 43 unsigned deviceClass(bool& isNull); | 48 unsigned deviceClass(bool& isNull); |
| 44 String vendorIDSource(); | 49 String vendorIDSource(); |
| 45 unsigned vendorID(bool& isNull); | 50 unsigned vendorID(bool& isNull); |
| 46 unsigned productID(bool& isNull); | 51 unsigned productID(bool& isNull); |
| 47 unsigned productVersion(bool& isNull); | 52 unsigned productVersion(bool& isNull); |
| 48 bool paired(bool& isNull); | 53 bool paired(bool& isNull); |
| 49 bool connected(bool& isNull); | 54 bool connected(bool& isNull); |
| 50 Vector<String> uuids(bool& isNull); | 55 Vector<String> uuids(bool& isNull); |
| 51 | 56 |
| 52 private: | 57 private: |
| 53 WebBluetoothDevice m_webDevice; | 58 WebBluetoothDevice m_webDevice; |
| 54 }; | 59 }; |
| 55 | 60 |
| 56 } // namespace blink | 61 } // namespace blink |
| 57 | 62 |
| 58 #endif // BluetoothDevice_h | 63 #endif // BluetoothDevice_h |
| OLD | NEW |