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

Side by Side Diff: third_party/WebKit/Source/modules/webmidi/MIDIInput.cpp

Issue 2583093002: Reduce SuspendableObjects (Closed)
Patch Set: Created 4 years 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 38
39 using midi::mojom::PortState; 39 using midi::mojom::PortState;
40 40
41 MIDIInput* MIDIInput::create(MIDIAccess* access, 41 MIDIInput* MIDIInput::create(MIDIAccess* access,
42 const String& id, 42 const String& id,
43 const String& manufacturer, 43 const String& manufacturer,
44 const String& name, 44 const String& name,
45 const String& version, 45 const String& version,
46 PortState state) { 46 PortState state) {
47 DCHECK(access); 47 DCHECK(access);
48 MIDIInput* input = 48 return new MIDIInput(access, id, manufacturer, name, version, state);
49 new MIDIInput(access, id, manufacturer, name, version, state);
50 input->suspendIfNeeded();
51 return input;
52 } 49 }
53 50
54 MIDIInput::MIDIInput(MIDIAccess* access, 51 MIDIInput::MIDIInput(MIDIAccess* access,
55 const String& id, 52 const String& id,
56 const String& manufacturer, 53 const String& manufacturer,
57 const String& name, 54 const String& name,
58 const String& version, 55 const String& version,
59 PortState state) 56 PortState state)
60 : MIDIPort(access, id, manufacturer, name, TypeInput, version, state) {} 57 : MIDIPort(access, id, manufacturer, name, TypeInput, version, state) {}
61 58
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 return; 98 return;
102 DOMUint8Array* array = DOMUint8Array::create(data, length); 99 DOMUint8Array* array = DOMUint8Array::create(data, length);
103 dispatchEvent(MIDIMessageEvent::create(timeStamp, array)); 100 dispatchEvent(MIDIMessageEvent::create(timeStamp, array));
104 } 101 }
105 102
106 DEFINE_TRACE(MIDIInput) { 103 DEFINE_TRACE(MIDIInput) {
107 MIDIPort::trace(visitor); 104 MIDIPort::trace(visitor);
108 } 105 }
109 106
110 } // namespace blink 107 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp ('k') | third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698