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

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

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 9 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 22 matching lines...) Expand all
33 #include "bindings/core/v8/ScriptPromise.h" 33 #include "bindings/core/v8/ScriptPromise.h"
34 #include "core/dom/DOMException.h" 34 #include "core/dom/DOMException.h"
35 #include "modules/webmidi/MIDIAccess.h" 35 #include "modules/webmidi/MIDIAccess.h"
36 #include "modules/webmidi/MIDIConnectionEvent.h" 36 #include "modules/webmidi/MIDIConnectionEvent.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 using PortState = MIDIAccessor::MIDIPortState; 40 using PortState = MIDIAccessor::MIDIPortState;
41 41
42 MIDIPort::MIDIPort(MIDIAccess* access, const String& id, const String& manufactu rer, const String& name, TypeCode type, const String& version, PortState state) 42 MIDIPort::MIDIPort(MIDIAccess* access, const String& id, const String& manufactu rer, const String& name, TypeCode type, const String& version, PortState state)
43 : ActiveDOMObject(access->getExecutionContext()) 43 : ActiveScriptWrappable(this)
44 , ActiveDOMObject(access->getExecutionContext())
44 , m_id(id) 45 , m_id(id)
45 , m_manufacturer(manufacturer) 46 , m_manufacturer(manufacturer)
46 , m_name(name) 47 , m_name(name)
47 , m_type(type) 48 , m_type(type)
48 , m_version(version) 49 , m_version(version)
49 , m_access(access) 50 , m_access(access)
50 , m_connection(ConnectionStateClosed) 51 , m_connection(ConnectionStateClosed)
51 { 52 {
52 ASSERT(access); 53 ASSERT(access);
53 ASSERT(type == TypeInput || type == TypeOutput); 54 ASSERT(type == TypeInput || type == TypeOutput);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 ASSERT(state != PortState::MIDIPortStateDisconnected || connection != Connec tionStateOpen); 196 ASSERT(state != PortState::MIDIPortStateDisconnected || connection != Connec tionStateOpen);
196 if (m_state == state && m_connection == connection) 197 if (m_state == state && m_connection == connection)
197 return; 198 return;
198 m_state = state; 199 m_state = state;
199 m_connection = connection; 200 m_connection = connection;
200 dispatchEvent(MIDIConnectionEvent::create(this)); 201 dispatchEvent(MIDIConnectionEvent::create(this));
201 m_access->dispatchEvent(MIDIConnectionEvent::create(this)); 202 m_access->dispatchEvent(MIDIConnectionEvent::create(this));
202 } 203 }
203 204
204 } // namespace blink 205 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698