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

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

Issue 2004243002: Migrate websockets from url+lineNumber to SourceLocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@more-source-location-1
Patch Set: rebased Created 4 years, 7 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 8ab836e59c1ce1b32df332d1418926f6a9be96d8..ae65566583971701f5c7d1311dcf02fa8e0fca41 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
@@ -31,6 +31,7 @@
#ifndef DocumentWebSocketChannel_h
#define DocumentWebSocketChannel_h
+#include "bindings/core/v8/SourceLocation.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "core/fileapi/Blob.h"
#include "core/fileapi/FileError.h"
@@ -68,9 +69,9 @@ 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, const String& sourceURL = String(), unsigned lineNumber = 0, WebSocketHandle *handle = 0)
+ static DocumentWebSocketChannel* create(Document* document, WebSocketChannelClient* client, PassOwnPtr<SourceLocation> location, WebSocketHandle *handle = 0)
{
- return new DocumentWebSocketChannel(document, client, sourceURL, lineNumber, handle);
+ return new DocumentWebSocketChannel(document, client, std::move(location), handle);
}
~DocumentWebSocketChannel() override;
@@ -84,7 +85,7 @@ public:
// 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, const String&, unsigned lineNumber) override;
+ void fail(const String& reason, MessageLevel, PassOwnPtr<SourceLocation>) override;
void disconnect() override;
DECLARE_VIRTUAL_TRACE();
@@ -107,11 +108,11 @@ private:
Vector<char> data;
};
- DocumentWebSocketChannel(Document*, WebSocketChannelClient*, const String&, unsigned, WebSocketHandle*);
+ DocumentWebSocketChannel(Document*, WebSocketChannelClient*, PassOwnPtr<SourceLocation>, WebSocketHandle*);
void sendInternal(WebSocketHandle::MessageType, const char* data, size_t totalSize, uint64_t* consumedBufferedAmount);
void processSendQueue();
void flowControlIfNecessary();
- void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConstruction, m_lineNumberAtConstruction); }
+ void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_locationAtConstruction->clone()); }
void abortAsyncOperations();
void handleDidClose(bool wasClean, unsigned short code, const String& reason);
Document* document();
@@ -149,8 +150,7 @@ private:
uint64_t m_receivedDataSizeForFlowControl;
size_t m_sentSizeOfTopMessage;
- String m_sourceURLAtConstruction;
- unsigned m_lineNumberAtConstruction;
+ OwnPtr<SourceLocation> m_locationAtConstruction;
RefPtr<WebSocketHandshakeRequest> m_handshakeRequest;
static const uint64_t receivedDataSizeForFlowControlHighWaterMark = 1 << 15;

Powered by Google App Engine
This is Rietveld 408576698