Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef MIDIAccessInitializer_h | 5 #ifndef MIDIAccessInitializer_h |
| 6 #define MIDIAccessInitializer_h | 6 #define MIDIAccessInitializer_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "modules/webmidi/MIDIAccessor.h" | 10 #include "modules/webmidi/MIDIAccessor.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 : id(id) | 32 : id(id) |
| 33 , manufacturer(manufacturer) | 33 , manufacturer(manufacturer) |
| 34 , name(name) | 34 , name(name) |
| 35 , type(type) | 35 , type(type) |
| 36 , version(version) | 36 , version(version) |
| 37 , isActive(isActive) { } | 37 , isActive(isActive) { } |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 static ScriptPromise start(ScriptState* scriptState, const MIDIOptions& opti ons) | 40 static ScriptPromise start(ScriptState* scriptState, const MIDIOptions& opti ons) |
| 41 { | 41 { |
| 42 RefPtr<MIDIAccessInitializer> p = adoptRef(new MIDIAccessInitializer(scr iptState, options)); | 42 RefPtrWillBeRawPtr<MIDIAccessInitializer> resolver = adoptRefWillBeNoop( new MIDIAccessInitializer(scriptState, options)); |
|
sof
2014/12/16 21:34:59
Not directly overlapping with this change, but how
sof
2014/12/16 22:07:05
This block of code repeats in a number of create()
tasak
2014/12/17 08:40:08
I see. I will talk with yhirano@.
| |
| 43 p->keepAliveWhilePending(); | 43 resolver->keepAliveWhilePending(); |
| 44 p->suspendIfNeeded(); | 44 resolver->suspendIfNeeded(); |
| 45 return p->start(); | 45 return resolver->start(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 virtual ~MIDIAccessInitializer(); | 48 virtual ~MIDIAccessInitializer(); |
| 49 | 49 |
| 50 // MIDIAccessorClient | 50 // MIDIAccessorClient |
| 51 virtual void didAddInputPort(const String& id, const String& manufacturer, c onst String& name, const String& version, bool isActive) override; | 51 virtual void didAddInputPort(const String& id, const String& manufacturer, c onst String& name, const String& version, bool isActive) override; |
| 52 virtual void didAddOutputPort(const String& id, const String& manufacturer, const String& name, const String& version, bool isActive) override; | 52 virtual void didAddOutputPort(const String& id, const String& manufacturer, const String& name, const String& version, bool isActive) override; |
| 53 virtual void didSetInputPortState(unsigned portIndex, bool isActive) overrid e; | 53 virtual void didSetInputPortState(unsigned portIndex, bool isActive) overrid e; |
| 54 virtual void didSetOutputPortState(unsigned portIndex, bool isActive) overri de; | 54 virtual void didSetOutputPortState(unsigned portIndex, bool isActive) overri de; |
| 55 virtual void didStartSession(bool success, const String& error, const String & message) override; | 55 virtual void didStartSession(bool success, const String& error, const String & message) override; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 67 | 67 |
| 68 OwnPtr<MIDIAccessor> m_accessor; | 68 OwnPtr<MIDIAccessor> m_accessor; |
| 69 bool m_requestSysex; | 69 bool m_requestSysex; |
| 70 Vector<PortDescriptor> m_portDescriptors; | 70 Vector<PortDescriptor> m_portDescriptors; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace blink | 73 } // namespace blink |
| 74 | 74 |
| 75 | 75 |
| 76 #endif // MIDIAccessInitializer_h | 76 #endif // MIDIAccessInitializer_h |
| OLD | NEW |