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

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.h

Issue 1334763002: bluetooth: Subscribe to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Wait for stop request to finish Created 5 years, 2 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 BluetoothSupplement_h 5 #ifndef BluetoothSupplement_h
6 #define BluetoothSupplement_h 6 #define BluetoothSupplement_h
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 class WebBluetooth; 12 class WebBluetooth;
13 13
14 // This class is attached to a LocalFrame in WebLocalFrameImpl::setCoreFrame, to 14 // This class is attached to a LocalFrame in WebLocalFrameImpl::setCoreFrame, to
15 // pass WebFrameClient::bluetooth() (accessible by web/ only) to the Bluetooth 15 // pass WebFrameClient::bluetooth() (accessible by web/ only) to the Bluetooth
16 // code in modules/. 16 // code in modules/.
17 class BLINK_EXPORT BluetoothSupplement : public NoBaseWillBeGarbageCollected<Blu etoothSupplement>, public WillBeHeapSupplement<LocalFrame> { 17 class BLINK_EXPORT BluetoothSupplement : public NoBaseWillBeGarbageCollected<Blu etoothSupplement>, public WillBeHeapSupplement<LocalFrame> {
18 WTF_MAKE_NONCOPYABLE(BluetoothSupplement); 18 WTF_MAKE_NONCOPYABLE(BluetoothSupplement);
19 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(BluetoothSupplement); 19 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(BluetoothSupplement);
20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothSupplement); 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothSupplement);
21 21
22 public: 22 public:
23 static const char* supplementName(); 23 static const char* supplementName();
24 24
25 static void provideTo(LocalFrame&, WebBluetooth*); 25 static void provideTo(LocalFrame&, WebBluetooth*);
26 26
27 // Returns the WebBluetooth attached to the ScriptState's frame if that exis ts; 27 // Returns the WebBluetooth attached to the ScriptState's frame if that exis ts;
28 // otherwise the Platform's WebBluetooth. 28 // otherwise the Platform's WebBluetooth.
29 static WebBluetooth* from(ScriptState*); 29 static WebBluetooth* from(ScriptState*);
30 30 static WebBluetooth* from(ExecutionContext*);
31 static WebBluetooth* from(LocalDOMWindow*);
haraken 2015/10/07 01:22:33 This looks wrong. BluetoothSupplement is a supplem
ortuno 2015/10/07 17:03:55 In all three cases we end up getting the supplemen
31 DECLARE_VIRTUAL_TRACE(); 32 DECLARE_VIRTUAL_TRACE();
32 33
33 private: 34 private:
34 explicit BluetoothSupplement(WebBluetooth*); 35 explicit BluetoothSupplement(WebBluetooth*);
35 36
36 WebBluetooth* m_bluetooth; 37 WebBluetooth* m_bluetooth;
37 }; 38 };
38 39
39 } // namespace blink 40 } // namespace blink
40 41
41 #endif // BluetoothRoutingId_h 42 #endif // BluetoothRoutingId_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698