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

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

Issue 2357833002: Add a missing null check for MIDIAccess::getExecutionContext() (Closed)
Patch Set: Created 4 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
« 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 /* 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 void MIDIAccess::setOnstatechange(EventListener* listener) 83 void MIDIAccess::setOnstatechange(EventListener* listener)
84 { 84 {
85 m_hasPendingActivity = listener; 85 m_hasPendingActivity = listener;
86 setAttributeEventListener(EventTypeNames::statechange, listener); 86 setAttributeEventListener(EventTypeNames::statechange, listener);
87 } 87 }
88 88
89 bool MIDIAccess::hasPendingActivity() const 89 bool MIDIAccess::hasPendingActivity() const
90 { 90 {
91 return m_hasPendingActivity && !getExecutionContext()->activeDOMObjectsAreSt opped(); 91 return m_hasPendingActivity && getExecutionContext() && !getExecutionContext ()->activeDOMObjectsAreStopped();
92 } 92 }
93 93
94 MIDIInputMap* MIDIAccess::inputs() const 94 MIDIInputMap* MIDIAccess::inputs() const
95 { 95 {
96 HeapVector<Member<MIDIInput>> inputs; 96 HeapVector<Member<MIDIInput>> inputs;
97 HashSet<String> ids; 97 HashSet<String> ids;
98 for (size_t i = 0; i < m_inputs.size(); ++i) { 98 for (size_t i = 0; i < m_inputs.size(); ++i) {
99 MIDIInput* input = m_inputs[i]; 99 MIDIInput* input = m_inputs[i];
100 if (input->getState() != PortState::MIDIPortStateDisconnected) { 100 if (input->getState() != PortState::MIDIPortStateDisconnected) {
101 inputs.append(input); 101 inputs.append(input);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 DEFINE_TRACE(MIDIAccess) 209 DEFINE_TRACE(MIDIAccess)
210 { 210 {
211 visitor->trace(m_inputs); 211 visitor->trace(m_inputs);
212 visitor->trace(m_outputs); 212 visitor->trace(m_outputs);
213 EventTargetWithInlineData::trace(visitor); 213 EventTargetWithInlineData::trace(visitor);
214 ActiveDOMObject::trace(visitor); 214 ActiveDOMObject::trace(visitor);
215 } 215 }
216 216
217 } // namespace blink 217 } // namespace blink
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