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

Side by Side Diff: Source/modules/bluetooth/NavigatorBluetooth.cpp

Issue 639533002: bluetooth: Extend navigator.bluetooth IDL to include Bluetooth interface. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: GC Compile issue Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/bluetooth/NavigatorBluetooth.h"
7
8 #include "core/frame/Navigator.h"
9 #include "modules/bluetooth/Bluetooth.h"
10
11 namespace blink {
12
13 NavigatorBluetooth& NavigatorBluetooth::from(Navigator& navigator)
14 {
15 NavigatorBluetooth* supplement = static_cast<NavigatorBluetooth*>(WillBeHeap Supplement<Navigator>::from(navigator, supplementName()));
16 if (!supplement) {
17 supplement = new NavigatorBluetooth();
18 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
19 }
20 return *supplement;
21 }
22
23 Bluetooth* NavigatorBluetooth::bluetooth(Navigator& navigator)
24 {
25 return NavigatorBluetooth::from(navigator).bluetooth();
26 }
27
28 Bluetooth* NavigatorBluetooth::bluetooth() const
29 {
30 if (!m_bluetooth)
31 m_bluetooth = Bluetooth::create();
scheib 2014/10/08 00:06:10 Compile error: ../../third_party/WebKit/Source/mod
tkent 2014/10/08 00:23:41 NavigatorBluetooth::bluetooth() is a const functio
scheib 2014/10/08 05:49:31 Done.
32 return m_bluetooth.get();
33 }
34
35 void NavigatorBluetooth::trace(Visitor* visitor)
36 {
37 visitor->trace(m_bluetooth);
38 WillBeHeapSupplement<Navigator>::trace(visitor);
39 }
40
41 NavigatorBluetooth::NavigatorBluetooth()
42 {
43 }
44
45 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NavigatorBluetooth);
46
47 const char* NavigatorBluetooth::supplementName()
48 {
49 return "NavigatorBluetooth";
50 }
51
52 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/bluetooth/NavigatorBluetooth.h ('k') | Source/modules/bluetooth/NavigatorBluetooth.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698