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

Side by Side Diff: Source/modules/webmidi/MIDIPortMap.h

Issue 555683003: MIDI{Input, Output}Map[Symbol.iterator]() should return entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
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 MIDIPortMap_h 5 #ifndef MIDIPortMap_h
6 #define MIDIPortMap_h 6 #define MIDIPortMap_h
7 7
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/ScriptValue.h" 10 #include "bindings/core/v8/ScriptValue.h"
(...skipping 11 matching lines...) Expand all
22 public: 22 public:
23 explicit MIDIPortMap(const HeapHashMap<String, Member<T> >& entries) : m_ent ries(entries) { } 23 explicit MIDIPortMap(const HeapHashMap<String, Member<T> >& entries) : m_ent ries(entries) { }
24 24
25 // IDL attributes / methods 25 // IDL attributes / methods
26 size_t size() const { return m_entries.size(); } 26 size_t size() const { return m_entries.size(); }
27 Iterator* keys(); 27 Iterator* keys();
28 Iterator* entries(); 28 Iterator* entries();
29 Iterator* values(); 29 Iterator* values();
30 T* get(const String& key) const; 30 T* get(const String& key) const;
31 bool has(const String& key) const { return m_entries.contains(key); } 31 bool has(const String& key) const { return m_entries.contains(key); }
32 Iterator* iterator(ScriptState*, ExceptionState&) { return values(); } 32 Iterator* iterator(ScriptState*, ExceptionState&) { return entries(); }
33 33
34 void trace(Visitor* visitor) 34 void trace(Visitor* visitor)
35 { 35 {
36 visitor->trace(m_entries); 36 visitor->trace(m_entries);
37 } 37 }
38 38
39 private: 39 private:
40 typedef HeapHashMap<String, Member<T> > MapType; 40 typedef HeapHashMap<String, Member<T> > MapType;
41 typedef typename HeapHashMap<String, Member<T> >::const_iterator IteratorTyp e; 41 typedef typename HeapHashMap<String, Member<T> >::const_iterator IteratorTyp e;
42 struct KeySelector { 42 struct KeySelector {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 template <typename T> 119 template <typename T>
120 T* MIDIPortMap<T>::get(const String& key) const 120 T* MIDIPortMap<T>::get(const String& key) const
121 { 121 {
122 return has(key) ? m_entries.get(key) : 0; 122 return has(key) ? m_entries.get(key) : 0;
123 } 123 }
124 124
125 } // namespace blink 125 } // namespace blink
126 126
127 #endif 127 #endif
OLDNEW
« LayoutTests/webmidi/requestmidiaccess.html ('K') | « LayoutTests/webmidi/send_messages.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698