| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/loader/netlog_observer.h" | 5 #include "content/browser/loader/netlog_observer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // several http requests (e.g. see http://crbug.com/80157). | 95 // several http requests (e.g. see http://crbug.com/80157). |
| 96 info->request_headers.clear(); | 96 info->request_headers.clear(); |
| 97 | 97 |
| 98 for (net::HttpRequestHeaders::Iterator it(request_headers); | 98 for (net::HttpRequestHeaders::Iterator it(request_headers); |
| 99 it.GetNext();) { | 99 it.GetNext();) { |
| 100 info->request_headers.push_back(std::make_pair(it.name(), it.value())); | 100 info->request_headers.push_back(std::make_pair(it.name(), it.value())); |
| 101 } | 101 } |
| 102 info->request_headers_text = request_line + request_headers.ToString(); | 102 info->request_headers_text = request_line + request_headers.ToString(); |
| 103 break; | 103 break; |
| 104 } | 104 } |
| 105 case net::NetLogEventType::HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS: { | 105 case net::NetLogEventType::HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS: |
| 106 case net::NetLogEventType::HTTP_TRANSACTION_QUIC_SEND_REQUEST_HEADERS: { |
| 106 std::unique_ptr<base::Value> event_params(entry.ParametersToValue()); | 107 std::unique_ptr<base::Value> event_params(entry.ParametersToValue()); |
| 107 net::SpdyHeaderBlock request_headers; | 108 net::SpdyHeaderBlock request_headers; |
| 108 | 109 |
| 109 if (!net::SpdyHeaderBlockFromNetLogParam(event_params.get(), | 110 if (!net::SpdyHeaderBlockFromNetLogParam(event_params.get(), |
| 110 &request_headers)) { | 111 &request_headers)) { |
| 111 NOTREACHED(); | 112 NOTREACHED(); |
| 112 } | 113 } |
| 113 | 114 |
| 114 // We need to clear headers in case the same url_request is reused for | 115 // We need to clear headers in case the same url_request is reused for |
| 115 // several http requests (e.g. see http://crbug.com/80157). | 116 // several http requests (e.g. see http://crbug.com/80157). |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 204 |
| 204 uint32_t source_id = request->net_log().source().id; | 205 uint32_t source_id = request->net_log().source().id; |
| 205 NetLogObserver* dev_tools_net_log_observer = NetLogObserver::GetInstance(); | 206 NetLogObserver* dev_tools_net_log_observer = NetLogObserver::GetInstance(); |
| 206 if (dev_tools_net_log_observer == NULL) | 207 if (dev_tools_net_log_observer == NULL) |
| 207 return; | 208 return; |
| 208 response->head.devtools_info = | 209 response->head.devtools_info = |
| 209 dev_tools_net_log_observer->GetResourceInfo(source_id); | 210 dev_tools_net_log_observer->GetResourceInfo(source_id); |
| 210 } | 211 } |
| 211 | 212 |
| 212 } // namespace content | 213 } // namespace content |
| OLD | NEW |