1. 21 Jun, 2009 1 commit
    • levin@chromium.org's avatar
      JavaScriptCore: · 3affb89e
      levin@chromium.org authored
      2009-06-21  Drew Wilson  <atwilson@google.com>
      
              Reviewed by David Levin.
      
              <https://bugs.webkit.org/show_bug.cgi?id=25043>
              Added support for multi-threaded MessagePorts.
      
              * wtf/MessageQueue.h:
              (WTF::::appendAndCheckEmpty):
                  Added API to test whether the queue was empty before adding an element.
      
      WebCore:
      
      2009-06-21  Drew Wilson  <atwilson@google.com>
      
              Reviewed by David Levin.
      
              <https://bugs.webkit.org/show_bug.cgi?id=25043>
              Removed obsolete MessagePort.startConversation(), active and onclose APIs.
      
              Refactored MessagePortProxy into MessagePortChannel and a platform-dependent PlatformMessagePortChannel
              implementation. Modified APIs to simplify cross-process implementations by moving the messaging code
              entirely into the platform-dependent proxy.
      
              Created a thread-safe default PlatformMessagePortChannel implementation.
      
              Changed DOMWindow messaging to create the MessageEvent in the target ScriptExecutionContext to match how
              cross-thread MessagePorts work.
      
              * GNUMakefile.am:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
                  Added MessagePortChannel/PlatformMessagePortChannel files.
              * bindings/js/JSMessagePortCustom.cpp:
              (WebCore::JSMessagePort::mark):
                  Changed ports to not mark their entangled pair as reachable, per the spec.
              * bindings/v8/custom/V8MessagePortCustom.cpp:
              * dom/MessageChannel.cpp:
              (WebCore::MessageChannel::MessageChannel):
                  Updated to use PlatformMessagePortChannel::createChannel() to entangle the ports.
              * dom/MessagePort.cpp:
              (WebCore::MessagePort::MessagePort):
              (WebCore::MessagePort::~MessagePort):
              (WebCore::MessagePort::postMessage):
              (WebCore::MessagePort::disentangle):
              (WebCore::MessagePort::messageAvailable):
              (WebCore::MessagePort::start):
              (WebCore::MessagePort::close):
              (WebCore::MessagePort::entangle):
              (WebCore::MessagePort::contextDestroyed):
              (WebCore::MessagePort::dispatchMessages):
              (WebCore::MessagePort::setOnmessage):
              (WebCore::MessagePort::hasPendingActivity):
                  Changed these APIs to delegate to new PlatformMessagePortChannel APIs.
              * dom/MessagePort.h:
                  Renamed isQueueOpen() to started().
              * dom/MessagePort.idl:
                  Removed startConversation and onclose.
              * dom/MessagePortProxy.h: Removed.
              * dom/MessagePortChannel.cpp: Added.
              (WebCore::MessagePortChannel::EventData::create):
              (WebCore::MessagePortChannel::EventData::EventData):
              (WebCore::MessagePortChannel::~MessagePortChannel):
              * dom/MessagePortChannel.h: Added.
              (WebCore::MessagePortChannel::EventData::message):
              (WebCore::MessagePortChannel::EventData::channel):
                  Changed EventData to hold a reference to a MessagePortChannel object instead of a MessagePort to enable cross-thread messaging.
              (WebCore::MessagePortChannel::MessagePortChannel):
              (WebCore::MessagePortChannel::create):
              * dom/ScriptExecutionContext.cpp:
              (WebCore:ScriptExecutionContext::dispatchMessagePortEvents):
                  Renamed isQueueOpen() to started().
              * dom/default/PlatformMessagePortChannel.cpp: Added.
              (WebCore::MessagePortChannel::entangleIfOpen):
              (WebCore::MessagePortChannel::disentangle):
              (WebCore::MessagePortChannel::postMessageToRemote):
              (WebCore::MessagePortChannel::tryGetMessageFromRemote):
              (WebCore::MessagePortChannel::close):
              (WebCore::MessagePortChannel::isConnectedTo):
              (WebCore::MessagePortChannel::hasPendingActivity):
              (WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel):
              (WebCore::PlatformMessagePortChannel::~PlatformMessagePortChannel):
              (WebCore::PlatformMessagePortChannel::createChannel):
              (WebCore::PlatformMessagePortChannel::entangleIfOpen):
              (WebCore::PlatformMessagePortChannel::disentangle):
              (WebCore::PlatformMessagePortChannel::setRemotePort):
              (WebCore::PlatformMessagePortChannel::remotePort):
              (WebCore::PlatformMessagePortChannel::entangledChannel):
              (WebCore::PlatformMessagePortChannel::setEntangledChannel):
              (WebCore::PlatformMessagePortChannel::postMessageToRemote):
              (WebCore::PlatformMessagePortChannel::tryGetMessageFromRemote):
              (WebCore::PlatformMessagePortChannel::isConnectedTo):
              (WebCore::PlatformMessagePortChannel::close):
              (WebCore::PlatformMessagePortChannel::closeInternal):
              (WebCore::PlatformMessagePortChannel::hasPendingActivity):
              * dom/default/PlatformMessagePortChannel.h: Added.
              (WebCore::PlatformMessagePortChannel::MessagePortQueue::create):
              (WebCore::PlatformMessagePortChannel::MessagePortQueue::tryGetMessage):
              (WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
              (WebCore::PlatformMessagePortChannel::MessagePortQueue::isEmpty):
              (WebCore::PlatformMessagePortChannel::MessagePortQueue::MessagePortQueue):
              * page/DOMWindow.cpp:
              (WebCore::PostMessageTimer::PostMessageTimer):
                  Changed DOMWindow messaging to create the MessageEvent in the target ScriptExecutionContext to match how cross-thread MessagePorts work.
              (WebCore::PostMessageTimer::event):
              (WebCore::DOMWindow::postMessage):
              (WebCore::DOMWindow::postMessageTimerFired):
      
      LayoutTests:
      
      2009-06-21  Drew Wilson  <atwilson@google.com>
      
              Reviewed by David Levin.
      
              <https://bugs.webkit.org/show_bug.cgi?id=25043>
              Updated MessageChannel/MessagePorts tests to reflect latest spec (close event has been removed).
              Added more tests of port cloning.
      
              * fast/events/message-channel-gc-2-expected.txt:
              * fast/events/message-channel-gc-2.html-disabled:
              * fast/events/message-channel-gc-3-expected.txt:
              * fast/events/message-channel-gc-3.html-disabled:
              * fast/events/message-channel-gc-expected.txt:
              * fast/events/message-channel-gc.html-disabled:
              * fast/events/message-port-clone-expected.txt: Added.
              * fast/events/message-port-clone.html-disabled: Added.
              * fast/events/message-port-expected.txt:
              * fast/events/message-port-no-wrapper-expected.txt: Added.
              * fast/events/message-port-onclose-expected.txt: Removed.
              * fast/events/message-port-onclose.html-disabled: Removed.
              * fast/events/message-port.html-disabled:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3affb89e
  2. 18 Nov, 2008 1 commit
    • ap@webkit.org's avatar
      Rubber-stamped by Darin Adler. · 2e143a89
      ap@webkit.org authored
              https://bugs.webkit.org/show_bug.cgi?id=22306
              Disable channel messaging support
      
      WebCore:
              * bindings/js/JSDOMWindowBase.cpp:
              (jsDOMWindowBaseMessageChannel):
              * page/DOMWindow.idl:
              Hide MesssagePort and MessageChannel global constructors. Due to the way MessageChannel
              constructor is added, it remains enumerable, but undefined.
      
      LayoutTests:
              * fast/events/message-port-no-wrapper.html-disabled: Added a test that I had in my tree.
      
              * fast/dom/Window/window-properties-expected.txt:
              * fast/dom/constructors-cached-expected.txt:
              * fast/dom/constructors-cached-navigate-expected.txt:
              * fast/js/global-constructors-expected.txt:
              Updated results.
      
              * fast/events/destroyed-atomic-string.html: Removed.
              * fast/events/destroyed-atomic-string.html-disabled: Copied from LayoutTests/fast/events/destroyed-atomic-string.html.
              * fast/events/message-channel-gc-2.html: Removed.
              * fast/events/message-channel-gc-2.html-disabled: Copied from LayoutTests/fast/events/message-channel-gc-2.html.
              * fast/events/message-channel-gc-3.html: Removed.
              * fast/events/message-channel-gc-3.html-disabled: Copied from LayoutTests/fast/events/message-channel-gc-3.html.
              * fast/events/message-channel-gc.html: Removed.
              * fast/events/message-channel-gc.html-disabled: Copied from LayoutTests/fast/events/message-channel-gc.html.
              * fast/events/message-channel-listener-circular-ownership.html: Removed.
              * fast/events/message-channel-listener-circular-ownership.html-disabled: Copied from LayoutTests/fast/events/message-channel-listener-circular-ownership.html.
              * fast/events/message-port-constructor-for-deleted-document.html: Removed.
              * fast/events/message-port-constructor-for-deleted-document.html-disabled: Copied from LayoutTests/fast/events/message-port-constructor-for-deleted-document.html.
              * fast/events/message-port-deleted-document.html: Removed.
              * fast/events/message-port-deleted-document.html-disabled: Copied from LayoutTests/fast/events/message-port-deleted-document.html.
              * fast/events/message-port-deleted-frame.html: Removed.
              * fast/events/message-port-deleted-frame.html-disabled: Copied from LayoutTests/fast/events/message-port-deleted-frame.html.
              * fast/events/message-port-inactive-document.html: Removed.
              * fast/events/message-port-inactive-document.html-disabled: Copied from LayoutTests/fast/events/message-port-inactive-document.html.
              * fast/events/message-port-onclose.html: Removed.
              * fast/events/message-port-onclose.html-disabled: Copied from LayoutTests/fast/events/message-port-onclose.html.
              * fast/events/message-port.html: Removed.
              * fast/events/message-port.html-disabled: Copied from LayoutTests/fast/events/message-port.html.
              * http/tests/security/MessagePort/event-listener-context.html: Removed.
              * http/tests/security/MessagePort/event-listener-context.html-disabled: Copied from LayoutTests/http/tests/security/MessagePort/event-listener-context.html.
              Disabled MessagePort tests.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2e143a89
  3. 22 Oct, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Darin Adler. · 4c610c0e
      ap@webkit.org authored
              Test: fast/events/message-channel-gc-3.html
      
              https://bugs.webkit.org/show_bug.cgi?id=21769
              MessagePort should be GC protected if there are messages to be delivered
      
              * dom/MessagePort.h: Removed pending activity count. Now we track if a close event is
              pending, and check if the queue is non-empty.
              (WebCore::MessagePort::workerContext): Added a stub implementation for a cross-heap GC bug
              fix (below).
      
              * dom/MessagePort.cpp:
              (WebCore::CloseMessagePortTimer::fired):
              (WebCore::MessagePort::MessagePort):
              (WebCore::MessagePort::queueCloseEvent):
              (WebCore::MessagePort::dispatchCloseEvent):
              (WebCore::MessagePort::hasPendingActivity):
              Track message and close event activity separately.
      
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::markCrossHeapDependentObjectsForDocument): Fixed a bug in cross-heap GC that was
              causing same-heap ports to never be deleted.
      
              * wtf/MessageQueue.h:
              (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue
              state, thus likely to cause race conditions.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4c610c0e