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/devtools/devtools_netlog_observer.h" | 5 #include "content/browser/devtools/devtools_netlog_observer.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "content/browser/loader/resource_request_info_impl.h" | 9 #include "content/browser/loader/resource_request_info_impl.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 &request_headers)) { | 105 &request_headers)) { |
106 NOTREACHED(); | 106 NOTREACHED(); |
107 } | 107 } |
108 | 108 |
109 // We need to clear headers in case the same url_request is reused for | 109 // We need to clear headers in case the same url_request is reused for |
110 // several http requests (e.g. see http://crbug.com/80157). | 110 // several http requests (e.g. see http://crbug.com/80157). |
111 info->request_headers.clear(); | 111 info->request_headers.clear(); |
112 | 112 |
113 for (net::SpdyHeaderBlock::const_iterator it = request_headers.begin(); | 113 for (net::SpdyHeaderBlock::const_iterator it = request_headers.begin(); |
114 it != request_headers.end(); ++it) { | 114 it != request_headers.end(); ++it) { |
115 info->request_headers.push_back(std::make_pair(it->first, it->second)); | 115 info->request_headers.push_back( |
| 116 std::make_pair(it->first.as_string(), it->second.as_string())); |
116 } | 117 } |
117 info->request_headers_text = ""; | 118 info->request_headers_text = ""; |
118 break; | 119 break; |
119 } | 120 } |
120 case net::NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS: { | 121 case net::NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS: { |
121 scoped_ptr<base::Value> event_params(entry.ParametersToValue()); | 122 scoped_ptr<base::Value> event_params(entry.ParametersToValue()); |
122 | 123 |
123 scoped_refptr<net::HttpResponseHeaders> response_headers; | 124 scoped_refptr<net::HttpResponseHeaders> response_headers; |
124 | 125 |
125 if (!net::HttpResponseHeaders::FromNetLogParam(event_params.get(), | 126 if (!net::HttpResponseHeaders::FromNetLogParam(event_params.get(), |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 uint32 source_id = request->net_log().source().id; | 196 uint32 source_id = request->net_log().source().id; |
196 DevToolsNetLogObserver* dev_tools_net_log_observer = | 197 DevToolsNetLogObserver* dev_tools_net_log_observer = |
197 DevToolsNetLogObserver::GetInstance(); | 198 DevToolsNetLogObserver::GetInstance(); |
198 if (dev_tools_net_log_observer == NULL) | 199 if (dev_tools_net_log_observer == NULL) |
199 return; | 200 return; |
200 response->head.devtools_info = | 201 response->head.devtools_info = |
201 dev_tools_net_log_observer->GetResourceInfo(source_id); | 202 dev_tools_net_log_observer->GetResourceInfo(source_id); |
202 } | 203 } |
203 | 204 |
204 } // namespace content | 205 } // namespace content |
OLD | NEW |