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

Unified Diff: content/browser/devtools/protocol/network_handler.cc

Issue 2661583002: Check the existence of each properties of ResourceDevToolsInfo for NavigationPreload (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/network_handler.cc
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc
index 15ca6b6334d5cc076c362b4aeff51ed5f8f7d37e..56e37aca1e45ff2ad1940f7c63a11f79e417fc0b 100644
--- a/content/browser/devtools/protocol/network_handler.cc
+++ b/content/browser/devtools/protocol/network_handler.cc
@@ -631,12 +631,22 @@ void NetworkHandler::NavigationPreloadResponseReceived(
head.load_timing.request_start_time)
.Build());
if (head.devtools_info) {
- response->SetStatus(head.devtools_info->http_status_code);
- response->SetStatusText(head.devtools_info->http_status_text);
- response->SetRequestHeaders(
- getHeaders(head.devtools_info->request_headers));
- response->SetHeaders(getHeaders(head.devtools_info->response_headers));
- response->SetHeadersText(head.devtools_info->response_headers_text);
+ if (head.devtools_info->http_status_code) {
+ response->SetStatus(head.devtools_info->http_status_code);
+ response->SetStatusText(head.devtools_info->http_status_text);
+ }
+ if (head.devtools_info->request_headers.size()) {
+ response->SetRequestHeaders(
+ getHeaders(head.devtools_info->request_headers));
+ }
+ if (!head.devtools_info->request_headers_text.empty()) {
+ response->SetRequestHeadersText(
+ head.devtools_info->request_headers_text);
+ }
+ if (head.devtools_info->response_headers.size())
+ response->SetHeaders(getHeaders(head.devtools_info->response_headers));
+ if (!head.devtools_info->response_headers_text.empty())
+ response->SetHeadersText(head.devtools_info->response_headers_text);
}
response->SetProtocol(getProtocol(url, head));
response->SetRemoteIPAddress(head.socket_address.HostForURL());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698