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

Side by Side Diff: Source/modules/webusb/USBConnectionEvent.cpp

Issue 1307483002: Add USBConnectionEvent to webusb module. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@usb_events
Patch Set: Update LayoutTests. Created 5 years, 4 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
(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
OLDNEW
« no previous file with comments | « Source/modules/webusb/USBConnectionEvent.h ('k') | Source/modules/webusb/USBConnectionEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698