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

Unified Diff: content/browser/renderer_host/websocket_host.cc

Issue 153843004: [WebSocket] Send (request|response)_headers_text to the inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | content/child/websocket_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/websocket_host.cc
diff --git a/content/browser/renderer_host/websocket_host.cc b/content/browser/renderer_host/websocket_host.cc
index f3cf28d2212b1eec54f3111ba875de3724137aa4..613db6c9b32d100d0063dad2e8b7c79d46538c2b 100644
--- a/content/browser/renderer_host/websocket_host.cc
+++ b/content/browser/renderer_host/websocket_host.cc
@@ -11,6 +11,7 @@
#include "ipc/ipc_message_macros.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
+#include "net/http/http_util.h"
#include "net/websockets/websocket_channel.h"
#include "net/websockets/websocket_event_interface.h"
#include "net/websockets/websocket_frame.h" // for WebSocketFrameHeader::OpCode
@@ -175,6 +176,11 @@ ChannelState WebSocketEventHandler::OnStartOpeningHandshake(
net::HttpRequestHeaders::Iterator it(request->headers);
while (it.GetNext())
request_to_pass.headers.push_back(std::make_pair(it.name(), it.value()));
+ request_to_pass.headers_text =
+ base::StringPrintf("GET %s HTTP/1.1\r\n",
+ request_to_pass.url.spec().c_str()) +
+ request->headers.ToString();
+
request_to_pass.request_time = request->request_time;
return StateCast(dispatcher_->SendStartOpeningHandshake(routing_id_,
request_to_pass));
@@ -192,6 +198,9 @@ ChannelState WebSocketEventHandler::OnFinishOpeningHandshake(
std::string name, value;
while (response->headers->EnumerateHeaderLines(&iter, &name, &value))
response_to_pass.headers.push_back(std::make_pair(name, value));
+ response_to_pass.headers_text =
+ net::HttpUtil::ConvertHeadersBackToHTTPResponse(
+ response->headers->raw_headers());
response_to_pass.response_time = response->response_time;
return StateCast(dispatcher_->SendFinishOpeningHandshake(routing_id_,
response_to_pass));
« no previous file with comments | « no previous file | content/child/websocket_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698