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