2011-06-23 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2011 21:30:15 +0000 (21:30 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2011 21:30:15 +0000 (21:30 +0000)
        Reviewed by Ryosuke Niwa.

        RefPtr misused as argument type in a few classes
        https://bugs.webkit.org/show_bug.cgi?id=62955

        * dom/DataTransferItem.cpp:
        (WebCore::DataTransferItem::DataTransferItem):
        * dom/DataTransferItem.h:
        * dom/DataTransferItems.cpp:
        (WebCore::DataTransferItems::DataTransferItems):
        * dom/DataTransferItems.h:
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
        * editing/CompositeEditCommand.h:
        * page/WebKitAnimationList.cpp:
        (WebCore::WebKitAnimationList::append):
        (WebCore::WebKitAnimationList::insertAnimation):
        * page/WebKitAnimationList.h:
        * svg/graphics/filters/SVGFEImage.cpp:
        (WebCore::FEImage::FEImage):
        (WebCore::FEImage::create):
        * svg/graphics/filters/SVGFEImage.h:
        * svg/graphics/filters/SVGFilterBuilder.cpp:
        (WebCore::SVGFilterBuilder::SVGFilterBuilder):
        (WebCore::SVGFilterBuilder::add):
        (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
        * svg/graphics/filters/SVGFilterBuilder.h:
        * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
        (WebCore::ThreadableWebSocketChannelClientWrapper::didConnectCallback):
        (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback):
        (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
        (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
        * websockets/ThreadableWebSocketChannelClientWrapper.h:
        * websockets/WorkerThreadableWebSocketChannel.cpp:
        (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
        (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
        (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
        * websockets/WorkerThreadableWebSocketChannel.h:
        Use PassRefPtr or raw pointer as appropriate for RefPtr arguments.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89613 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/DataTransferItem.cpp
Source/WebCore/dom/DataTransferItem.h
Source/WebCore/dom/DataTransferItems.cpp
Source/WebCore/dom/DataTransferItems.h
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/CompositeEditCommand.h
Source/WebCore/page/WebKitAnimationList.cpp
Source/WebCore/page/WebKitAnimationList.h
Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
Source/WebCore/svg/graphics/filters/SVGFEImage.h
Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h
Source/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.cpp
Source/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h
Source/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
Source/WebCore/websockets/WorkerThreadableWebSocketChannel.h

index 495d829..5393c1e 100644 (file)
@@ -1,3 +1,45 @@
+2011-06-23  Darin Adler  <darin@apple.com>
+
+        Reviewed by Ryosuke Niwa.
+
+        RefPtr misused as argument type in a few classes
+        https://bugs.webkit.org/show_bug.cgi?id=62955
+
+        * dom/DataTransferItem.cpp:
+        (WebCore::DataTransferItem::DataTransferItem):
+        * dom/DataTransferItem.h:
+        * dom/DataTransferItems.cpp:
+        (WebCore::DataTransferItems::DataTransferItems):
+        * dom/DataTransferItems.h:
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
+        * editing/CompositeEditCommand.h:
+        * page/WebKitAnimationList.cpp:
+        (WebCore::WebKitAnimationList::append):
+        (WebCore::WebKitAnimationList::insertAnimation):
+        * page/WebKitAnimationList.h:
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImage::FEImage):
+        (WebCore::FEImage::create):
+        * svg/graphics/filters/SVGFEImage.h:
+        * svg/graphics/filters/SVGFilterBuilder.cpp:
+        (WebCore::SVGFilterBuilder::SVGFilterBuilder):
+        (WebCore::SVGFilterBuilder::add):
+        (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
+        * svg/graphics/filters/SVGFilterBuilder.h:
+        * websockets/ThreadableWebSocketChannelClientWrapper.cpp:
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didConnectCallback):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
+        * websockets/ThreadableWebSocketChannelClientWrapper.h:
+        * websockets/WorkerThreadableWebSocketChannel.cpp:
+        (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
+        (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel):
+        (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
+        * websockets/WorkerThreadableWebSocketChannel.h:
+        Use PassRefPtr or raw pointer as appropriate for RefPtr arguments.
+
 2011-06-23  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r89591 and r89593.
index 78731d7..6c73eb0 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
 const char DataTransferItem::kindString[] = "string";
 const char DataTransferItem::kindFile[] = "file";
 
-DataTransferItem::DataTransferItem(RefPtr<Clipboard> owner, const String& kind, const String& type)
+DataTransferItem::DataTransferItem(PassRefPtr<Clipboard> owner, const String& kind, const String& type)
     : m_owner(owner)
     , m_kind(kind)
     , m_type(type)
index 71e3b18..74c25b7 100644 (file)
@@ -60,7 +60,7 @@ public:
     virtual PassRefPtr<Blob> getAsFile() = 0;
 
 protected:
-    DataTransferItem(RefPtr<Clipboard> owner, const String& kind, const String& type);
+    DataTransferItem(PassRefPtr<Clipboard> owner, const String& kind, const String& type);
     Clipboard* owner();
 
 private:
index 40e923f..b00223c 100644 (file)
@@ -39,7 +39,7 @@
 
 namespace WebCore {
 
-DataTransferItems::DataTransferItems(RefPtr<Clipboard> clipboard, ScriptExecutionContext* context)
+DataTransferItems::DataTransferItems(PassRefPtr<Clipboard> clipboard, ScriptExecutionContext* context)
     : m_owner(clipboard)
     , m_context(context)
 {
index ec77a36..a76c949 100644 (file)
@@ -54,7 +54,7 @@ public:
     virtual void add(const String& data, const String& type, ExceptionCode&);
 
 protected:
-    DataTransferItems(RefPtr<Clipboard>, ScriptExecutionContext*);
+    DataTransferItems(PassRefPtr<Clipboard>, ScriptExecutionContext*);
 
 protected:
     RefPtr<Clipboard> m_owner;
index d07d40a..87b2ff7 100644 (file)
@@ -474,8 +474,10 @@ void CompositeEditCommand::rebalanceWhitespaceAt(const Position& position)
     rebalanceWhitespaceOnTextSubstring(static_cast<Text*>(node), position.offsetInContainerNode(), position.offsetInContainerNode());
 }
 
-void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(RefPtr<Text> textNode, int startOffset, int endOffset)
+void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(PassRefPtr<Text> prpTextNode, int startOffset, int endOffset)
 {
+    RefPtr<Text> textNode = prpTextNode;
+
     String text = textNode->data();
     ASSERT(!text.isEmpty());
 
@@ -503,7 +505,7 @@ void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(RefPtr<Text> textN
                                                              isEndOfParagraph(visibleDownstreamPos) || (unsigned)downstream == text.length());
     
     if (string != rebalancedString)
-        replaceTextInNodePreservingMarkers(textNode, upstream, length, rebalancedString);
+        replaceTextInNodePreservingMarkers(textNode.release(), upstream, length, rebalancedString);
 }
 
 void CompositeEditCommand::prepareWhitespaceAtPositionForSplit(Position& position)
index cdb7769..6342eef 100644 (file)
@@ -69,7 +69,7 @@ protected:
     void mergeIdenticalElements(PassRefPtr<Element>, PassRefPtr<Element>);
     void rebalanceWhitespace();
     void rebalanceWhitespaceAt(const Position&);
-    void rebalanceWhitespaceOnTextSubstring(RefPtr<Text>, int startOffset, int endOffset);
+    void rebalanceWhitespaceOnTextSubstring(PassRefPtr<Text>, int startOffset, int endOffset);
     void prepareWhitespaceAtPositionForSplit(Position&);
     bool canRebalance(const Position&) const;
     bool shouldRebalanceLeadingWhitespaceFor(const String&) const;
index 31e46d7..3acfa4c 100644 (file)
@@ -26,9 +26,6 @@
 #include "config.h"
 #include "WebKitAnimationList.h"
 
-#include "Animation.h"
-#include "AnimationBase.h"
-#include "RenderStyle.h"
 #include "WebKitAnimation.h"
 
 namespace WebCore {
@@ -61,12 +58,12 @@ void WebKitAnimationList::deleteAnimation(unsigned index)
     m_animations.remove(index);
 }
 
-void WebKitAnimationList::append(RefPtr<WebKitAnimation> animation)
+void WebKitAnimationList::append(PassRefPtr<WebKitAnimation> animation)
 {
     m_animations.append(animation);
 }
 
-unsigned WebKitAnimationList::insertAnimation(RefPtr<WebKitAnimation> animation, unsigned index)
+unsigned WebKitAnimationList::insertAnimation(PassRefPtr<WebKitAnimation> animation, unsigned index)
 {
     if (!animation)
         return 0;
@@ -79,4 +76,3 @@ unsigned WebKitAnimationList::insertAnimation(RefPtr<WebKitAnimation> animation,
 }
 
 } // namespace WebCore
-
index b82e38a..58df2c0 100644 (file)
@@ -39,16 +39,16 @@ class WebKitAnimationList : public RefCounted<WebKitAnimationList> {
 public:
     static PassRefPtr<WebKitAnimationList> create()
     {
-        return adoptRef(new WebKitAnimationList());
+        return adoptRef(new WebKitAnimationList);
     }
     ~WebKitAnimationList();
 
     unsigned length() const;
     WebKitAnimation* item(unsigned index);
 
-    unsigned insertAnimation(RefPtr<WebKitAnimation>, unsigned index);
+    unsigned insertAnimation(PassRefPtr<WebKitAnimation>, unsigned index);
     void deleteAnimation(unsigned index);
-    void append(RefPtr<WebKitAnimation>);
+    void append(PassRefPtr<WebKitAnimation>);
 
 private:
     WebKitAnimationList();
index d6d6f99..9e7cd7f 100644 (file)
 
 namespace WebCore {
 
-FEImage::FEImage(Filter* filter, RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
+FEImage::FEImage(Filter* filter, PassRefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
     : FilterEffect(filter)
     , m_image(image)
     , m_preserveAspectRatio(preserveAspectRatio)
 {
 }
 
-PassRefPtr<FEImage> FEImage::create(Filter* filter, RefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
+PassRefPtr<FEImage> FEImage::create(Filter* filter, PassRefPtr<Image> image, const SVGPreserveAspectRatio& preserveAspectRatio)
 {
     return adoptRef(new FEImage(filter, image, preserveAspectRatio));
 }
index a5383cc..6e9c6e6 100644 (file)
@@ -33,7 +33,7 @@ class Image;
 
 class FEImage : public FilterEffect {
 public:
-    static PassRefPtr<FEImage> create(Filter*, RefPtr<Image>, const SVGPreserveAspectRatio&);
+    static PassRefPtr<FEImage> create(Filter*, PassRefPtr<Image>, const SVGPreserveAspectRatio&);
 
     void setAbsoluteSubregion(const FloatRect& absoluteSubregion) { m_absoluteSubregion = absoluteSubregion; }
 
@@ -47,7 +47,7 @@ public:
     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
     
 private:
-    FEImage(Filter*, RefPtr<Image>, const SVGPreserveAspectRatio&);
+    FEImage(Filter*, PassRefPtr<Image>, const SVGPreserveAspectRatio&);
 
     RefPtr<Image> m_image;
     SVGPreserveAspectRatio m_preserveAspectRatio;
index e6d0e65..605cc74 100644 (file)
 namespace WebCore {
 
 SVGFilterBuilder::SVGFilterBuilder(Filter* filter)
-    : m_lastEffect(0)
 {
     m_builtinEffects.add(SourceGraphic::effectName(), SourceGraphic::create(filter));
     m_builtinEffects.add(SourceAlpha::effectName(), SourceAlpha::create(filter));
     addBuiltinEffects();
 }
 
-void SVGFilterBuilder::add(const AtomicString& id, RefPtr<FilterEffect> effect)
+void SVGFilterBuilder::add(const AtomicString& id, PassRefPtr<FilterEffect> effect)
 {
     if (id.isEmpty()) {
         m_lastEffect = effect;
@@ -68,20 +67,21 @@ FilterEffect* SVGFilterBuilder::getEffectById(const AtomicString& id) const
     return m_namedEffects.get(id).get();
 }
 
-void SVGFilterBuilder::appendEffectToEffectReferences(RefPtr<FilterEffect> effectReference, RenderObject* object)
+void SVGFilterBuilder::appendEffectToEffectReferences(PassRefPtr<FilterEffect> prpEffect, RenderObject* object)
 {
+    RefPtr<FilterEffect> effect = prpEffect;
+
     // The effect must be a newly created filter effect.
-    ASSERT(!m_effectReferences.contains(effectReference));
+    ASSERT(!m_effectReferences.contains(effect));
     ASSERT(object && !m_effectRenderer.contains(object));
-    m_effectReferences.add(effectReference, FilterEffectSet());
+    m_effectReferences.add(effect, FilterEffectSet());
 
-    FilterEffect* effect = effectReference.get();
     unsigned numberOfInputEffects = effect->inputEffects().size();
 
     // It is not possible to add the same value to a set twice.
     for (unsigned i = 0; i < numberOfInputEffects; ++i)
-        effectReferences(effect->inputEffect(i)).add(effect);
-    m_effectRenderer.add(object, effectReference.get());
+        effectReferences(effect->inputEffect(i)).add(effect.get());
+    m_effectRenderer.add(object, effect.get());
 }
 
 void SVGFilterBuilder::clearEffects()
index 9e7b2fe..713241c 100644 (file)
@@ -39,12 +39,12 @@ public:
 
     static PassRefPtr<SVGFilterBuilder> create(Filter* filter) { return adoptRef(new SVGFilterBuilder(filter)); }
 
-    void add(const AtomicString& id, RefPtr<FilterEffect> effect);
+    void add(const AtomicString& id, PassRefPtr<FilterEffect>);
 
     FilterEffect* getEffectById(const AtomicString& id) const;
     FilterEffect* lastEffect() const { return m_lastEffect.get(); }
 
-    void appendEffectToEffectReferences(RefPtr<FilterEffect>, RenderObject*);
+    void appendEffectToEffectReferences(PassRefPtr<FilterEffect>, RenderObject*);
 
     inline FilterEffectSet& effectReferences(FilterEffect* effect)
     {
index 0db25a7..2d68279 100644 (file)
@@ -144,28 +144,28 @@ void ThreadableWebSocketChannelClientWrapper::processPendingTasks()
         (*iter)->performTask(0);
 }
 
-void ThreadableWebSocketChannelClientWrapper::didConnectCallback(ScriptExecutionContext* context, RefPtr<ThreadableWebSocketChannelClientWrapper> wrapper)
+void ThreadableWebSocketChannelClientWrapper::didConnectCallback(ScriptExecutionContext* context, ThreadableWebSocketChannelClientWrapper* wrapper)
 {
     ASSERT_UNUSED(context, !context);
     if (wrapper->m_client)
         wrapper->m_client->didConnect();
 }
 
-void ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback(ScriptExecutionContext* context, RefPtr<ThreadableWebSocketChannelClientWrapper> wrapper, String message)
+void ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback(ScriptExecutionContext* context, ThreadableWebSocketChannelClientWrapper* wrapper, String message)
 {
     ASSERT_UNUSED(context, !context);
     if (wrapper->m_client)
         wrapper->m_client->didReceiveMessage(message);
 }
 
-void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback(ScriptExecutionContext* context, RefPtr<ThreadableWebSocketChannelClientWrapper> wrapper)
+void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback(ScriptExecutionContext* context, ThreadableWebSocketChannelClientWrapper* wrapper)
 {
     ASSERT_UNUSED(context, !context);
     if (wrapper->m_client)
         wrapper->m_client->didStartClosingHandshake();
 }
 
-void ThreadableWebSocketChannelClientWrapper::didCloseCallback(ScriptExecutionContext* context, RefPtr<ThreadableWebSocketChannelClientWrapper> wrapper, unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus closingHandshakeCompletion)
+void ThreadableWebSocketChannelClientWrapper::didCloseCallback(ScriptExecutionContext* context, ThreadableWebSocketChannelClientWrapper* wrapper, unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus closingHandshakeCompletion)
 {
     ASSERT_UNUSED(context, !context);
     if (wrapper->m_client)
index fa5f9ac..b2b4bb2 100644 (file)
@@ -73,10 +73,10 @@ protected:
     ThreadableWebSocketChannelClientWrapper(WebSocketChannelClient*);
 
     void processPendingTasks();
-    static void didConnectCallback(ScriptExecutionContext*, RefPtr<ThreadableWebSocketChannelClientWrapper>);
-    static void didReceiveMessageCallback(ScriptExecutionContext*, RefPtr<ThreadableWebSocketChannelClientWrapper>, String message);
-    static void didStartClosingHandshakeCallback(ScriptExecutionContext*, RefPtr<ThreadableWebSocketChannelClientWrapper>);
-    static void didCloseCallback(ScriptExecutionContext*, RefPtr<ThreadableWebSocketChannelClientWrapper>, unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus);
+    static void didConnectCallback(ScriptExecutionContext*, ThreadableWebSocketChannelClientWrapper*);
+    static void didReceiveMessageCallback(ScriptExecutionContext*, ThreadableWebSocketChannelClientWrapper*, String message);
+    static void didStartClosingHandshakeCallback(ScriptExecutionContext*, ThreadableWebSocketChannelClientWrapper*);
+    static void didCloseCallback(ScriptExecutionContext*, ThreadableWebSocketChannelClientWrapper*, unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus);
 
     WebSocketChannelClient* m_client;
     bool m_syncMethodDone;
index 0026851..c0e4606 100644 (file)
@@ -114,7 +114,7 @@ void WorkerThreadableWebSocketChannel::resume()
         m_bridge->resume();
 }
 
-WorkerThreadableWebSocketChannel::Peer::Peer(RefPtr<ThreadableWebSocketChannelClientWrapper> clientWrapper, WorkerLoaderProxy& loaderProxy, ScriptExecutionContext* context, const String& taskMode, const KURL& url, const String& protocol)
+WorkerThreadableWebSocketChannel::Peer::Peer(PassRefPtr<ThreadableWebSocketChannelClientWrapper> clientWrapper, WorkerLoaderProxy& loaderProxy, ScriptExecutionContext* context, const String& taskMode, const KURL& url, const String& protocol)
     : m_workerClientWrapper(clientWrapper)
     , m_loaderProxy(loaderProxy)
     , m_mainWebSocketChannel(WebSocketChannel::create(context, this, url, protocol))
@@ -258,18 +258,20 @@ void WorkerThreadableWebSocketChannel::Peer::didClose(unsigned long unhandledBuf
     m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidClose, m_workerClientWrapper, unhandledBufferedAmount, closingHandshakeCompletion), m_taskMode);
 }
 
-void WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel(ScriptExecutionContext* context, Bridge* thisPtr, Peer* peer, RefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper)
+void WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel(ScriptExecutionContext* context, Bridge* thisPtr, Peer* peer, PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper)
 {
     ASSERT_UNUSED(context, context->isWorkerContext());
     thisPtr->m_peer = peer;
     workerClientWrapper->setSyncMethodDone();
 }
 
-void WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel(ScriptExecutionContext* context, Bridge* thisPtr, RefPtr<ThreadableWebSocketChannelClientWrapper> clientWrapper, const String& taskMode, const KURL& url, const String& protocol)
+void WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel(ScriptExecutionContext* context, Bridge* thisPtr, PassRefPtr<ThreadableWebSocketChannelClientWrapper> prpClientWrapper, const String& taskMode, const KURL& url, const String& protocol)
 {
     ASSERT(isMainThread());
     ASSERT_UNUSED(context, context->isDocument());
 
+    RefPtr<ThreadableWebSocketChannelClientWrapper> clientWrapper = prpClientWrapper;
+
     Peer* peer = Peer::create(clientWrapper, thisPtr->m_loaderProxy, context, taskMode, url, protocol);
     thisPtr->m_loaderProxy.postTaskForModeToWorkerContext(
         createCallbackTask(&Bridge::setWebSocketChannel,
index 8fdd4b9..0de292e 100644 (file)
@@ -82,7 +82,7 @@ private:
     class Peer : public WebSocketChannelClient {
         WTF_MAKE_NONCOPYABLE(Peer); WTF_MAKE_FAST_ALLOCATED;
     public:
-        static Peer* create(RefPtr<ThreadableWebSocketChannelClientWrapper> clientWrapper, WorkerLoaderProxy& loaderProxy, ScriptExecutionContext* context, const String& taskMode, const KURL& url, const String& protocol)
+        static Peer* create(PassRefPtr<ThreadableWebSocketChannelClientWrapper> clientWrapper, WorkerLoaderProxy& loaderProxy, ScriptExecutionContext* context, const String& taskMode, const KURL& url, const String& protocol)
         {
             return new Peer(clientWrapper, loaderProxy, context, taskMode, url, protocol);
         }
@@ -103,7 +103,7 @@ private:
         virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus);
 
     private:
-        Peer(RefPtr<ThreadableWebSocketChannelClientWrapper>, WorkerLoaderProxy&, ScriptExecutionContext*, const String& taskMode, const KURL&, const String& protocol);
+        Peer(PassRefPtr<ThreadableWebSocketChannelClientWrapper>, WorkerLoaderProxy&, ScriptExecutionContext*, const String& taskMode, const KURL&, const String& protocol);
 
         RefPtr<ThreadableWebSocketChannelClientWrapper> m_workerClientWrapper;
         WorkerLoaderProxy& m_loaderProxy;
@@ -134,10 +134,10 @@ private:
     private:
         Bridge(PassRefPtr<ThreadableWebSocketChannelClientWrapper>, PassRefPtr<WorkerContext>, const String& taskMode, const KURL&, const String& protocol);
 
-        static void setWebSocketChannel(ScriptExecutionContext*, Bridge* thisPtr, Peer*, RefPtr<ThreadableWebSocketChannelClientWrapper>);
+        static void setWebSocketChannel(ScriptExecutionContext*, Bridge* thisPtr, Peer*, PassRefPtr<ThreadableWebSocketChannelClientWrapper>);
 
         // Executed on the main thread to create a Peer for this bridge.
-        static void mainThreadCreateWebSocketChannel(ScriptExecutionContext*, Bridge* thisPtr, RefPtr<ThreadableWebSocketChannelClientWrapper>, const String& taskMode, const KURL&, const String& protocol);
+        static void mainThreadCreateWebSocketChannel(ScriptExecutionContext*, Bridge* thisPtr, PassRefPtr<ThreadableWebSocketChannelClientWrapper>, const String& taskMode, const KURL&, const String& protocol);
 
         // Executed on the worker context's thread.
         void clearClientWrapper();