Skip to content
  • levin@chromium.org's avatar
    CrossThreadCopier needs to support ThreadSafeShared better. · 78e32a56
    levin@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=33698
    
    Reviewed by Oliver Hunt.
    
    JavaScriptCore:
    
    * wtf/TypeTraits.cpp: Added tests for the new type traits.
    * wtf/TypeTraits.h:
    (WTF::IsSubclass): Determines if a class is a derived from another class.
    (WTF::IsSubclassOfTemplate): Determines if a class is a derived from a
    template class (with one parameter that is unknown).
    (WTF::RemoveTemplate): Reveals the type for a template parameter.
    
    WebCore:
    
    Now the copier is able to handle types that derive from ThreadSafeShared.
    
    No change functionality so no new tests.
    
    * loader/WorkerThreadableLoader.cpp:
    (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel): Remove unnecessary cast.
    (WebCore::WorkerThreadableLoader::MainThreadBridge::clearClientWrapper): Ditto.
    * loader/WorkerThreadableLoader.h:
    Change to use the derived class instead of the ThreadSafeShared version.
    * platform/CrossThreadCopier.cpp:
    Add the new template parameter throughout the classes and adjust the class that
    handles ThreadSafeShared to allow for derived types.
    * platform/CrossThreadCopier.h:
    Add another template parameter to be able to detect classes that derive
    from ThreadSafeShared.
    * websockets/WorkerThreadableWebSocketChannel.cpp:
    Removed unnecessary casts and changed a type to use the derived class instead of
    the ThreadSafeShared version.
    (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
    (WebCore::workerContextDidSend):
    (WebCore::workerContextDidGetBufferedAmount):
    (WebCore::workerContextDidConnect):
    (WebCore::workerContextDidReceiveMessage):
    (WebCore::workerContextDidClose):
    (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
    (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
    (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
    (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
    (WebCore::WorkerThreadableWebSocketChannel::Bridge::clearClientWrapper):
    (WebCore::WorkerThreadableWebSocketChannel::Bridge::setMethodNotCompleted):
    (WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion):
    * websockets/WorkerThreadableWebSocketChannel.h:
    (WebCore::WorkerThreadableWebSocketChannel::Peer::create): Changed a type to use the
    derived class instead of the ThreadSafeShared version.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    78e32a56