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

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

Issue 2150443002: Supplement should have a Member to the corresponding Supplementable object (Part 1) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 3 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 #include "modules/bluetooth/BluetoothSupplement.h" 5 #include "modules/bluetooth/BluetoothSupplement.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 const char* BluetoothSupplement::supplementName() 11 const char* BluetoothSupplement::supplementName()
12 { 12 {
13 return "BluetoothSupplement"; 13 return "BluetoothSupplement";
14 } 14 }
15 15
16 BluetoothSupplement::BluetoothSupplement(WebBluetooth* bluetooth) 16 BluetoothSupplement::BluetoothSupplement(WebBluetooth* bluetooth, LocalFrame& fr ame)
17 : m_bluetooth(bluetooth) 17 : Supplement<LocalFrame>(frame)
18 , m_bluetooth(bluetooth)
18 { 19 {
19 } 20 }
20 21
21 void BluetoothSupplement::provideTo(LocalFrame& frame, WebBluetooth* bluetooth) 22 void BluetoothSupplement::provideTo(LocalFrame& frame, WebBluetooth* bluetooth)
22 { 23 {
23 BluetoothSupplement* bluetoothSupplement = new BluetoothSupplement(bluetooth ); 24 BluetoothSupplement* bluetoothSupplement = new BluetoothSupplement(bluetooth , frame);
24 Supplement<LocalFrame>::provideTo(frame, supplementName(), bluetoothSuppleme nt); 25 Supplement<LocalFrame>::provideTo(frame, supplementName(), bluetoothSuppleme nt);
25 }; 26 };
26 27
27 WebBluetooth* BluetoothSupplement::from(LocalFrame* frame) 28 WebBluetooth* BluetoothSupplement::from(LocalFrame* frame)
28 { 29 {
29 BluetoothSupplement* supplement = static_cast<BluetoothSupplement*>(Suppleme nt<LocalFrame>::from(frame, supplementName())); 30 BluetoothSupplement* supplement = static_cast<BluetoothSupplement*>(Suppleme nt<LocalFrame>::from(frame, supplementName()));
30 31
31 ASSERT(supplement); 32 ASSERT(supplement);
32 ASSERT(supplement->m_bluetooth); 33 ASSERT(supplement->m_bluetooth);
33 34
(...skipping 12 matching lines...) Expand all
46 } 47 }
47 return BluetoothSupplement::from(static_cast<Document*>(executionContext)->f rame()); 48 return BluetoothSupplement::from(static_cast<Document*>(executionContext)->f rame());
48 } 49 }
49 50
50 DEFINE_TRACE(BluetoothSupplement) 51 DEFINE_TRACE(BluetoothSupplement)
51 { 52 {
52 Supplement<LocalFrame>::trace(visitor); 53 Supplement<LocalFrame>::trace(visitor);
53 } 54 }
54 55
55 } // namespace blink 56 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698