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