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

Unified Diff: net/websockets/websocket_channel.cc

Issue 2003253002: [Devtools] Allow User-Agent header override for Websockets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests 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
« no previous file with comments | « net/websockets/websocket_channel.h ('k') | net/websockets/websocket_channel_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_channel.cc
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index 013b64a92ec8e53b80018ae767fb14474acf09f3..ba100ecea2a6e9e581322896132424008442e060 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -337,12 +337,11 @@ WebSocketChannel::~WebSocketChannel() {
void WebSocketChannel::SendAddChannelRequest(
const GURL& socket_url,
const std::vector<std::string>& requested_subprotocols,
- const url::Origin& origin) {
+ const url::Origin& origin,
+ const std::string& additional_headers) {
// Delegate to the tested version.
SendAddChannelRequestWithSuppliedCreator(
- socket_url,
- requested_subprotocols,
- origin,
+ socket_url, requested_subprotocols, origin, additional_headers,
base::Bind(&WebSocketStream::CreateAndConnectStream));
}
@@ -545,9 +544,10 @@ void WebSocketChannel::SendAddChannelRequestForTesting(
const GURL& socket_url,
const std::vector<std::string>& requested_subprotocols,
const url::Origin& origin,
+ const std::string& additional_headers,
const WebSocketStreamCreator& creator) {
- SendAddChannelRequestWithSuppliedCreator(
- socket_url, requested_subprotocols, origin, creator);
+ SendAddChannelRequestWithSuppliedCreator(socket_url, requested_subprotocols,
+ origin, additional_headers, creator);
}
void WebSocketChannel::SetClosingHandshakeTimeoutForTesting(
@@ -564,6 +564,7 @@ void WebSocketChannel::SendAddChannelRequestWithSuppliedCreator(
const GURL& socket_url,
const std::vector<std::string>& requested_subprotocols,
const url::Origin& origin,
+ const std::string& additional_headers,
const WebSocketStreamCreator& creator) {
DCHECK_EQ(FRESHLY_CONSTRUCTED, state_);
if (!socket_url.SchemeIsWSOrWSS()) {
@@ -577,8 +578,8 @@ void WebSocketChannel::SendAddChannelRequestWithSuppliedCreator(
std::unique_ptr<WebSocketStream::ConnectDelegate> connect_delegate(
new ConnectDelegate(this));
stream_request_ = creator.Run(socket_url_, requested_subprotocols, origin,
- url_request_context_, BoundNetLog(),
- std::move(connect_delegate));
+ additional_headers, url_request_context_,
+ BoundNetLog(), std::move(connect_delegate));
SetState(CONNECTING);
}
« no previous file with comments | « net/websockets/websocket_channel.h ('k') | net/websockets/websocket_channel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698