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

Side by Side Diff: Source/modules/bluetooth/BluetoothGATTRemoteServer.h

Issue 1148283009: bluetooth: Remove deep copying of structs by using OwnPtr. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-get-primary-service-implementation
Patch Set: Created 5 years, 6 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 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 BluetoothGATTRemoteServer_h 5 #ifndef BluetoothGATTRemoteServer_h
6 #define BluetoothGATTRemoteServer_h 6 #define BluetoothGATTRemoteServer_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/WebBluetoothGATTRemoteServer.h" 10 #include "public/platform/modules/bluetooth/WebBluetoothGATTRemoteServer.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; 15 class ScriptPromise;
16 class ScriptPromiseResolver; 16 class ScriptPromiseResolver;
17 class ScriptState; 17 class ScriptState;
18 18
19 // BluetoothGATTRemoteServer provides a way to interact with a connected bluetoo th peripheral. 19 // BluetoothGATTRemoteServer provides a way to interact with a connected bluetoo th peripheral.
20 // 20 //
21 // Callbacks providing WebBluetoothGATTRemoteServer objects are handled by 21 // Callbacks providing WebBluetoothGATTRemoteServer objects are handled by
22 // CallbackPromiseAdapter templatized with this class. See this class's 22 // CallbackPromiseAdapter templatized with this class. See this class's
23 // "Interface required by CallbackPromiseAdapter" section and the 23 // "Interface required by CallbackPromiseAdapter" section and the
24 // CallbackPromiseAdapter class comments. 24 // CallbackPromiseAdapter class comments.
25 class BluetoothGATTRemoteServer final 25 class BluetoothGATTRemoteServer final
26 : public GarbageCollectedFinalized<BluetoothGATTRemoteServer> 26 : public GarbageCollectedFinalized<BluetoothGATTRemoteServer>
27 , public ScriptWrappable { 27 , public ScriptWrappable {
28 DEFINE_WRAPPERTYPEINFO(); 28 DEFINE_WRAPPERTYPEINFO();
29 public: 29 public:
30 BluetoothGATTRemoteServer(const WebBluetoothGATTRemoteServer&); 30 BluetoothGATTRemoteServer(PassOwnPtr<WebBluetoothGATTRemoteServer>);
haraken 2015/06/04 00:40:16 Add explicit.
31 31
32 // Interface required by CallbackPromiseAdapter: 32 // Interface required by CallbackPromiseAdapter:
33 typedef WebBluetoothGATTRemoteServer WebType; 33 typedef WebBluetoothGATTRemoteServer WebType;
34 static BluetoothGATTRemoteServer* take(ScriptPromiseResolver*, WebBluetoothG ATTRemoteServer*); 34 static BluetoothGATTRemoteServer* take(ScriptPromiseResolver*, WebBluetoothG ATTRemoteServer*);
35 static void dispose(WebBluetoothGATTRemoteServer*); 35 static void dispose(WebBluetoothGATTRemoteServer*);
36 36
37 // Interface required by Garbage Collectoin: 37 // Interface required by Garbage Collectoin:
38 DEFINE_INLINE_TRACE() { } 38 DEFINE_INLINE_TRACE() { }
39 39
40 // IDL exposed interface: 40 // IDL exposed interface:
41 bool connected() { return m_webGATT.connected; } 41 bool connected() { return m_webGATT->connected; }
42 ScriptPromise getPrimaryService(ScriptState*, String serviceUUID); 42 ScriptPromise getPrimaryService(ScriptState*, String serviceUUID);
43 43
44 private: 44 private:
45 WebBluetoothGATTRemoteServer m_webGATT; 45 OwnPtr<WebBluetoothGATTRemoteServer> m_webGATT;
46 }; 46 };
47 47
48 } // namespace blink 48 } // namespace blink
49 49
50 #endif // BluetoothDevice_h 50 #endif // BluetoothDevice_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698