Title: [88343] trunk/Source/WebCore
Revision
88343
Author
[email protected]
Date
2011-06-08 06:24:52 -0700 (Wed, 08 Jun 2011)

Log Message

2011-06-08  Tommy Widenflycht  <[email protected]>

        Reviewed by Tony Gentilcore.

        StreamEvent

        Media Stream PeerConnection API: adding StreamEvent class
        https://bugs.webkit.org/show_bug.cgi?id=61537

        Tests for the Media Stream API will be provided by the bug 56587.

        * CMakeLists.txt:
        * CodeGenerators.pri:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * GNUmakefile.list.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSEventCustom.cpp:
        (WebCore::toJS):
        * bindings/v8/custom/V8EventCustom.cpp:
        (WebCore::toV8):
        * dom/DOMAllInOne.cpp:
        * dom/Event.cpp:
        (WebCore::Event::isStreamEvent):
        * dom/Event.h:
        * dom/StreamEvent.cpp: Added.
        (WebCore::StreamEvent::create):
        (WebCore::StreamEvent::StreamEvent):
        (WebCore::StreamEvent::~StreamEvent):
        (WebCore::StreamEvent::initStreamEvent):
        (WebCore::StreamEvent::stream):
        * dom/StreamEvent.h: Added.
        (WebCore::StreamEvent::isStreamEvent):
        * dom/StreamEvent.idl: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (88342 => 88343)


--- trunk/Source/WebCore/CMakeLists.txt	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/CMakeLists.txt	2011-06-08 13:24:52 UTC (rev 88343)
@@ -1957,6 +1957,7 @@
         bindings/js/JSNavigatorCustom.cpp
         dom/GeneratedStream.cpp
         dom/Stream.cpp
+        dom/StreamEvent.cpp
         page/MediaStreamController.cpp
         page/MediaStreamFrameController.cpp
     )
@@ -1964,6 +1965,7 @@
     LIST(APPEND WebCore_IDL_FILES
         dom/GeneratedStream.idl
         dom/Stream.idl
+        dom/StreamEvent.idl
         page/NavigatorUserMediaError.idl
     )
 ENDIF ()

Modified: trunk/Source/WebCore/ChangeLog (88342 => 88343)


--- trunk/Source/WebCore/ChangeLog	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/ChangeLog	2011-06-08 13:24:52 UTC (rev 88343)
@@ -2,6 +2,44 @@
 
         Reviewed by Tony Gentilcore.
 
+        StreamEvent
+
+        Media Stream PeerConnection API: adding StreamEvent class
+        https://bugs.webkit.org/show_bug.cgi?id=61537
+
+        Tests for the Media Stream API will be provided by the bug 56587.
+
+        * CMakeLists.txt:
+        * CodeGenerators.pri:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.list.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSEventCustom.cpp:
+        (WebCore::toJS):
+        * bindings/v8/custom/V8EventCustom.cpp:
+        (WebCore::toV8):
+        * dom/DOMAllInOne.cpp:
+        * dom/Event.cpp:
+        (WebCore::Event::isStreamEvent):
+        * dom/Event.h:
+        * dom/StreamEvent.cpp: Added.
+        (WebCore::StreamEvent::create):
+        (WebCore::StreamEvent::StreamEvent):
+        (WebCore::StreamEvent::~StreamEvent):
+        (WebCore::StreamEvent::initStreamEvent):
+        (WebCore::StreamEvent::stream):
+        * dom/StreamEvent.h: Added.
+        (WebCore::StreamEvent::isStreamEvent):
+        * dom/StreamEvent.idl: Added.
+
+2011-06-08  Tommy Widenflycht  <[email protected]>
+
+        Reviewed by Tony Gentilcore.
+
         Media Stream API: integrate the Track List objects into the existing code.
         https://bugs.webkit.org/show_bug.cgi?id=60205
 

Modified: trunk/Source/WebCore/CodeGenerators.pri (88342 => 88343)


--- trunk/Source/WebCore/CodeGenerators.pri	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/CodeGenerators.pri	2011-06-08 13:24:52 UTC (rev 88343)
@@ -156,6 +156,7 @@
     dom/RangeException.idl \
     dom/Range.idl \
     dom/Stream.idl \
+    dom/StreamEvent.idl \
     dom/StringCallback.idl \
     dom/Text.idl \
     dom/TextEvent.idl \

Modified: trunk/Source/WebCore/DerivedSources.cpp (88342 => 88343)


--- trunk/Source/WebCore/DerivedSources.cpp	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/DerivedSources.cpp	2011-06-08 13:24:52 UTC (rev 88343)
@@ -292,6 +292,7 @@
 #include "JSStorageInfoQuotaCallback.cpp"
 #include "JSStorageInfoUsageCallback.cpp"
 #include "JSStream.cpp"
+#include "JSStreamEvent.cpp"
 #include "JSStringCallback.cpp"
 #include "JSStyleMedia.cpp"
 #include "JSStyleSheet.cpp"

Modified: trunk/Source/WebCore/DerivedSources.make (88342 => 88343)


--- trunk/Source/WebCore/DerivedSources.make	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/DerivedSources.make	2011-06-08 13:24:52 UTC (rev 88343)
@@ -365,6 +365,7 @@
     StorageInfoQuotaCallback \
     StorageInfoUsageCallback \
     Stream \
+    StreamEvent \
     StringCallback \
     SVGAElement \
     SVGAltGlyphElement \

Modified: trunk/Source/WebCore/GNUmakefile.list.am (88342 => 88343)


--- trunk/Source/WebCore/GNUmakefile.list.am	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2011-06-08 13:24:52 UTC (rev 88343)
@@ -461,6 +461,8 @@
 	DerivedSources/WebCore/JSStorageInfoUsageCallback.h \
 	DerivedSources/WebCore/JSStream.cpp \
 	DerivedSources/WebCore/JSStream.h \
+	DerivedSources/WebCore/JSStreamEvent.cpp \
+	DerivedSources/WebCore/JSStreamEvent.h \
 	DerivedSources/WebCore/JSStyleMedia.cpp \
 	DerivedSources/WebCore/JSStyleMedia.h \
 	DerivedSources/WebCore/JSStyleSheet.cpp \
@@ -1272,6 +1274,8 @@
 	Source/WebCore/dom/StaticNodeList.h \
 	Source/WebCore/dom/Stream.cpp \
 	Source/WebCore/dom/Stream.h \
+	Source/WebCore/dom/StreamEvent.cpp \
+	Source/WebCore/dom/Streamevent.h \
 	Source/WebCore/dom/StyledElement.cpp \
 	Source/WebCore/dom/StyledElement.h \
 	Source/WebCore/dom/StyleElement.cpp \

Modified: trunk/Source/WebCore/WebCore.gypi (88342 => 88343)


--- trunk/Source/WebCore/WebCore.gypi	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/WebCore.gypi	2011-06-08 13:24:52 UTC (rev 88343)
@@ -1172,6 +1172,7 @@
             'dom/RangeException.idl',
             'dom/RequestAnimationFrameCallback.idl',
             'dom/Stream.idl',
+            'dom/StreamEvent.idl',
             'dom/StringCallback.idl',
             'dom/Text.idl',
             'dom/TextEvent.idl',
@@ -2581,6 +2582,8 @@
             'dom/StaticNodeList.h',
             'dom/Stream.cpp',
             'dom/Stream.h',
+            'dom/StreamEvent.cpp',
+            'dom/StreamEvent.h',
             'dom/StringCallback.cpp',
             'dom/StringCallback.h',
             'dom/StyleElement.cpp',

Modified: trunk/Source/WebCore/WebCore.pro (88342 => 88343)


--- trunk/Source/WebCore/WebCore.pro	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/WebCore.pro	2011-06-08 13:24:52 UTC (rev 88343)
@@ -3150,6 +3150,7 @@
     HEADERS += \
         dom/GeneratedStream.h \
         dom/Stream.h \
+        dom/StreamEvent.h \
         page/CallbackTask.h \
         page/MediaStreamClient.h \
         page/MediaStreamController.h \
@@ -3161,6 +3162,7 @@
     SOURCES += \
         dom/GeneratedStream.cpp \
         dom/Stream.cpp \
+        dom/StreamEvent.cpp \
         page/MediaStreamController.cpp \
         page/MediaStreamFrameController.cpp
 

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (88342 => 88343)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2011-06-08 13:24:52 UTC (rev 88343)
@@ -13654,6 +13654,62 @@
 				>
 			</File>
 			<File
+				RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSStreamEvent.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Cairo_CFLite|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release_Cairo_CFLite|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_All|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Production|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSStreamEvent.h"
+				>
+			</File>
+			<File
 				RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSStringCallback.cpp"
 				>
 				<FileConfiguration
@@ -47714,6 +47770,62 @@
 				>
 			</File>
 			<File
+				RelativePath="..\dom\StreamEvent.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Cairo_CFLite|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release_Cairo_CFLite|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_All|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Production|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\dom\StreamEvent.h"
+				>
+			</File>
+			<File
 				RelativePath="..\dom\StringCallback.cpp"
 				>
 				<FileConfiguration

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (88342 => 88343)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-06-08 13:24:52 UTC (rev 88343)
@@ -1080,6 +1080,10 @@
 		499B3ED6128CD31400E726C2 /* GraphicsLayerCA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 499B3ED4128CD31400E726C2 /* GraphicsLayerCA.cpp */; };
 		499B3ED7128CD31400E726C2 /* GraphicsLayerCA.h in Headers */ = {isa = PBXBuildFile; fileRef = 499B3ED5128CD31400E726C2 /* GraphicsLayerCA.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		499B3EDD128DB50200E726C2 /* PlatformCAAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 499B3EDC128DB50100E726C2 /* PlatformCAAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		49A85B6B138D573A00ECB7B3 /* StreamEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A85B68138D573900ECB7B3 /* StreamEvent.cpp */; };
+		49A85B6C138D573A00ECB7B3 /* StreamEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 49A85B69138D573A00ECB7B3 /* StreamEvent.h */; };
+		49A85B77138D58EE00ECB7B3 /* JSStreamEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A85B75138D58EE00ECB7B3 /* JSStreamEvent.cpp */; };
+		49A85B78138D58EE00ECB7B3 /* JSStreamEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 49A85B76138D58EE00ECB7B3 /* JSStreamEvent.h */; };
 		49B69E5E1254FEED007D57EB /* LoopBlinnClassifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49B69E551254FEED007D57EB /* LoopBlinnClassifier.cpp */; };
 		49B69E5F1254FEED007D57EB /* LoopBlinnClassifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 49B69E561254FEED007D57EB /* LoopBlinnClassifier.h */; };
 		49B69E601254FEED007D57EB /* LoopBlinnConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 49B69E571254FEED007D57EB /* LoopBlinnConstants.h */; };
@@ -7671,6 +7675,11 @@
 		499B3ED4128CD31400E726C2 /* GraphicsLayerCA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GraphicsLayerCA.cpp; path = ca/GraphicsLayerCA.cpp; sourceTree = "<group>"; };
 		499B3ED5128CD31400E726C2 /* GraphicsLayerCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GraphicsLayerCA.h; path = ca/GraphicsLayerCA.h; sourceTree = "<group>"; };
 		499B3EDC128DB50100E726C2 /* PlatformCAAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformCAAnimation.h; path = ca/PlatformCAAnimation.h; sourceTree = "<group>"; };
+		49A85B68138D573900ECB7B3 /* StreamEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamEvent.cpp; sourceTree = "<group>"; };
+		49A85B69138D573A00ECB7B3 /* StreamEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamEvent.h; sourceTree = "<group>"; };
+		49A85B6A138D573A00ECB7B3 /* StreamEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StreamEvent.idl; sourceTree = "<group>"; };
+		49A85B75138D58EE00ECB7B3 /* JSStreamEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStreamEvent.cpp; sourceTree = "<group>"; };
+		49A85B76138D58EE00ECB7B3 /* JSStreamEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStreamEvent.h; sourceTree = "<group>"; };
 		49B69E551254FEED007D57EB /* LoopBlinnClassifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LoopBlinnClassifier.cpp; path = gpu/LoopBlinnClassifier.cpp; sourceTree = "<group>"; };
 		49B69E561254FEED007D57EB /* LoopBlinnClassifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoopBlinnClassifier.h; path = gpu/LoopBlinnClassifier.h; sourceTree = "<group>"; };
 		49B69E571254FEED007D57EB /* LoopBlinnConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoopBlinnConstants.h; path = gpu/LoopBlinnConstants.h; sourceTree = "<group>"; };
@@ -17146,6 +17155,8 @@
 				75415D54129AB2D2003AD669 /* JSSpeechInputResultList.h */,
 				B1E545D713462B0B0092A545 /* JSStream.cpp */,
 				B1E545D813462B0B0092A545 /* JSStream.h */,
+				49A85B75138D58EE00ECB7B3 /* JSStreamEvent.cpp */,
+				49A85B76138D58EE00ECB7B3 /* JSStreamEvent.h */,
 				65DF31EF09D1CC60000BE325 /* JSText.cpp */,
 				65DF31F009D1CC60000BE325 /* JSText.h */,
 				B12D23631356032F002A28D4 /* JSTrackList.cpp */,
@@ -19693,6 +19704,9 @@
 				B1E545741346291F0092A545 /* Stream.cpp */,
 				B1E545751346291F0092A545 /* Stream.h */,
 				B1E545761346291F0092A545 /* Stream.idl */,
+				49A85B68138D573900ECB7B3 /* StreamEvent.cpp */,
+				49A85B69138D573A00ECB7B3 /* StreamEvent.h */,
+				49A85B6A138D573A00ECB7B3 /* StreamEvent.idl */,
 				8102C5871325BB1100DDE67A /* StringCallback.cpp */,
 				81AC6C35131C57D30009A7E0 /* StringCallback.h */,
 				81AC6C34131C57C20009A7E0 /* StringCallback.idl */,
@@ -23141,6 +23155,8 @@
 				4496E3A0139813A5003EE32A /* JSSVGMPathElement.h in Headers */,
 				2E2445F71395893A004B6C19 /* OperationNotAllowedException.h in Headers */,
 				2E24476913959173004B6C19 /* JSOperationNotAllowedException.h in Headers */,
+				49A85B6C138D573A00ECB7B3 /* StreamEvent.h in Headers */,
+				49A85B78138D58EE00ECB7B3 /* JSStreamEvent.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -25870,6 +25886,8 @@
 				4496E39D1398136C003EE32A /* JSSVGAnimateMotionElement.cpp in Sources */,
 				4496E3A2139813CB003EE32A /* JSSVGMPathElement.cpp in Sources */,
 				2E24476813959173004B6C19 /* JSOperationNotAllowedException.cpp in Sources */,
+				49A85B6B138D573A00ECB7B3 /* StreamEvent.cpp in Sources */,
+				49A85B77138D58EE00ECB7B3 /* JSStreamEvent.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WebCore/bindings/js/JSEventCustom.cpp (88342 => 88343)


--- trunk/Source/WebCore/bindings/js/JSEventCustom.cpp	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/bindings/js/JSEventCustom.cpp	2011-06-08 13:24:52 UTC (rev 88343)
@@ -110,6 +110,11 @@
 #include "JSCloseEvent.h"
 #endif
 
+#if ENABLE(MEDIA_STREAM)
+#include "JSStreamEvent.h"
+#include "StreamEvent.h"
+#endif
+
 using namespace JSC;
 
 namespace WebCore {
@@ -208,6 +213,10 @@
     else if (event->isCloseEvent())
         wrapper = CREATE_DOM_WRAPPER(exec, globalObject, CloseEvent, event);
 #endif
+#if ENABLE(MEDIA_STREAM)
+    else if (event->isStreamEvent())
+        wrapper = CREATE_DOM_WRAPPER(exec, globalObject, StreamEvent, event);
+#endif
     else
         wrapper = CREATE_DOM_WRAPPER(exec, globalObject, Event, event);
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp (88342 => 88343)


--- trunk/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp	2011-06-08 13:24:52 UTC (rev 88343)
@@ -57,6 +57,7 @@
 #include "V8Proxy.h"
 #include "V8SpeechInputEvent.h"
 #include "V8StorageEvent.h"
+#include "V8StreamEvent.h"
 #include "V8TextEvent.h"
 #include "V8TouchEvent.h"
 #include "V8UIEvent.h"
@@ -184,6 +185,10 @@
     if (impl->isCloseEvent())
         return toV8(static_cast<CloseEvent*>(impl));
 #endif
+#if ENABLE(MEDIA_STREAM)
+    if (impl->isStreamEvent())
+        return toV8(static_cast<StreamEvent*>(impl));
+#endif
     return V8Event::wrap(impl);
 }
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/DOMAllInOne.cpp (88342 => 88343)


--- trunk/Source/WebCore/dom/DOMAllInOne.cpp	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/dom/DOMAllInOne.cpp	2011-06-08 13:24:52 UTC (rev 88343)
@@ -119,6 +119,7 @@
 #include "StaticHashSetNodeList.cpp"
 #include "StaticNodeList.cpp"
 #include "Stream.cpp"
+#include "StreamEvent.cpp"
 #include "StyleElement.cpp"
 #include "StyledElement.cpp"
 #include "TagNodeList.cpp"

Modified: trunk/Source/WebCore/dom/Event.cpp (88342 => 88343)


--- trunk/Source/WebCore/dom/Event.cpp	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/dom/Event.cpp	2011-06-08 13:24:52 UTC (rev 88343)
@@ -250,6 +250,13 @@
 }
 #endif
 
+#if ENABLE(MEDIA_STREAM)
+bool Event::isStreamEvent() const
+{
+    return false;
+}
+#endif
+
 bool Event::fromUserGesture()
 {
     if (!UserGestureIndicator::processingUserGesture())

Modified: trunk/Source/WebCore/dom/Event.h (88342 => 88343)


--- trunk/Source/WebCore/dom/Event.h	2011-06-08 13:19:43 UTC (rev 88342)
+++ trunk/Source/WebCore/dom/Event.h	2011-06-08 13:24:52 UTC (rev 88343)
@@ -147,6 +147,9 @@
 #if ENABLE(WEB_SOCKETS)
         virtual bool isCloseEvent() const;
 #endif
+#if ENABLE(MEDIA_STREAM)
+        virtual bool isStreamEvent() const;
+#endif
         bool fromUserGesture();
         
         bool propagationStopped() const { return m_propagationStopped || m_immediatePropagationStopped; }

Added: trunk/Source/WebCore/dom/StreamEvent.cpp (0 => 88343)


--- trunk/Source/WebCore/dom/StreamEvent.cpp	                        (rev 0)
+++ trunk/Source/WebCore/dom/StreamEvent.cpp	2011-06-08 13:24:52 UTC (rev 88343)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "StreamEvent.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "EventNames.h"
+#include "Stream.h"
+
+namespace WebCore {
+
+PassRefPtr<StreamEvent> StreamEvent::create()
+{
+    return adoptRef(new StreamEvent);
+}
+
+PassRefPtr<StreamEvent> StreamEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Stream> stream)
+{
+    return adoptRef(new StreamEvent(type, canBubble, cancelable, stream));
+}
+
+
+StreamEvent::StreamEvent()
+{
+}
+
+StreamEvent::StreamEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Stream> stream)
+    : Event(type, canBubble, cancelable)
+    , m_stream(stream)
+{
+}
+
+StreamEvent::~StreamEvent()
+{
+}
+
+void StreamEvent::initStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Stream> stream)
+{
+    if (dispatched())
+        return;
+
+    initEvent(type, canBubble, cancelable);
+
+    m_stream = stream;
+}
+
+PassRefPtr<Stream> StreamEvent::stream() const
+{
+    return m_stream;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+

Added: trunk/Source/WebCore/dom/StreamEvent.h (0 => 88343)


--- trunk/Source/WebCore/dom/StreamEvent.h	                        (rev 0)
+++ trunk/Source/WebCore/dom/StreamEvent.h	2011-06-08 13:24:52 UTC (rev 88343)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StreamEvent_h
+#define StreamEvent_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "Event.h"
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+class Stream;
+
+class StreamEvent : public Event {
+public:
+    virtual ~StreamEvent();
+
+    static PassRefPtr<StreamEvent> create();
+    static PassRefPtr<StreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Stream>);
+
+    void initStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Stream>);
+
+    // From EventTarget.
+    virtual bool isStreamEvent() const { return true; }
+
+    PassRefPtr<Stream> stream() const;
+
+private:
+    StreamEvent();
+    StreamEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Stream>);
+
+    RefPtr<Stream> m_stream;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // StreamEvent_h

Added: trunk/Source/WebCore/dom/StreamEvent.idl (0 => 88343)


--- trunk/Source/WebCore/dom/StreamEvent.idl	                        (rev 0)
+++ trunk/Source/WebCore/dom/StreamEvent.idl	2011-06-08 13:24:52 UTC (rev 88343)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module events {
+
+    // According to the WHATWG specification, section 9.7:
+    // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#streamevent
+    interface [
+        Conditional=MEDIA_STREAM,
+    ] StreamEvent : Event {
+       readonly attribute Stream stream;
+
+       void initStreamEvent(in DOMString typeArg,
+                            in boolean canBubbleArg,
+                            in boolean cancelableArg,
+                            in Stream streamArg);
+    };
+
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to