<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[46863] trunk/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/46863">46863</a></dd>
<dt>Author</dt> <dd>jorlow@chromium.org</dd>
<dt>Date</dt> <dd>2009-08-06 15:30:10 -0700 (Thu, 06 Aug 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-08-06  Fumitoshi Ukai  &lt;ukai@chromium.org&gt;

        Reviewed by Alexey Proskuryakov.

        Add WebSocket.idl
        https://bugs.webkit.org/show_bug.cgi?id=27209

        Add WebSocket.idl in WebCore/websockets/.
        Add build systems only for GNUmakefile.am and WebCore.xcodeproj now.
        Other build systems will be updated once the code is functional.

        * DerivedSources.make:
        * GNUmakefile.am:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSWebSocketConstructor.cpp: Added.
        * bindings/js/JSWebSocketConstructor.h: Added.
        * bindings/js/JSWebSocketCustom.cpp: Added.
        * websockets/WebSocket.cpp: Added.
        * websockets/WebSocket.h: Added.
        * websockets/WebSocket.idl: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreDerivedSourcesmake">trunk/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkWebCoreGNUmakefileam">trunk/WebCore/GNUmakefile.am</a></li>
<li><a href="#trunkWebCoreWebCorexcodeprojprojectpbxproj">trunk/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebCorebindingsjsJSWebSocketConstructorcpp">trunk/WebCore/bindings/js/JSWebSocketConstructor.cpp</a></li>
<li><a href="#trunkWebCorebindingsjsJSWebSocketConstructorh">trunk/WebCore/bindings/js/JSWebSocketConstructor.h</a></li>
<li><a href="#trunkWebCorebindingsjsJSWebSocketCustomcpp">trunk/WebCore/bindings/js/JSWebSocketCustom.cpp</a></li>
<li>trunk/WebCore/websockets/</li>
<li><a href="#trunkWebCorewebsocketsWebSocketcpp">trunk/WebCore/websockets/WebSocket.cpp</a></li>
<li><a href="#trunkWebCorewebsocketsWebSocketh">trunk/WebCore/websockets/WebSocket.h</a></li>
<li><a href="#trunkWebCorewebsocketsWebSocketidl">trunk/WebCore/websockets/WebSocket.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (46862 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-08-06 22:08:24 UTC (rev 46862)
+++ trunk/WebCore/ChangeLog        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2009-08-06  Fumitoshi Ukai  &lt;ukai@chromium.org&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add WebSocket.idl
+        https://bugs.webkit.org/show_bug.cgi?id=27209
+
+        Add WebSocket.idl in WebCore/websockets/.
+        Add build systems only for GNUmakefile.am and WebCore.xcodeproj now.
+        Other build systems will be updated once the code is functional.
+
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSWebSocketConstructor.cpp: Added.
+        * bindings/js/JSWebSocketConstructor.h: Added.
+        * bindings/js/JSWebSocketCustom.cpp: Added.
+        * websockets/WebSocket.cpp: Added.
+        * websockets/WebSocket.h: Added.
+        * websockets/WebSocket.idl: Added.
+
</ins><span class="cx"> 2009-08-06  Jian Li  &lt;jianli@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Dimitri Glazkov.
</span></span></pre></div>
<a id="trunkWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/DerivedSources.make (46862 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/DerivedSources.make        2009-08-06 22:08:24 UTC (rev 46862)
+++ trunk/WebCore/DerivedSources.make        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx">     $(WebCore)/wml \
</span><span class="cx">     $(WebCore)/workers \
</span><span class="cx">     $(WebCore)/svg \
</span><ins>+    $(WebCore)/websockets \
</ins><span class="cx"> #
</span><span class="cx"> 
</span><span class="cx"> DOM_CLASSES = \
</span><span class="lines">@@ -374,6 +375,7 @@
</span><span class="cx">     WebKitCSSTransformValue \
</span><span class="cx">     WebKitPoint \
</span><span class="cx">     WebKitTransitionEvent \
</span><ins>+    WebSocket \
</ins><span class="cx">     WheelEvent \
</span><span class="cx">     Worker \
</span><span class="cx">     WorkerContext \
</span></span></pre></div>
<a id="trunkWebCoreGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/GNUmakefile.am (46862 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/GNUmakefile.am        2009-08-06 22:08:24 UTC (rev 46862)
+++ trunk/WebCore/GNUmakefile.am        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -3138,10 +3138,20 @@
</span><span class="cx"> if ENABLE_WEB_SOCKETS
</span><span class="cx"> FEATURE_DEFINES_JAVASCRIPT += ENABLE_WEB_SOCKETS=1
</span><span class="cx"> 
</span><ins>+IDL_BINDINGS += \
+        WebCore/websockets/WebSocket.idl
+
</ins><span class="cx"> webcore_cppflags += \
</span><span class="cx">         -DENABLE_WEB_SOCKETS=1 \
</span><span class="cx">         -I$(srcdir)/WebCore/websockets
</span><span class="cx"> 
</span><ins>+webcore_sources += \
+        WebCore/bindings/js/JSWebSocketConstructor.cpp \
+        WebCore/bindings/js/JSWebSocketConstructor.h \
+        WebCore/bindings/js/JSWebSocketCustom.cpp \
+        WebCore/websockets/WebSocket.cpp \
+        WebCore/websockets/WebSocket.h
+
</ins><span class="cx"> else
</span><span class="cx"> webcore_cppflags += -DENABLE_WEB_SOCKETS=0
</span><span class="cx"> endif  # END ENABLE_WEB_SOCKETS
</span><span class="lines">@@ -3246,6 +3256,7 @@
</span><span class="cx">     $(WebCore)/svg \
</span><span class="cx">     $(WebCore)/xml \
</span><span class="cx">     $(WebCore)/plugins \
</span><ins>+    $(WebCore)/websockets \
</ins><span class="cx">     $(WebCore)/workers
</span><span class="cx"> 
</span><span class="cx"> vpath %.idl = $(IDL_PATH)
</span></span></pre></div>
<a id="trunkWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.xcodeproj/project.pbxproj (46862 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2009-08-06 22:08:24 UTC (rev 46862)
+++ trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -867,6 +867,11 @@
</span><span class="cx">                 51741D100B07259A00ED442C /* BackForwardList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0C0B07259A00ED442C /* BackForwardList.cpp */; };
</span><span class="cx">                 51741D110B07259A00ED442C /* HistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0D0B07259A00ED442C /* HistoryItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0E0B07259A00ED442C /* HistoryItem.cpp */; };
</span><ins>+                518A34C11026C831001B6896 /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518A34BE1026C831001B6896 /* WebSocket.cpp */; };
+                518A34C21026C831001B6896 /* WebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 518A34BF1026C831001B6896 /* WebSocket.h */; };
+                518A34C71026C8C9001B6896 /* JSWebSocketConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518A34C41026C8C9001B6896 /* JSWebSocketConstructor.cpp */; };
+                518A34C81026C8C9001B6896 /* JSWebSocketConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 518A34C51026C8C9001B6896 /* JSWebSocketConstructor.h */; };
+                518A34C91026C8C9001B6896 /* JSWebSocketCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518A34C61026C8C9001B6896 /* JSWebSocketCustom.cpp */; };
</ins><span class="cx">                 5196116A0CAC56570010A80C /* Database.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5196115E0CAC56570010A80C /* Database.cpp */; };
</span><span class="cx">                 5196116B0CAC56570010A80C /* Database.h in Headers */ = {isa = PBXBuildFile; fileRef = 5196115F0CAC56570010A80C /* Database.h */; };
</span><span class="cx">                 5196116D0CAC56570010A80C /* DatabaseThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519611610CAC56570010A80C /* DatabaseThread.cpp */; };
</span><span class="lines">@@ -5888,6 +5893,12 @@
</span><span class="cx">                 51741D0C0B07259A00ED442C /* BackForwardList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackForwardList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51741D0D0B07259A00ED442C /* HistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HistoryItem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51741D0E0B07259A00ED442C /* HistoryItem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                518A34BE1026C831001B6896 /* WebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocket.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                518A34BF1026C831001B6896 /* WebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocket.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                518A34C01026C831001B6896 /* WebSocket.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebSocket.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                518A34C41026C8C9001B6896 /* JSWebSocketConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebSocketConstructor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                518A34C51026C8C9001B6896 /* JSWebSocketConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebSocketConstructor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                518A34C61026C8C9001B6896 /* JSWebSocketCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebSocketCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5196115E0CAC56570010A80C /* Database.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Database.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5196115F0CAC56570010A80C /* Database.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Database.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 519611600CAC56570010A80C /* Database.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Database.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9523,6 +9534,7 @@
</span><span class="cx">                 0867D691FE84028FC02AAC07 /* WebKit */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                518A34BD1026C831001B6896 /* websockets */,
</ins><span class="cx">                                 65C97AF208EA908800ACD273 /* config.h */,
</span><span class="cx">                                 EDEC98020AED7E170059137F /* WebCorePrefix.h */,
</span><span class="cx">                                 9307061309E0CA8200B17FE4 /* DerivedSources.make */,
</span><span class="lines">@@ -10256,6 +10268,16 @@
</span><span class="cx">                         tabWidth = 4;
</span><span class="cx">                         usesTabs = 0;
</span><span class="cx">                 };
</span><ins>+                518A34BD1026C831001B6896 /* websockets */ = {
+                        isa = PBXGroup;
+                        children = (
+                                518A34BE1026C831001B6896 /* WebSocket.cpp */,
+                                518A34BF1026C831001B6896 /* WebSocket.h */,
+                                518A34C01026C831001B6896 /* WebSocket.idl */,
+                        );
+                        path = websockets;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 5DCF83690D59157800953BC6 /* plugins */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -13531,6 +13553,9 @@
</span><span class="cx">                 BC1A3793097C6FB10019F3D8 /* js */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                518A34C41026C8C9001B6896 /* JSWebSocketConstructor.cpp */,
+                                518A34C51026C8C9001B6896 /* JSWebSocketConstructor.h */,
+                                518A34C61026C8C9001B6896 /* JSWebSocketCustom.cpp */,
</ins><span class="cx">                                 BC4EDEF70C08F414007EDD49 /* Custom */,
</span><span class="cx">                                 14DFB33F0A7DF7630018F769 /* Derived Sources */,
</span><span class="cx">                                 93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,
</span><span class="lines">@@ -17122,6 +17147,8 @@
</span><span class="cx">                                 41D168EE10226E89009BC827 /* SharedWorkerThread.h in Headers */,
</span><span class="cx">                                 41D1690610238B66009BC827 /* JSSharedWorkerContext.h in Headers */,
</span><span class="cx">                                 4167EBF6102962BA003D252A /* DefaultSharedWorkerRepository.h in Headers */,
</span><ins>+                                518A34C21026C831001B6896 /* WebSocket.h in Headers */,
+                                518A34C81026C8C9001B6896 /* JSWebSocketConstructor.h in Headers */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -19173,6 +19200,9 @@
</span><span class="cx">                                 41D168F010226EC4009BC827 /* JSSharedWorkerContextCustom.cpp in Sources */,
</span><span class="cx">                                 41D1690510238B66009BC827 /* JSSharedWorkerContext.cpp in Sources */,
</span><span class="cx">                                 4167EBF5102962BA003D252A /* DefaultSharedWorkerRepository.cpp in Sources */,
</span><ins>+                                518A34C11026C831001B6896 /* WebSocket.cpp in Sources */,
+                                518A34C71026C8C9001B6896 /* JSWebSocketConstructor.cpp in Sources */,
+                                518A34C91026C8C9001B6896 /* JSWebSocketCustom.cpp in Sources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkWebCorebindingsjsJSWebSocketConstructorcpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/bindings/js/JSWebSocketConstructor.cpp (0 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/js/JSWebSocketConstructor.cpp                                (rev 0)
+++ trunk/WebCore/bindings/js/JSWebSocketConstructor.cpp        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2009 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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 &quot;config.h&quot;
+
+#if ENABLE(WEB_SOCKETS)
+
+#include &quot;JSWebSocketConstructor.h&quot;
+
+#include &quot;JSWebSocket.h&quot;
+#include &quot;ScriptExecutionContext.h&quot;
+#include &quot;WebSocket.h&quot;
+
+using namespace JSC;
+
+namespace WebCore {
+
+ASSERT_CLASS_FITS_IN_CELL(JSWebSocketConstructor);
+
+const ClassInfo JSWebSocketConstructor::s_info = { &quot;WebSocketConstructor&quot;, 0, 0, 0 };
+
+JSWebSocketConstructor::JSWebSocketConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
+    : DOMConstructorObject(JSWebSocketConstructor::createStructure(globalObject-&gt;objectPrototype()), globalObject)
+{
+    putDirect(exec-&gt;propertyNames().prototype, JSWebSocketPrototype::self(exec, globalObject), None);
+    putDirect(exec-&gt;propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
+}
+
+static JSObject* constructWebSocket(ExecState* exec, JSObject* constructor, const ArgList&amp; args)
+{
+    JSWebSocketConstructor* jsConstructor = static_cast&lt;JSWebSocketConstructor*&gt;(constructor);
+    ScriptExecutionContext* context = jsConstructor-&gt;scriptExecutionContext();
+    if (!context)
+        return throwError(exec, ReferenceError, &quot;WebSocket constructor associated document is unavailable&quot;);
+
+    if (args.size() == 0)
+        return throwError(exec, SyntaxError, &quot;Not enough arguments&quot;);
+
+    const String&amp; urlString = args.at(0).toString(exec);
+    if (exec-&gt;hadException())
+        return throwError(exec, SyntaxError, &quot;wrong URL&quot;);
+    const KURL&amp; url = context-&gt;completeURL(urlString);
+    RefPtr&lt;WebSocket&gt; webSocket = WebSocket::create(context);
+    ExceptionCode ec = 0;
+    if (args.size() &lt; 2)
+        webSocket-&gt;connect(url, ec);
+    else {
+        const String&amp; protocol = args.at(1).toString(exec);
+        if (exec-&gt;hadException())
+            return 0;
+        webSocket-&gt;connect(url, protocol, ec);
+    }
+    setDOMException(exec, ec);
+    return CREATE_DOM_OBJECT_WRAPPER(exec, jsConstructor-&gt;globalObject(), WebSocket, webSocket.get());
+}
+
+ConstructType JSWebSocketConstructor::getConstructData(ConstructData&amp; constructData)
+{
+    constructData.native.function = constructWebSocket;
+    return ConstructTypeHost;
+}
+
+}  // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkWebCorebindingsjsJSWebSocketConstructorh"></a>
<div class="addfile"><h4>Added: trunk/WebCore/bindings/js/JSWebSocketConstructor.h (0 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/js/JSWebSocketConstructor.h                                (rev 0)
+++ trunk/WebCore/bindings/js/JSWebSocketConstructor.h        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2009 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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 JSWebSocketConstructor_h
+#define JSWebSocketConstructor_h
+
+#include &quot;JSDOMBinding.h&quot;
+
+namespace WebCore {
+
+class JSWebSocketConstructor : public DOMConstructorObject {
+  public:
+    JSWebSocketConstructor(JSC::ExecState*, JSDOMGlobalObject*);
+    static const JSC::ClassInfo s_info;
+
+  private:
+    virtual JSC::ConstructType getConstructData(JSC::ConstructData&amp;);
+    virtual const JSC::ClassInfo* classInfo() const { return &amp;s_info; }
+};
+
+}  // namespace WebCore
+
+#endif  // JSWebSocketConstructor_h
</ins></span></pre></div>
<a id="trunkWebCorebindingsjsJSWebSocketCustomcpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/bindings/js/JSWebSocketCustom.cpp (0 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/js/JSWebSocketCustom.cpp                                (rev 0)
+++ trunk/WebCore/bindings/js/JSWebSocketCustom.cpp        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2009 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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 &quot;config.h&quot;
+
+#if ENABLE(WEB_SOCKETS)
+
+#include &quot;JSWebSocket.h&quot;
+
+#include &quot;KURL.h&quot;
+#include &quot;WebSocket.h&quot;
+#include &quot;NotImplemented.h&quot;
+
+using namespace JSC;
+
+namespace WebCore {
+
+void JSWebSocket::mark()
+{
+    Base::mark();
+    if (m_impl-&gt;readyState() != WebSocket::CLOSED)
+        markIfNotNull(m_impl-&gt;onmessage());
+    // FIXME: mark if EventListeners is registered.
+}
+
+// Custom functions
+JSValue JSWebSocket::send(ExecState* exec, const ArgList&amp; args)
+{
+    if (args.size() &lt; 1)
+        return throwError(exec, SyntaxError, &quot;Not enough arguments&quot;);
+
+    const String&amp; msg = args.at(0).toString(exec);
+    if (exec-&gt;hadException())
+        return throwError(exec, SyntaxError, &quot;bad message data.&quot;);
+    ExceptionCode ec = 0;
+    JSValue ret = jsBoolean(impl()-&gt;send(msg, ec));
+    setDOMException(exec, ec);
+    return ret;
+}
+
+// FIXME: implement addEventListener/removeEventListener.
+
+}  // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkWebCorewebsocketsWebSocketcpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/websockets/WebSocket.cpp (0 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/websockets/WebSocket.cpp                                (rev 0)
+++ trunk/WebCore/websockets/WebSocket.cpp        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -0,0 +1,174 @@
</span><ins>+/*
+ * Copyright (C) 2009 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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 &quot;config.h&quot;
+
+#if ENABLE(WEB_SOCKETS)
+
+#include &quot;WebSocket.h&quot;
+
+#include &quot;Event.h&quot;
+#include &quot;EventException.h&quot;
+#include &quot;EventListener.h&quot;
+#include &lt;wtf/StdLibExtras.h&gt;
+
+namespace WebCore {
+
+WebSocket::WebSocket(ScriptExecutionContext* context)
+    : ActiveDOMObject(context, this)
+    , m_state(CONNECTING)
+{
+}
+
+WebSocket::~WebSocket()
+{
+    close();
+}
+
+void WebSocket::connect(const KURL&amp; url, ExceptionCode&amp; ec)
+{
+    connect(url, String(), ec);
+}
+
+void WebSocket::connect(const KURL&amp; url, const String&amp; protocol, ExceptionCode&amp; ec)
+{
+    m_url = url;
+    m_protocol = protocol;
+
+    if (!m_url.protocolIs(&quot;ws&quot;) &amp;&amp; !m_url.protocolIs(&quot;wss&quot;)) {
+        m_state = CLOSED;
+        ec = SYNTAX_ERR;
+        return;
+    }
+    if (!m_protocol.isNull() &amp;&amp; m_protocol.isEmpty()) {
+        m_state = CLOSED;
+        ec = SYNTAX_ERR;
+        return;
+    }
+    // FIXME: Check protocol is valid form.
+    // FIXME: Connect WebSocketChannel.
+}
+
+bool WebSocket::send(const String&amp;, ExceptionCode&amp; ec)
+{
+    if (m_state != OPEN) {
+        ec = INVALID_STATE_ERR;
+        return false;
+    }
+    // FIXME: send message on WebSocketChannel.
+    return false;
+}
+
+void WebSocket::close()
+{
+    if (m_state == CLOSED)
+        return;
+    m_state = CLOSED;
+    // FIXME: close WebSocketChannel.
+}
+
+const KURL&amp; WebSocket::url() const
+{
+    return m_url;
+}
+
+WebSocket::State WebSocket::readyState() const
+{
+    return m_state;
+}
+
+unsigned long WebSocket::bufferedAmount() const
+{
+    // FIXME: ask platform code to get buffered amount to be sent.
+    return 0;
+}
+
+ScriptExecutionContext* WebSocket::scriptExecutionContext() const
+{
+    return ActiveDOMObject::scriptExecutionContext();
+}
+
+void WebSocket::addEventListener(const AtomicString&amp;, PassRefPtr&lt;EventListener&gt;, bool)
+{
+    // FIXME: implement this.
+}
+
+void WebSocket::removeEventListener(const AtomicString&amp;, EventListener*, bool)
+{
+    // FIXME: implement this.
+}
+
+bool WebSocket::dispatchEvent(PassRefPtr&lt;Event&gt;, ExceptionCode&amp;)
+{
+    // FIXME: implement this.
+    return false;
+}
+
+void WebSocket::didConnect()
+{
+    if (m_state != CONNECTING) {
+        didClose();
+        return;
+    }
+    m_state = OPEN;
+    dispatchOpenEvent();
+}
+
+void WebSocket::didReceiveMessage(const String&amp; msg)
+{
+    if (m_state != OPEN)
+        return;
+    dispatchMessageEvent(msg);
+}
+
+void WebSocket::didClose()
+{
+    m_state = CLOSED;
+    dispatchCloseEvent();
+}
+
+void WebSocket::dispatchOpenEvent()
+{
+    // FIXME: implement this.
+}
+
+void WebSocket::dispatchMessageEvent(const String&amp;)
+{
+    // FIXME: implement this.
+}
+
+void WebSocket::dispatchCloseEvent()
+{
+    // FIXME: implement this.
+}
+
+}  // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkWebCorewebsocketsWebSocketh"></a>
<div class="addfile"><h4>Added: trunk/WebCore/websockets/WebSocket.h (0 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/websockets/WebSocket.h                                (rev 0)
+++ trunk/WebCore/websockets/WebSocket.h        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -0,0 +1,123 @@
</span><ins>+/*
+ * Copyright (C) 2009 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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 WebSocket_h
+#define WebSocket_h
+
+#include &quot;ActiveDOMObject.h&quot;
+#include &quot;AtomicStringHash.h&quot;
+#include &quot;EventListener.h&quot;
+#include &quot;EventTarget.h&quot;
+#include &quot;KURL.h&quot;
+#include &lt;wtf/OwnPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+
+namespace WebCore {
+
+class String;
+
+class WebSocket : public RefCounted&lt;WebSocket&gt;, public EventTarget, public ActiveDOMObject {
+public:
+    static PassRefPtr&lt;WebSocket&gt; create(ScriptExecutionContext* context) { return adoptRef(new WebSocket(context)); }
+    virtual ~WebSocket();
+
+    enum State {
+        CONNECTING = 0,
+        OPEN = 1,
+        CLOSED = 2
+    };
+
+    void connect(const KURL&amp; url, ExceptionCode&amp;);
+    void connect(const KURL&amp; url, const String&amp; protocol, ExceptionCode&amp;);
+
+    bool send(const String&amp; message, ExceptionCode&amp;);
+
+    void close();
+
+    const KURL&amp; url() const;
+    State readyState() const;
+    unsigned long bufferedAmount() const;
+
+    void setOnopen(PassRefPtr&lt;EventListener&gt; eventListener) { m_onopen = eventListener; }
+    EventListener* onopen() const { return m_onopen.get(); }
+    void setOnmessage(PassRefPtr&lt;EventListener&gt; eventListener) { m_onmessage = eventListener; }
+    EventListener* onmessage() const { return m_onmessage.get(); }
+    void setOnclose(PassRefPtr&lt;EventListener&gt; eventListener) { m_onclose = eventListener; }
+    EventListener* onclose() const { return m_onclose.get(); }
+
+    // EventTarget
+    virtual WebSocket* toWebSocket() { return this; }
+
+    virtual ScriptExecutionContext* scriptExecutionContext() const;
+
+    virtual void addEventListener(const AtomicString&amp; eventType, PassRefPtr&lt;EventListener&gt;, bool useCapture);
+    virtual void removeEventListener(const AtomicString&amp; eventType, EventListener*, bool useCapture);
+    virtual bool dispatchEvent(PassRefPtr&lt;Event&gt;, ExceptionCode&amp;);
+
+    // ActiveDOMObject
+    // virtual bool hasPendingActivity() const;
+    // virtual void contextDestroyed();
+    // virtual bool canSuspend() const;
+    // virtual void suspend();
+    // virtual void resume();
+    // virtual void stop();
+
+    using RefCounted&lt;WebSocket&gt;::ref;
+    using RefCounted&lt;WebSocket&gt;::deref;
+
+private:
+    WebSocket(ScriptExecutionContext*);
+
+    virtual void refEventTarget() { ref(); }
+    virtual void derefEventTarget() { deref(); }
+
+    // WebSocketChannelClient
+    void didConnect();
+    void didReceiveMessage(const String&amp; msg);
+    void didClose();
+
+    void dispatchOpenEvent();
+    void dispatchMessageEvent(const String&amp; msg);
+    void dispatchCloseEvent();
+
+    // FIXME: add WebSocketChannel.
+
+    RefPtr&lt;EventListener&gt; m_onopen;
+    RefPtr&lt;EventListener&gt; m_onmessage;
+    RefPtr&lt;EventListener&gt; m_onclose;
+
+    State m_state;
+    KURL m_url;
+    String m_protocol;
+};
+
+}  // namespace WebCore
+
+#endif  // WebSocket_h
</ins></span></pre></div>
<a id="trunkWebCorewebsocketsWebSocketidl"></a>
<div class="addfile"><h4>Added: trunk/WebCore/websockets/WebSocket.idl (0 => 46863)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/websockets/WebSocket.idl                                (rev 0)
+++ trunk/WebCore/websockets/WebSocket.idl        2009-08-06 22:30:10 UTC (rev 46863)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2009 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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 websockets {
+
+    interface [
+        CustomMarkFunction,
+        NoStaticTables,
+        Conditional=WEB_SOCKETS
+    ] WebSocket {
+        readonly attribute DOMString URL;
+
+        // ready state
+        const unsigned short CONNECTING = 0;
+        const unsigned short OPEN = 1;
+        const unsigned short CLOSED = 2;
+        readonly attribute unsigned short readyState;
+
+        readonly attribute unsigned long bufferedAmount;
+
+        // networking
+        attribute EventListener onopen;
+        attribute EventListener onmessage;
+        attribute EventListener onclose;
+
+        [Custom] boolean send(in DOMString data)
+          raises(DOMException);
+        void close();
+
+        // EventTarget interface
+        // [Custom] void addEventListener(in DOMString type,
+        //   in EventListener listener,
+        //   in boolean useCapture);
+        // [Custom] void removeEventListener(in DOMString type,
+        //   in EventListener listener,
+        //   in boolean useCapture);
+        // boolean dispatchEvent(in Event evt)
+        //   raises(EventException);
+    };
+}
</ins></span></pre>
</div>
</div>

</body>
</html>