OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BluetoothRemoteGATTServer_h | 5 #ifndef BluetoothRemoteGATTServer_h |
6 #define BluetoothRemoteGATTServer_h | 6 #define BluetoothRemoteGATTServer_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "bindings/modules/v8/StringOrUnsignedLong.h" | 9 #include "bindings/modules/v8/StringOrUnsignedLong.h" |
10 #include "core/dom/ContextLifecycleObserver.h" | 10 #include "core/dom/ContextLifecycleObserver.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 // | 52 // |
53 // Adds |resolver| to the set of Active Algorithms. CHECK-fails if | 53 // Adds |resolver| to the set of Active Algorithms. CHECK-fails if |
54 // |resolver| was already added. | 54 // |resolver| was already added. |
55 void AddToActiveAlgorithms(ScriptPromiseResolver*); | 55 void AddToActiveAlgorithms(ScriptPromiseResolver*); |
56 // Removes |resolver| from the set of Active Algorithms if it was in the set | 56 // Removes |resolver| from the set of Active Algorithms if it was in the set |
57 // and returns true, false otherwise. | 57 // and returns true, false otherwise. |
58 bool RemoveFromActiveAlgorithms(ScriptPromiseResolver*); | 58 bool RemoveFromActiveAlgorithms(ScriptPromiseResolver*); |
59 // Removes all ScriptPromiseResolvers from the set of Active Algorithms. | 59 // Removes all ScriptPromiseResolvers from the set of Active Algorithms. |
60 void ClearActiveAlgorithms() { m_activeAlgorithms.clear(); } | 60 void ClearActiveAlgorithms() { m_activeAlgorithms.clear(); } |
61 | 61 |
62 // If gatt is connected then sets gatt.connected to false and disconnects. | 62 // Performs necessary cleanup when a device disconnects. If |dispatchEvent| |
63 // This function only performs the necessary steps to ensure a device | 63 // is true, dispatch a gattserverdisconnected event. |
64 // disconnects therefore it should only be used when the object is being | 64 void CleanupDisconnectedDevice(bool dispatchEvent); |
scheib
2017/03/22 01:11:08
Let's cite the specification algorithm this method
juncai
2017/03/27 20:44:46
Done.
| |
65 // garbage collected or the context is being destroyed. | |
66 void DisconnectIfConnected(); | |
67 | 65 |
68 // Performs necessary cleanup when a device disconnects and fires | 66 void HandleClientConnectionError(); |
69 // gattserverdisconnected event. | |
70 void CleanupDisconnectedDeviceAndFireEvent(); | |
71 | |
72 void DispatchDisconnected(); | |
73 | 67 |
74 // USING_PRE_FINALIZER interface. | 68 // USING_PRE_FINALIZER interface. |
75 // Called before the object gets garbage collected. | 69 // Called before the object gets garbage collected. |
76 void Dispose(); | 70 void Dispose(); |
77 | 71 |
78 // Interface required by Garbage Collectoin: | 72 // Interface required by Garbage Collectoin: |
79 DECLARE_VIRTUAL_TRACE(); | 73 DECLARE_VIRTUAL_TRACE(); |
80 | 74 |
81 // IDL exposed interface: | 75 // IDL exposed interface: |
82 BluetoothDevice* device() { return m_device; } | 76 BluetoothDevice* device() { return m_device; } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 mojo::AssociatedBinding<mojom::blink::WebBluetoothServerClient> | 108 mojo::AssociatedBinding<mojom::blink::WebBluetoothServerClient> |
115 m_clientBinding; | 109 m_clientBinding; |
116 | 110 |
117 Member<BluetoothDevice> m_device; | 111 Member<BluetoothDevice> m_device; |
118 bool m_connected; | 112 bool m_connected; |
119 }; | 113 }; |
120 | 114 |
121 } // namespace blink | 115 } // namespace blink |
122 | 116 |
123 #endif // BluetoothDevice_h | 117 #endif // BluetoothDevice_h |
OLD | NEW |