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

Unified Diff: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.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/DocumentWebSocketChannel.h
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
index 9b964e53965b26b00d16e457f35ac29141e3023f..ae65566583971701f5c7d1311dcf02fa8e0fca41 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
@@ -43,12 +43,13 @@
#include "public/platform/modules/websockets/WebSocketHandle.h"
#include "public/platform/modules/websockets/WebSocketHandleClient.h"
#include "wtf/Deque.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
-#include <memory>
#include <stdint.h>
namespace blink {
@@ -68,7 +69,7 @@ public:
// In the usual case, they are set automatically and you don't have to
// pass it.
// Specify handle explicitly only in tests.
- static DocumentWebSocketChannel* create(Document* document, WebSocketChannelClient* client, std::unique_ptr<SourceLocation> location, WebSocketHandle *handle = 0)
+ static DocumentWebSocketChannel* create(Document* document, WebSocketChannelClient* client, PassOwnPtr<SourceLocation> location, WebSocketHandle *handle = 0)
{
return new DocumentWebSocketChannel(document, client, std::move(location), handle);
}
@@ -79,12 +80,12 @@ public:
void send(const CString& message) override;
void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength) override;
void send(PassRefPtr<BlobDataHandle>) override;
- void sendTextAsCharVector(std::unique_ptr<Vector<char>> data) override;
- void sendBinaryAsCharVector(std::unique_ptr<Vector<char>> data) override;
+ void sendTextAsCharVector(PassOwnPtr<Vector<char>> data) override;
+ void sendBinaryAsCharVector(PassOwnPtr<Vector<char>> data) override;
// Start closing handshake. Use the CloseEventCodeNotSpecified for the code
// argument to omit payload.
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;
DECLARE_VIRTUAL_TRACE();
@@ -107,7 +108,7 @@ private:
Vector<char> data;
};
- DocumentWebSocketChannel(Document*, WebSocketChannelClient*, std::unique_ptr<SourceLocation>, WebSocketHandle*);
+ DocumentWebSocketChannel(Document*, WebSocketChannelClient*, PassOwnPtr<SourceLocation>, WebSocketHandle*);
void sendInternal(WebSocketHandle::MessageType, const char* data, size_t totalSize, uint64_t* consumedBufferedAmount);
void processSendQueue();
void flowControlIfNecessary();
@@ -132,7 +133,7 @@ private:
// m_handle is a handle of the connection.
// m_handle == 0 means this channel is closed.
- std::unique_ptr<WebSocketHandle> m_handle;
+ OwnPtr<WebSocketHandle> m_handle;
// m_client can be deleted while this channel is alive, but this class
// expects that disconnect() is called before the deletion.
@@ -149,7 +150,7 @@ private:
uint64_t m_receivedDataSizeForFlowControl;
size_t m_sentSizeOfTopMessage;
- std::unique_ptr<SourceLocation> m_locationAtConstruction;
+ OwnPtr<SourceLocation> m_locationAtConstruction;
RefPtr<WebSocketHandshakeRequest> m_handshakeRequest;
static const uint64_t receivedDataSizeForFlowControlHighWaterMark = 1 << 15;

Powered by Google App Engine
This is Rietveld 408576698