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

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

Issue 2366253002: Remove ActiveDOMObject::stop() (Closed)
Patch Set: temp Created 4 years, 2 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 /* 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 ExecutionContext* MIDIPort::getExecutionContext() const { 146 ExecutionContext* MIDIPort::getExecutionContext() const {
147 return m_access->getExecutionContext(); 147 return m_access->getExecutionContext();
148 } 148 }
149 149
150 bool MIDIPort::hasPendingActivity() const { 150 bool MIDIPort::hasPendingActivity() const {
151 // MIDIPort should survive if ConnectionState is "open" or can be "open" via 151 // MIDIPort should survive if ConnectionState is "open" or can be "open" via
152 // a MIDIConnectionEvent even if there are no references from JavaScript. 152 // a MIDIConnectionEvent even if there are no references from JavaScript.
153 return m_connection != ConnectionStateClosed; 153 return m_connection != ConnectionStateClosed;
154 } 154 }
155 155
156 void MIDIPort::stop() { 156 void MIDIPort::contextDestroyed() {
157 // Should be "closed" to assume there are no pending activities. 157 // Should be "closed" to assume there are no pending activities.
158 m_connection = ConnectionStateClosed; 158 m_connection = ConnectionStateClosed;
159 } 159 }
160 160
161 DEFINE_TRACE(MIDIPort) { 161 DEFINE_TRACE(MIDIPort) {
162 visitor->trace(m_access); 162 visitor->trace(m_access);
163 EventTargetWithInlineData::trace(visitor); 163 EventTargetWithInlineData::trace(visitor);
164 ActiveDOMObject::trace(visitor); 164 ActiveDOMObject::trace(visitor);
165 } 165 }
166 166
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 connection != ConnectionStateOpen); 199 connection != ConnectionStateOpen);
200 if (m_state == state && m_connection == connection) 200 if (m_state == state && m_connection == connection)
201 return; 201 return;
202 m_state = state; 202 m_state = state;
203 m_connection = connection; 203 m_connection = connection;
204 dispatchEvent(MIDIConnectionEvent::create(this)); 204 dispatchEvent(MIDIConnectionEvent::create(this));
205 m_access->dispatchEvent(MIDIConnectionEvent::create(this)); 205 m_access->dispatchEvent(MIDIConnectionEvent::create(this));
206 } 206 }
207 207
208 } // namespace blink 208 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698