Changeset 48137 in webkit


Ignore:
Timestamp:
Sep 7, 2009 3:23:46 PM (15 years ago)
Author:
atwilson@chromium.org
Message:

JavaScriptCore: Reverting r48121 to fix Windows build errors.

WebCore: Unreviewed build fix.

Reverting r48121 to fix Windows build errors.

  • DerivedSources.cpp:
  • GNUmakefile.am:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMWindowCustom.cpp:
  • bindings/js/JSEventTarget.cpp:

(WebCore::toJS):
(WebCore::toEventTarget):

  • dom/EventTarget.cpp:
  • dom/EventTarget.h:
  • page/DOMWindow.idl:
  • websockets/WebSocket.cpp:

(WebCore::WebSocket::connect):
(WebCore::WebSocket::send):
(WebCore::WebSocket::close):
(WebCore::WebSocket::bufferedAmount):
(WebCore::WebSocket::addEventListener):
(WebCore::WebSocket::removeEventListener):
(WebCore::WebSocket::dispatchEvent):
(WebCore::WebSocket::didConnect):
(WebCore::WebSocket::didReceiveMessage):
(WebCore::WebSocket::didClose):
(WebCore::WebSocket::dispatchOpenEvent):
(WebCore::WebSocket::dispatchMessageEvent):
(WebCore::WebSocket::dispatchCloseEvent):

  • websockets/WebSocket.h:

(WebCore::WebSocket::create):
(WebCore::WebSocket::):
(WebCore::WebSocket::setOnopen):
(WebCore::WebSocket::onopen):
(WebCore::WebSocket::setOnmessage):
(WebCore::WebSocket::onmessage):
(WebCore::WebSocket::setOnclose):
(WebCore::WebSocket::onclose):
(WebCore::WebSocket::toWebSocket):
(WebCore::WebSocket::refEventTarget):
(WebCore::WebSocket::derefEventTarget):

  • websockets/WebSocketChannel.cpp: Removed.
  • websockets/WebSocketChannel.h: Removed.
  • websockets/WebSocketChannelClient.h: Removed.
  • websockets/WebSocketHandshake.cpp: Removed.
  • websockets/WebSocketHandshake.h: Removed.

LayoutTests: Unreviewed build fix.

Reverting r48121 to fix Windows build errors.

  • fast/dom/Window/window-properties-expected.txt:
  • fast/dom/prototype-inheritance-2-expected.txt:
  • fast/dom/prototype-inheritance-expected.txt:
  • fast/js/global-constructors-expected.txt:
Location:
trunk
Files:
5 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r48131 r48137  
     12009-09-07  Drew Wilson  <atwilson@google.com>
     2
     3        Reverting r48121 to fix Windows build errors.
     4
     5        * JavaScriptCore.exp:
     6
    172009-09-07  Drew Wilson  <atwilson@google.com>
    28
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r48121 r48137  
    295295__ZN3WTF12randomNumberEv
    296296__ZN3WTF13currentThreadEv
    297 __ZN3WTF13tryFastMallocEm
    298297__ZN3WTF13tryFastCallocEmm
    299298__ZN3WTF13tryFastMallocEm
  • trunk/LayoutTests/ChangeLog

    r48131 r48137  
     12009-09-07  Drew Wilson  <atwilson@google.com>
     2
     3        Unreviewed build fix.
     4
     5        Reverting r48121 to fix Windows build errors.
     6
     7        * fast/dom/Window/window-properties-expected.txt:
     8        * fast/dom/prototype-inheritance-2-expected.txt:
     9        * fast/dom/prototype-inheritance-expected.txt:
     10        * fast/js/global-constructors-expected.txt:
     11
    1122009-09-07  Drew Wilson  <atwilson@google.com>
    213
     
    64752009-09-07 Andras Becsi <becsi.andras@stud.u-szeged.hu>
    6576
    66         Reviewed by Tor Arne Vestbø
     77        Reviewed by Tor Arne Vestbø
    6778
    6879        [Qt] Disable a few tests that require missing controller features
     
    222233        * fast/dom/DOMImplementation/detached-doctype.html: Added.
    223234
    224 2009-09-04  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2352009-09-04  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    225236
    226237        Rubber-stamped by Simon Hausmann.
     
    230241        * platform/qt/Skipped:
    231242
    232 2009-09-04  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2432009-09-04  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    233244
    234245        Rubber-stamped by Simon Hausmann.
     
    494505        * platform/qt/css2.1/t1202-counters-18-f-expected.txt:
    495506
    496 2009-09-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     5072009-09-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    497508
    498509        Rubber-stamped by Ariya Hidayat.
     
    506517        * platform/qt/Skipped:
    507518
    508 2009-09-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     5192009-09-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    509520
    510521        Reviewed by Ariya Hidayat.
     
    514525        * platform/qt/Skipped:
    515526
    516 2009-09-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     5272009-09-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    517528
    518529        Rubber-stamped by Simon Hausmann.
     
    620631        * storage/execute-sql-args.html:
    621632
    622 2009-09-01  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     6332009-09-01  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    623634
    624635        Rubber-stamped by Simon Hausmann.
     
    359636072009-08-14  Ariya Hidayat  <ariya.hidayat@nokia.com>
    35973608
    3598         Rubber-stamped by Tor Arne Vestbø.
     3609        Rubber-stamped by Tor Arne Vestbø.
    35993610
    36003611        [Qt] Add test result after r47255.
     
    360536162009-08-14  Ariya Hidayat  <ariya.hidayat@nokia.com>
    36063617
    3607         Reviewed by Tor Arne Vestbø.
     3618        Reviewed by Tor Arne Vestbø.
    36083619
    36093620        [Qt] Update test result after r47255.
     
    541054212009-08-04  Ariya Hidayat  <ariya.hidayat@nokia.com>
    54115422
    5412         Reviewed by Tor Arne Vestbø.
     5423        Reviewed by Tor Arne Vestbø.
    54135424
    54145425        [Qt] Add pixel tests result.
     
    698569962009-07-23  Simon Hausmann  <simon.hausmann@nokia.com>
    69866997
    6987         Reviewed by Tor Arne Vestbø.
     6998        Reviewed by Tor Arne Vestbø.
    69886999
    69897000        Rebaseline the Qt results for computed-style.html and
     
    721772282009-07-21  Simon Hausmann  <simon.hausmann@nokia.com>
    72187229
    7219         Reviewed by Tor Arne Vestbø.
     7230        Reviewed by Tor Arne Vestbø.
    72207231
    72217232        Skip fast/loader/non-html-load-event.html for the Qt DRT as it requires
     
    78607871        * fast/js/resources/instanceof-operator.js: Added.
    78617872
    7862 2009-07-15  Kai BrŸning  <kai@granus.net>
     78732009-07-15  Kai BrŸning  <kai@granus.net>
    78637874
    78647875        Reviewed by Dave Hyatt.
     
    89528963        * storage/resources/database-lock-after-reload-2.html: Added.
    89538964
    8954 2009-07-08  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     89652009-07-08  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    89558966
    89568967        Rubber-stamped by Simon Hausmann.
  • trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt

    r48131 r48137  
    15151515window.WebKitTransitionEvent [object WebKitTransitionEventConstructor]
    15161516window.WebKitTransitionEvent.prototype [printed above as window.Event.prototype]
    1517 window.WebSocket [object WebSocketConstructor]
    1518 window.WebSocket.prototype [object WebSocketPrototype]
    1519 window.WebSocket.prototype.CLOSED [number]
    1520 window.WebSocket.prototype.CONNECTING [number]
    1521 window.WebSocket.prototype.OPEN [number]
    1522 window.WebSocket.prototype.close [function]
    1523 window.WebSocket.prototype.send [function]
    15241517window.WheelEvent [object WheelEventConstructor]
    15251518window.WheelEvent.prototype [printed above as window.Event.prototype]
  • trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt

    r48131 r48137  
    364364Never found WebKitCSSTransformValue
    365365Never found WebKitPoint
    366 Never found WebSocket
    367366Never found Worker
    368367Never found XMLHttpRequest
  • trunk/LayoutTests/fast/dom/prototype-inheritance-expected.txt

    r48131 r48137  
    338338PASS inner.WebKitTransitionEvent.isInner is true
    339339PASS inner.WebKitTransitionEvent.constructor.isInner is true
    340 PASS inner.WebSocket.isInner is true
    341 PASS inner.WebSocket.constructor.isInner is true
    342340PASS inner.WheelEvent.isInner is true
    343341PASS inner.WheelEvent.constructor.isInner is true
  • trunk/LayoutTests/fast/js/global-constructors-expected.txt

    r48131 r48137  
    164164PASS WebKitPoint.toString() is '[object WebKitPointConstructor]'
    165165PASS WebKitTransitionEvent.toString() is '[object WebKitTransitionEventConstructor]'
    166 PASS WebSocket.toString() is '[object WebSocketConstructor]'
    167166PASS WheelEvent.toString() is '[object WheelEventConstructor]'
    168167PASS Worker.toString() is '[object WorkerConstructor]'
  • trunk/WebCore/ChangeLog

    r48136 r48137  
     12009-09-07  Drew Wilson  <atwilson@google.com>
     2
     3        Unreviewed build fix.
     4
     5        Reverting r48121 to fix Windows build errors.
     6
     7        * DerivedSources.cpp:
     8        * GNUmakefile.am:
     9        * WebCore.xcodeproj/project.pbxproj:
     10        * bindings/js/JSDOMWindowCustom.cpp:
     11        * bindings/js/JSEventTarget.cpp:
     12        (WebCore::toJS):
     13        (WebCore::toEventTarget):
     14        * dom/EventTarget.cpp:
     15        * dom/EventTarget.h:
     16        * page/DOMWindow.idl:
     17        * websockets/WebSocket.cpp:
     18        (WebCore::WebSocket::connect):
     19        (WebCore::WebSocket::send):
     20        (WebCore::WebSocket::close):
     21        (WebCore::WebSocket::bufferedAmount):
     22        (WebCore::WebSocket::addEventListener):
     23        (WebCore::WebSocket::removeEventListener):
     24        (WebCore::WebSocket::dispatchEvent):
     25        (WebCore::WebSocket::didConnect):
     26        (WebCore::WebSocket::didReceiveMessage):
     27        (WebCore::WebSocket::didClose):
     28        (WebCore::WebSocket::dispatchOpenEvent):
     29        (WebCore::WebSocket::dispatchMessageEvent):
     30        (WebCore::WebSocket::dispatchCloseEvent):
     31        * websockets/WebSocket.h:
     32        (WebCore::WebSocket::create):
     33        (WebCore::WebSocket::):
     34        (WebCore::WebSocket::setOnopen):
     35        (WebCore::WebSocket::onopen):
     36        (WebCore::WebSocket::setOnmessage):
     37        (WebCore::WebSocket::onmessage):
     38        (WebCore::WebSocket::setOnclose):
     39        (WebCore::WebSocket::onclose):
     40        (WebCore::WebSocket::toWebSocket):
     41        (WebCore::WebSocket::refEventTarget):
     42        (WebCore::WebSocket::derefEventTarget):
     43        * websockets/WebSocketChannel.cpp: Removed.
     44        * websockets/WebSocketChannel.h: Removed.
     45        * websockets/WebSocketChannelClient.h: Removed.
     46        * websockets/WebSocketHandshake.cpp: Removed.
     47        * websockets/WebSocketHandshake.h: Removed.
     48
    1492009-09-07  Drew Wilson  <atwilson@google.com>
    250
  • trunk/WebCore/DerivedSources.cpp

    r48121 r48137  
    342342#include "JSWebKitPoint.cpp"
    343343#include "JSWebKitTransitionEvent.cpp"
    344 #include "JSWebSocket.cpp"
    345344#include "JSWheelEvent.cpp"
    346345#include "JSWorker.cpp"
  • trunk/WebCore/GNUmakefile.am

    r48126 r48137  
    32363236        WebCore/platform/network/SocketStreamHandleClient.h \
    32373237        WebCore/websockets/WebSocket.cpp \
    3238         WebCore/websockets/WebSocket.h \
    3239         WebCore/websockets/WebSocketChannel.cpp \
    3240         WebCore/websockets/WebSocketChannel.h \
    3241         WebCore/websockets/WebSocketChannelClient.h \
    3242         WebCore/websockets/WebSocketHandshake.cpp \
    3243         WebCore/websockets/WebSocketHandshake.h
     3238        WebCore/websockets/WebSocket.h
    32443239
    32453240webcoregtk_sources += \
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r48121 r48137  
    889889                510D4A37103165EE0049EA54 /* SocketStreamHandleBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A31103165EE0049EA54 /* SocketStreamHandleBase.h */; };
    890890                510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */; };
    891                 510D4A4E103177A20049EA54 /* WebSocketChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510D4A47103177A20049EA54 /* WebSocketChannel.cpp */; };
    892                 510D4A4F103177A20049EA54 /* WebSocketChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A48103177A20049EA54 /* WebSocketChannel.h */; };
    893                 510D4A50103177A20049EA54 /* WebSocketChannelClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 510D4A49103177A20049EA54 /* WebSocketChannelClient.h */; };
    894891                5116D9770CF177BD00C2B84D /* DatabaseDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = 5116D9750CF177BD00C2B84D /* DatabaseDetails.h */; settings = {ATTRIBUTES = (Private, ); }; };
    895892                511F23170DC160DA004F0032 /* LocalStorageTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511F23130DC160DA004F0032 /* LocalStorageTask.cpp */; };
     
    978975                51ABAE1E103C1913008C5260 /* SocketStreamHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABAE1C103C1913008C5260 /* SocketStreamHandle.h */; };
    979976                51ABAE1F103C1913008C5260 /* SocketStreamHandleCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ABAE1D103C1913008C5260 /* SocketStreamHandleCFNet.cpp */; };
    980                 51ABAE2E103D4F75008C5260 /* WebSocketHandshaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ABAE2C103D4F75008C5260 /* WebSocketHandshaker.cpp */; };
    981                 51ABAE2F103D4F75008C5260 /* WebSocketHandshaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABAE2D103D4F75008C5260 /* WebSocketHandshaker.h */; };
    982                 51ABAE441043AB4A008C5260 /* WebSocketHandshake.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ABAE421043AB4A008C5260 /* WebSocketHandshake.cpp */; };
    983                 51ABAE451043AB4A008C5260 /* WebSocketHandshake.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABAE431043AB4A008C5260 /* WebSocketHandshake.h */; };
    984977                51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */; };
    985978                51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BE37DE0DAEE00E001085FC /* StorageArea.h */; };
     
    60336026                510D4A31103165EE0049EA54 /* SocketStreamHandleBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamHandleBase.h; sourceTree = "<group>"; };
    60346027                510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamHandleClient.h; sourceTree = "<group>"; };
    6035                 510D4A47103177A20049EA54 /* WebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketChannel.cpp; sourceTree = "<group>"; };
    6036                 510D4A48103177A20049EA54 /* WebSocketChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketChannel.h; sourceTree = "<group>"; };
    6037                 510D4A49103177A20049EA54 /* WebSocketChannelClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketChannelClient.h; sourceTree = "<group>"; };
    60386028                5116D9750CF177BD00C2B84D /* DatabaseDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseDetails.h; sourceTree = "<group>"; };
    60396029                511F23130DC160DA004F0032 /* LocalStorageTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorageTask.cpp; sourceTree = "<group>"; };
     
    61296119                51ABAE1C103C1913008C5260 /* SocketStreamHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocketStreamHandle.h; path = cf/SocketStreamHandle.h; sourceTree = "<group>"; };
    61306120                51ABAE1D103C1913008C5260 /* SocketStreamHandleCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocketStreamHandleCFNet.cpp; path = cf/SocketStreamHandleCFNet.cpp; sourceTree = "<group>"; };
    6131                 51ABAE2C103D4F75008C5260 /* WebSocketHandshaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshaker.cpp; sourceTree = "<group>"; };
    6132                 51ABAE2D103D4F75008C5260 /* WebSocketHandshaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshaker.h; sourceTree = "<group>"; };
    6133                 51ABAE421043AB4A008C5260 /* WebSocketHandshake.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshake.cpp; sourceTree = "<group>"; };
    6134                 51ABAE431043AB4A008C5260 /* WebSocketHandshake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshake.h; sourceTree = "<group>"; };
    61356121                51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyWebArchiveMac.mm; sourceTree = "<group>"; };
    61366122                51BE37DE0DAEE00E001085FC /* StorageArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageArea.h; sourceTree = "<group>"; };
     
    1058410570                        isa = PBXGroup;
    1058510571                        children = (
    10586                                 51ABAE421043AB4A008C5260 /* WebSocketHandshake.cpp */,
    10587                                 51ABAE431043AB4A008C5260 /* WebSocketHandshake.h */,
    10588                                 510D4A47103177A20049EA54 /* WebSocketChannel.cpp */,
    10589                                 510D4A48103177A20049EA54 /* WebSocketChannel.h */,
    10590                                 510D4A49103177A20049EA54 /* WebSocketChannelClient.h */,
    1059110572                                518A34BE1026C831001B6896 /* WebSocket.cpp */,
    1059210573                                518A34BF1026C831001B6896 /* WebSocket.h */,
     
    1757817559                                51ABAE1B103C18FF008C5260 /* SocketStreamError.h in Headers */,
    1757917560                                51ABAE1E103C1913008C5260 /* SocketStreamHandle.h in Headers */,
    17580                                 510D4A4F103177A20049EA54 /* WebSocketChannel.h in Headers */,
    17581                                 510D4A50103177A20049EA54 /* WebSocketChannelClient.h in Headers */,
    17582                                 51ABAE451043AB4A008C5260 /* WebSocketHandshake.h in Headers */,
    1758317561                        );
    1758417562                        runOnlyForDeploymentPostprocessing = 0;
     
    1967619654                                510D4A36103165EE0049EA54 /* SocketStreamHandleBase.cpp in Sources */,
    1967719655                                51ABAE1F103C1913008C5260 /* SocketStreamHandleCFNet.cpp in Sources */,
    19678                                 510D4A4E103177A20049EA54 /* WebSocketChannel.cpp in Sources */,
    19679                                 51ABAE441043AB4A008C5260 /* WebSocketHandshake.cpp in Sources */,
    1968019656                        );
    1968119657                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r48121 r48137  
    5555#include "JSWebKitCSSMatrixConstructor.h"
    5656#include "JSWebKitPointConstructor.h"
    57 #if ENABLE(WEB_SOCKETS)
    58 #include "JSWebSocketConstructor.h"
    59 #endif
    6057#include "JSWorkerConstructor.h"
    6158#include "JSXMLHttpRequestConstructor.h"
     
    650647#endif
    651648
    652 #if ENABLE(WEB_SOCKETS)
    653 JSValue JSDOMWindow::webSocket(ExecState* exec) const
    654 {
    655     return getDOMConstructor<JSWebSocketConstructor>(exec, this);
    656 }
    657 #endif
    658 
    659649// Custom functions
    660650
  • trunk/WebCore/bindings/js/JSEventTarget.cpp

    r48136 r48137  
    7979#endif
    8080
    81 #if ENABLE(WEB_SOCKETS)
    82 #include "JSWebSocket.h"
    83 #include "WebSocket.h"
    84 #endif
    85 
    8681using namespace JSC;
    8782
     
    145140#endif
    146141
    147 #if ENABLE(WEB_SOCKETS)
    148     if (WebSocket* webSocket = target->toWebSocket())
    149         return toJS(exec, webSocket);
    150 #endif
    151 
    152142    ASSERT_NOT_REACHED();
    153143    return jsNull();
     
    194184#endif
    195185
    196 #if ENABLE(WEB_SOCKETS)
    197     CONVERT_TO_EVENT_TARGET(WebSocket)
    198 #endif
    199 
    200186    return 0;
    201187}
  • trunk/WebCore/dom/EventTarget.cpp

    r48121 r48137  
    8484#endif
    8585
    86 #if ENABLE(WEB_SOCKETS)
    87 WebSocket* EventTarget::toWebSocket()
    88 {
    89     return 0;
    90 }
    91 #endif
    92 
    9386MessagePort* EventTarget::toMessagePort()
    9487{
  • trunk/WebCore/dom/EventTarget.h

    r48121 r48137  
    5252    class SharedWorker;
    5353    class SharedWorkerContext;
    54     class WebSocket;
    5554    class Worker;
    5655    class XMLHttpRequest;
     
    7776        virtual DedicatedWorkerContext* toDedicatedWorkerContext();
    7877#endif
     78
    7979#if ENABLE(SHARED_WORKERS)
    8080        virtual SharedWorker* toSharedWorker();
    8181        virtual SharedWorkerContext* toSharedWorkerContext();
    82 #endif
    83 #if ENABLE(WEB_SOCKETS)
    84         virtual WebSocket* toWebSocket();
    8582#endif
    8683
  • trunk/WebCore/page/DOMWindow.idl

    r48131 r48137  
    488488#endif
    489489
    490 #if defined(ENABLE_WEB_SOCKETS) && ENABLE_WEB_SOCKETS
    491         attribute [JSCCustomGetter] WebSocketConstructor WebSocket; // Usable with the new operator
    492 #endif
    493 
    494490        attribute PluginConstructor Plugin;
    495491        attribute PluginArrayConstructor PluginArray;
  • trunk/WebCore/websockets/WebSocket.cpp

    r48121 r48137  
    3535#include "WebSocket.h"
    3636
    37 #include "CString.h"
    38 #include "DOMWindow.h"
    3937#include "Event.h"
    4038#include "EventException.h"
    4139#include "EventListener.h"
    42 #include "EventNames.h"
    43 #include "Logging.h"
    44 #include "MessageEvent.h"
    45 #include "ScriptExecutionContext.h"
    46 #include "SecurityOrigin.h"
    47 #include "WebSocketChannel.h"
    4840#include <wtf/StdLibExtras.h>
    4941
    5042namespace WebCore {
    51 
    52 class ProcessWebSocketEventTask : public ScriptExecutionContext::Task {
    53 public:
    54     typedef void (WebSocket::*Method)(Event*);
    55     static PassRefPtr<ProcessWebSocketEventTask> create(PassRefPtr<WebSocket> webSocket, Method method, PassRefPtr<Event> event)
    56     {
    57         return adoptRef(new ProcessWebSocketEventTask(webSocket, method, event));
    58     }
    59     virtual void performTask(ScriptExecutionContext*)
    60     {
    61         (m_webSocket.get()->*m_method)(m_event.get());
    62     }
    63 
    64   private:
    65     ProcessWebSocketEventTask(PassRefPtr<WebSocket> webSocket, Method method, PassRefPtr<Event> event)
    66         : m_webSocket(webSocket)
    67         , m_method(method)
    68         , m_event(event) { }
    69 
    70     RefPtr<WebSocket> m_webSocket;
    71     Method m_method;
    72     RefPtr<Event> m_event;
    73 };
    74 
    75 static bool isValidProtocolString(const WebCore::String& protocol)
    76 {
    77     if (protocol.isNull())
    78         return true;
    79     if (protocol.isEmpty())
    80         return false;
    81     const UChar* characters = protocol.characters();
    82     for (size_t i = 0; i < protocol.length(); i++) {
    83         if (characters[i] < 0x21 || characters[i] > 0x7E)
    84             return false;
    85     }
    86     return true;
    87 }
    8843
    8944WebSocket::WebSocket(ScriptExecutionContext* context)
     
    10560void WebSocket::connect(const KURL& url, const String& protocol, ExceptionCode& ec)
    10661{
    107     LOG(Network, "WebSocket %p connect to %s protocol=%s", this, url.string().utf8().data(), protocol.utf8().data());
    10862    m_url = url;
    10963    m_protocol = protocol;
    11064
    11165    if (!m_url.protocolIs("ws") && !m_url.protocolIs("wss")) {
    112         LOG_ERROR("Error: wrong url for WebSocket %s", url.string().utf8().data());
    11366        m_state = CLOSED;
    11467        ec = SYNTAX_ERR;
    11568        return;
    11669    }
    117     if (!isValidProtocolString(m_protocol)) {
    118         LOG_ERROR("Error: wrong protocol for WebSocket %s", m_protocol.utf8().data());
     70    if (!m_protocol.isNull() && m_protocol.isEmpty()) {
    11971        m_state = CLOSED;
    12072        ec = SYNTAX_ERR;
    12173        return;
    12274    }
    123     // FIXME: if m_url.port() is blocking port, raise SECURITY_ERR.
    124 
    125     m_channel = WebSocketChannel::create(scriptExecutionContext(), this, m_url, m_protocol);
    126     m_channel->connect();
     75    // FIXME: Check protocol is valid form.
     76    // FIXME: Connect WebSocketChannel.
    12777}
    12878
    129 bool WebSocket::send(const String& message, ExceptionCode& ec)
     79bool WebSocket::send(const String&, ExceptionCode& ec)
    13080{
    131     LOG(Network, "WebSocket %p send %s", this, message.utf8().data());
    132     if (m_state == CONNECTING) {
     81    if (m_state != OPEN) {
    13382        ec = INVALID_STATE_ERR;
    13483        return false;
    13584    }
    136     // No exception is raised if the connection was once established but has subsequently been closed.
    137     if (m_state == CLOSED)
    138         return false;
    139     // FIXME: check message is valid utf8.
    140     return m_channel->send(message);
     85    // FIXME: send message on WebSocketChannel.
     86    return false;
    14187}
    14288
    14389void WebSocket::close()
    14490{
    145     LOG(Network, "WebSocket %p close", this);
    14691    if (m_state == CLOSED)
    14792        return;
    14893    m_state = CLOSED;
    149     m_channel->close();
     94    // FIXME: close WebSocketChannel.
    15095}
    15196
     
    162107unsigned long WebSocket::bufferedAmount() const
    163108{
    164     if (m_state == OPEN)
    165         return m_channel->bufferedAmount();
     109    // FIXME: ask platform code to get buffered amount to be sent.
    166110    return 0;
    167111}
     
    172116}
    173117
    174 void WebSocket::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> eventListener, bool)
     118void WebSocket::addEventListener(const AtomicString&, PassRefPtr<EventListener>, bool)
    175119{
    176     EventListenersMap::iterator iter = m_eventListeners.find(eventType);
    177     if (iter == m_eventListeners.end()) {
    178         ListenerVector listeners;
    179         listeners.append(eventListener);
    180         m_eventListeners.add(eventType, listeners);
    181     } else {
    182         ListenerVector& listeners = iter->second;
    183         for (ListenerVector::iterator listenerIter = listeners.begin(); listenerIter != listeners.end(); ++listenerIter)
    184             if (*listenerIter == eventListener)
    185                 return;
    186 
    187         listeners.append(eventListener);
    188         m_eventListeners.add(eventType, listeners);
    189     }
     120    // FIXME: implement this.
    190121}
    191122
    192 void WebSocket::removeEventListener(const AtomicString& eventType, EventListener* eventListener, bool)
     123void WebSocket::removeEventListener(const AtomicString&, EventListener*, bool)
    193124{
    194     EventListenersMap::iterator iter = m_eventListeners.find(eventType);
    195     if (iter == m_eventListeners.end())
    196         return;
    197 
    198     ListenerVector& listeners = iter->second;
    199     for (ListenerVector::const_iterator listenerIter = listeners.begin(); listenerIter != listeners.end(); ++listenerIter)
    200         if (*listenerIter == eventListener) {
    201             listeners.remove(listenerIter - listeners.begin());
    202             return;
    203         }
     125    // FIXME: implement this.
    204126}
    205127
    206 bool WebSocket::dispatchEvent(PassRefPtr<Event> evt, ExceptionCode& ec)
     128bool WebSocket::dispatchEvent(PassRefPtr<Event>, ExceptionCode&)
    207129{
    208     if (!evt || evt->type().isEmpty()) {
    209         ec = EventException::UNSPECIFIED_EVENT_TYPE_ERR;
    210         return true;
    211     }
    212 
    213     ListenerVector listenersCopy = m_eventListeners.get(evt->type());
    214     for (ListenerVector::const_iterator listenerIter = listenersCopy.begin(); listenerIter != listenersCopy.end(); ++listenerIter) {
    215         evt->setTarget(this);
    216         evt->setCurrentTarget(this);
    217         listenerIter->get()->handleEvent(evt.get(), false);
    218     }
    219     return !evt->defaultPrevented();
     130    // FIXME: implement this.
     131    return false;
    220132}
    221133
    222134void WebSocket::didConnect()
    223135{
    224     LOG(Network, "WebSocket %p didConnect", this);
    225136    if (m_state != CONNECTING) {
    226137        didClose();
     
    228139    }
    229140    m_state = OPEN;
    230     scriptExecutionContext()->postTask(ProcessWebSocketEventTask::create(this, &WebSocket::dispatchOpenEvent, Event::create(eventNames().openEvent, false, false)));
     141    dispatchOpenEvent();
    231142}
    232143
    233144void WebSocket::didReceiveMessage(const String& msg)
    234145{
    235     LOG(Network, "WebSocket %p didReceiveMessage %s", this, msg.utf8().data());
    236146    if (m_state != OPEN)
    237147        return;
    238     RefPtr<MessageEvent> evt = MessageEvent::create();
    239     // FIXME: origin, lastEventId, source, messagePort.
    240     evt->initMessageEvent(eventNames().messageEvent, false, false, msg, "", "", 0, 0);
    241     scriptExecutionContext()->postTask(ProcessWebSocketEventTask::create(this, &WebSocket::dispatchMessageEvent, evt));
     148    dispatchMessageEvent(msg);
    242149}
    243150
    244151void WebSocket::didClose()
    245152{
    246     LOG(Network, "WebSocket %p didClose", this);
    247153    m_state = CLOSED;
    248     scriptExecutionContext()->postTask(ProcessWebSocketEventTask::create(this, &WebSocket::dispatchCloseEvent, Event::create(eventNames().closeEvent, false, false)));
     154    dispatchCloseEvent();
    249155}
    250156
    251 void WebSocket::dispatchOpenEvent(Event* evt)
     157void WebSocket::dispatchOpenEvent()
    252158{
    253     if (m_onopen) {
    254         evt->setTarget(this);
    255         evt->setCurrentTarget(this);
    256         m_onopen->handleEvent(evt, false);
    257     }
    258 
    259     ExceptionCode ec = 0;
    260     dispatchEvent(evt, ec);
    261     ASSERT(!ec);
     159    // FIXME: implement this.
    262160}
    263161
    264 void WebSocket::dispatchMessageEvent(Event* evt)
     162void WebSocket::dispatchMessageEvent(const String&)
    265163{
    266     if (m_onmessage) {
    267         evt->setTarget(this);
    268         evt->setCurrentTarget(this);
    269         m_onmessage->handleEvent(evt, false);
    270     }
    271 
    272     ExceptionCode ec = 0;
    273     dispatchEvent(evt, ec);
    274     ASSERT(!ec);
     164    // FIXME: implement this.
    275165}
    276166
    277 void WebSocket::dispatchCloseEvent(Event* evt)
     167void WebSocket::dispatchCloseEvent()
    278168{
    279     if (m_onclose) {
    280         evt->setTarget(this);
    281         evt->setCurrentTarget(this);
    282         m_onclose->handleEvent(evt, false);
    283     }
    284 
    285     ExceptionCode ec = 0;
    286     dispatchEvent(evt, ec);
    287     ASSERT(!ec);
     169    // FIXME: implement this.
    288170}
    289171
  • trunk/WebCore/websockets/WebSocket.h

    r48121 r48137  
    3232#define WebSocket_h
    3333
    34 #if ENABLE(WEB_SOCKETS)
    35 
    3634#include "ActiveDOMObject.h"
    3735#include "AtomicStringHash.h"
     
    3937#include "EventTarget.h"
    4038#include "KURL.h"
    41 #include "WebSocketChannelClient.h"
    4239#include <wtf/OwnPtr.h>
    4340#include <wtf/RefCounted.h>
     
    4542namespace WebCore {
    4643
    47     class String;
    48     class WebSocketChannel;
     44class String;
    4945
    50     class WebSocket : public RefCounted<WebSocket>, public EventTarget, public ActiveDOMObject, public WebSocketChannelClient {
    51     public:
    52         static PassRefPtr<WebSocket> create(ScriptExecutionContext* context) { return adoptRef(new WebSocket(context)); }
    53         virtual ~WebSocket();
     46class WebSocket : public RefCounted<WebSocket>, public EventTarget, public ActiveDOMObject {
     47public:
     48    static PassRefPtr<WebSocket> create(ScriptExecutionContext* context) { return adoptRef(new WebSocket(context)); }
     49    virtual ~WebSocket();
    5450
    55         enum State {
    56             CONNECTING = 0,
    57             OPEN = 1,
    58             CLOSED = 2
    59         };
     51    enum State {
     52        CONNECTING = 0,
     53        OPEN = 1,
     54        CLOSED = 2
     55    };
    6056
    61         void connect(const KURL&, ExceptionCode&);
    62         void connect(const KURL&, const String& protocol, ExceptionCode&);
     57    void connect(const KURL& url, ExceptionCode&);
     58    void connect(const KURL& url, const String& protocol, ExceptionCode&);
    6359
    64         bool send(const String& message, ExceptionCode&);
     60    bool send(const String& message, ExceptionCode&);
    6561
    66         void close();
     62    void close();
    6763
    68         const KURL& url() const;
    69         State readyState() const;
    70         unsigned long bufferedAmount() const;
     64    const KURL& url() const;
     65    State readyState() const;
     66    unsigned long bufferedAmount() const;
    7167
    72         void setOnopen(PassRefPtr<EventListener> eventListener) { m_onopen = eventListener; }
    73         EventListener* onopen() const { return m_onopen.get(); }
    74         void setOnmessage(PassRefPtr<EventListener> eventListener) { m_onmessage = eventListener; }
    75         EventListener* onmessage() const { return m_onmessage.get(); }
    76         void setOnclose(PassRefPtr<EventListener> eventListener) { m_onclose = eventListener; }
    77         EventListener* onclose() const { return m_onclose.get(); }
     68    void setOnopen(PassRefPtr<EventListener> eventListener) { m_onopen = eventListener; }
     69    EventListener* onopen() const { return m_onopen.get(); }
     70    void setOnmessage(PassRefPtr<EventListener> eventListener) { m_onmessage = eventListener; }
     71    EventListener* onmessage() const { return m_onmessage.get(); }
     72    void setOnclose(PassRefPtr<EventListener> eventListener) { m_onclose = eventListener; }
     73    EventListener* onclose() const { return m_onclose.get(); }
    7874
    79         // EventTarget
    80         virtual WebSocket* toWebSocket() { return this; }
     75    // EventTarget
     76    virtual WebSocket* toWebSocket() { return this; }
    8177
    82         virtual ScriptExecutionContext* scriptExecutionContext() const;
     78    virtual ScriptExecutionContext* scriptExecutionContext() const;
    8379
    84         typedef Vector<RefPtr<EventListener> > ListenerVector;
    85         typedef HashMap<AtomicString, ListenerVector> EventListenersMap;
     80    virtual void addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
     81    virtual void removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture);
     82    virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&);
    8683
    87         virtual void addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
    88         virtual void removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture);
    89         virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&);
    90         EventListenersMap& eventListeners() { return m_eventListeners; }
     84    // ActiveDOMObject
     85    // virtual bool hasPendingActivity() const;
     86    // virtual void contextDestroyed();
     87    // virtual bool canSuspend() const;
     88    // virtual void suspend();
     89    // virtual void resume();
     90    // virtual void stop();
    9191
    92         // ActiveDOMObject
    93         //  virtual bool hasPendingActivity() const;
    94         // virtual void contextDestroyed();
    95         // virtual bool canSuspend() const;
    96         // virtual void suspend();
    97         // virtual void resume();
    98         // virtual void stop();
     92    using RefCounted<WebSocket>::ref;
     93    using RefCounted<WebSocket>::deref;
    9994
    100         using RefCounted<WebSocket>::ref;
    101         using RefCounted<WebSocket>::deref;
     95private:
     96    WebSocket(ScriptExecutionContext*);
    10297
    103         // WebSocketChannelClient
    104         virtual void didConnect();
    105         virtual void didReceiveMessage(const String& msg);
    106         virtual void didClose();
     98    virtual void refEventTarget() { ref(); }
     99    virtual void derefEventTarget() { deref(); }
    107100
    108     private:
    109         WebSocket(ScriptExecutionContext*);
     101    // WebSocketChannelClient
     102    void didConnect();
     103    void didReceiveMessage(const String& msg);
     104    void didClose();
    110105
    111         virtual void refEventTarget() { ref(); }
    112         virtual void derefEventTarget() { deref(); }
     106    void dispatchOpenEvent();
     107    void dispatchMessageEvent(const String& msg);
     108    void dispatchCloseEvent();
    113109
    114         void dispatchOpenEvent(Event*);
    115         void dispatchMessageEvent(Event*);
    116         void dispatchCloseEvent(Event*);
     110    // FIXME: add WebSocketChannel.
    117111
    118         RefPtr<WebSocketChannel> m_channel;
     112    RefPtr<EventListener> m_onopen;
     113    RefPtr<EventListener> m_onmessage;
     114    RefPtr<EventListener> m_onclose;
    119115
    120         RefPtr<EventListener> m_onopen;
    121         RefPtr<EventListener> m_onmessage;
    122         RefPtr<EventListener> m_onclose;
    123         EventListenersMap m_eventListeners;
    124 
    125         State m_state;
    126         KURL m_url;
    127         String m_protocol;
    128     };
     116    State m_state;
     117    KURL m_url;
     118    String m_protocol;
     119};
    129120
    130121}  // namespace WebCore
    131122
    132 #endif  // ENABLE(WEB_SOCKETS)
    133 
    134123#endif  // WebSocket_h
Note: See TracChangeset for help on using the changeset viewer.