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

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

Issue 562573002: Fix crash in webmidi. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13 matching lines...) Expand all
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 entries(); } 32 Iterator* iterator(ScriptState*, ExceptionState&) { return entries(); }
33 33
34 void trace(Visitor* visitor) 34 virtual 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 {
43 static const String& select(ScriptState*, IteratorType i) { return i->ke y; } 43 static const String& select(ScriptState*, IteratorType i) { return i->ke y; }
44 }; 44 };
(...skipping 73 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698