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

Unified Diff: Source/modules/webmidi/MIDIPort.cpp

Issue 23609033: Web MIDI: MIDIPort doesn't have to be ActiveDOMObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert idl changes Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webmidi/MIDIPort.h ('k') | Source/modules/webmidi/MIDIPort.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webmidi/MIDIPort.cpp
diff --git a/Source/modules/webmidi/MIDIPort.cpp b/Source/modules/webmidi/MIDIPort.cpp
index 0e550401672298e25071f6ef91252856b84e467d..65a20f3b6ddbc44d36556930fd214861a9d61154 100644
--- a/Source/modules/webmidi/MIDIPort.cpp
+++ b/Source/modules/webmidi/MIDIPort.cpp
@@ -31,25 +31,23 @@
#include "config.h"
#include "modules/webmidi/MIDIPort.h"
+#include "modules/webmidi/MIDIAccess.h"
+
namespace WebCore {
-MIDIPort::MIDIPort(ExecutionContext* context, const String& id, const String& manufacturer, const String& name, MIDIPortTypeCode type, const String& version)
- : ActiveDOMObject(context)
- , m_id(id)
+MIDIPort::MIDIPort(MIDIAccess* access, const String& id, const String& manufacturer, const String& name, MIDIPortTypeCode type, const String& version)
+ : m_id(id)
, m_manufacturer(manufacturer)
, m_name(name)
, m_type(type)
, m_version(version)
+ , m_access(access)
{
+ ASSERT(access);
ASSERT(type == MIDIPortTypeInput || type == MIDIPortTypeOutput);
ScriptWrappable::init(this);
}
-MIDIPort::~MIDIPort()
-{
- stop();
-}
-
String MIDIPort::type() const
{
switch (m_type) {
@@ -63,4 +61,9 @@ String MIDIPort::type() const
return emptyString();
}
+ExecutionContext* MIDIPort::executionContext() const
+{
+ return m_access->executionContext();
+}
+
} // namespace WebCore
« no previous file with comments | « Source/modules/webmidi/MIDIPort.h ('k') | Source/modules/webmidi/MIDIPort.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698