OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "modules/webusb/USBConnectionEvent.h" |
| 7 |
| 8 #include "modules/webusb/USBConnectionEventInit.h" |
| 9 #include "modules/webusb/USBDevice.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 USBConnectionEvent* USBConnectionEvent::create(const AtomicString& type, const U
SBConnectionEventInit& initializer) |
| 14 { |
| 15 return new USBConnectionEvent(type, initializer); |
| 16 } |
| 17 |
| 18 USBConnectionEvent* USBConnectionEvent::create(const AtomicString& type, USBDevi
ce* device) |
| 19 { |
| 20 return new USBConnectionEvent(type, device); |
| 21 } |
| 22 |
| 23 USBConnectionEvent::USBConnectionEvent(const AtomicString& type, const USBConnec
tionEventInit& initializer) |
| 24 : Event(type, initializer) |
| 25 , m_device(nullptr) |
| 26 { |
| 27 if (initializer.hasDevice()) |
| 28 m_device = initializer.device(); |
| 29 } |
| 30 |
| 31 USBConnectionEvent::USBConnectionEvent(const AtomicString& type, USBDevice* devi
ce) |
| 32 : Event(type, false, false) |
| 33 , m_device(device) |
| 34 { |
| 35 } |
| 36 |
| 37 DEFINE_TRACE(USBConnectionEvent) |
| 38 { |
| 39 visitor->trace(m_device); |
| 40 Event::trace(visitor); |
| 41 } |
| 42 |
| 43 } // namespace blink |
OLD | NEW |