Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(941)

Unified Diff: third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
index 1efba5fee647acf57d1614b59d32a4fd0f30b640..9a6b4eecc138c80a741f1eccf8ff1b6a310bc2fe 100644
--- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
+++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
@@ -39,10 +39,10 @@
#include "platform/v8_inspector/public/ConsoleTypes.h"
#include "wtf/Assertions.h"
#include "wtf/Forward.h"
+#include "wtf/OwnPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
-#include <memory>
#include <stdint.h>
namespace blink {
@@ -58,7 +58,7 @@ class WorkerLoaderProxy;
class WorkerWebSocketChannel final : public WebSocketChannel {
WTF_MAKE_NONCOPYABLE(WorkerWebSocketChannel);
public:
- static WebSocketChannel* create(WorkerGlobalScope& workerGlobalScope, WebSocketChannelClient* client, std::unique_ptr<SourceLocation> location)
+ static WebSocketChannel* create(WorkerGlobalScope& workerGlobalScope, WebSocketChannelClient* client, PassOwnPtr<SourceLocation> location)
{
return new WorkerWebSocketChannel(workerGlobalScope, client, std::move(location));
}
@@ -69,16 +69,16 @@ public:
void send(const CString&) override;
void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength) override;
void send(PassRefPtr<BlobDataHandle>) override;
- void sendTextAsCharVector(std::unique_ptr<Vector<char>>) override
+ void sendTextAsCharVector(PassOwnPtr<Vector<char>>) override
{
ASSERT_NOT_REACHED();
}
- void sendBinaryAsCharVector(std::unique_ptr<Vector<char>>) override
+ void sendBinaryAsCharVector(PassOwnPtr<Vector<char>>) override
{
ASSERT_NOT_REACHED();
}
void close(int code, const String& reason) override;
- void fail(const String& reason, MessageLevel, std::unique_ptr<SourceLocation>) override;
+ void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>) override;
void disconnect() override; // Will suppress didClose().
DECLARE_VIRTUAL_TRACE();
@@ -93,14 +93,14 @@ public:
~Peer() override;
// SourceLocation parameter may be shown when the connection fails.
- bool initialize(std::unique_ptr<SourceLocation>, ExecutionContext*);
+ bool initialize(PassOwnPtr<SourceLocation>, ExecutionContext*);
void connect(const KURL&, const String& protocol);
- void sendTextAsCharVector(std::unique_ptr<Vector<char>>);
- void sendBinaryAsCharVector(std::unique_ptr<Vector<char>>);
+ void sendTextAsCharVector(PassOwnPtr<Vector<char>>);
+ void sendBinaryAsCharVector(PassOwnPtr<Vector<char>>);
void sendBlob(PassRefPtr<BlobDataHandle>);
void close(int code, const String& reason);
- void fail(const String& reason, MessageLevel, std::unique_ptr<SourceLocation>);
+ void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>);
void disconnect();
DECLARE_VIRTUAL_TRACE();
@@ -110,7 +110,7 @@ public:
// WebSocketChannelClient functions.
void didConnect(const String& subprotocol, const String& extensions) override;
void didReceiveTextMessage(const String& payload) override;
- void didReceiveBinaryMessage(std::unique_ptr<Vector<char>>) override;
+ void didReceiveBinaryMessage(PassOwnPtr<Vector<char>>) override;
void didConsumeBufferedAmount(uint64_t) override;
void didStartClosingHandshake() override;
void didClose(ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) override;
@@ -133,16 +133,16 @@ public:
Bridge(WebSocketChannelClient*, WorkerGlobalScope&);
~Bridge();
// SourceLocation parameter may be shown when the connection fails.
- void initialize(std::unique_ptr<SourceLocation>);
+ void initialize(PassOwnPtr<SourceLocation>);
bool connect(const KURL&, const String& protocol);
void send(const CString& message);
void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength);
void send(PassRefPtr<BlobDataHandle>);
void close(int code, const String& reason);
- void fail(const String& reason, MessageLevel, std::unique_ptr<SourceLocation>);
+ void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>);
void disconnect();
- void createPeerOnMainThread(std::unique_ptr<SourceLocation>, WorkerThreadLifecycleContext*, ExecutionContext*);
+ void createPeerOnMainThread(PassOwnPtr<SourceLocation>, WorkerThreadLifecycleContext*, ExecutionContext*);
// Returns null when |disconnect| has already been called.
WebSocketChannelClient* client() { return m_client; }
@@ -163,10 +163,10 @@ public:
};
private:
- WorkerWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, std::unique_ptr<SourceLocation>);
+ WorkerWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, PassOwnPtr<SourceLocation>);
Member<Bridge> m_bridge;
- std::unique_ptr<SourceLocation> m_locationAtConnection;
+ OwnPtr<SourceLocation> m_locationAtConnection;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698