OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 double status; | 235 double status; |
236 String statusText; | 236 String statusText; |
237 if (response.resourceLoadInfo() && response.resourceLoadInfo()->httpStatusCo
de) { | 237 if (response.resourceLoadInfo() && response.resourceLoadInfo()->httpStatusCo
de) { |
238 status = response.resourceLoadInfo()->httpStatusCode; | 238 status = response.resourceLoadInfo()->httpStatusCode; |
239 statusText = response.resourceLoadInfo()->httpStatusText; | 239 statusText = response.resourceLoadInfo()->httpStatusText; |
240 } else { | 240 } else { |
241 status = response.httpStatusCode(); | 241 status = response.httpStatusCode(); |
242 statusText = response.httpStatusText(); | 242 statusText = response.httpStatusText(); |
243 } | 243 } |
244 RefPtr<JSONObject> headers; | 244 RefPtr<JSONObject> headers; |
245 if (response.resourceLoadInfo()) | 245 if (response.resourceLoadInfo() && response.resourceLoadInfo()->responseHead
ers.size()) |
246 headers = buildObjectForHeaders(response.resourceLoadInfo()->responseHea
ders); | 246 headers = buildObjectForHeaders(response.resourceLoadInfo()->responseHea
ders); |
247 else | 247 else |
248 headers = buildObjectForHeaders(response.httpHeaderFields()); | 248 headers = buildObjectForHeaders(response.httpHeaderFields()); |
249 | 249 |
250 int64_t encodedDataLength = response.resourceLoadInfo() ? response.resourceL
oadInfo()->encodedDataLength : -1; | 250 int64_t encodedDataLength = response.resourceLoadInfo() ? response.resourceL
oadInfo()->encodedDataLength : -1; |
251 | 251 |
252 RefPtr<TypeBuilder::Network::Response> responseObject = TypeBuilder::Network
::Response::create() | 252 RefPtr<TypeBuilder::Network::Response> responseObject = TypeBuilder::Network
::Response::create() |
253 .setUrl(urlWithoutFragment(response.url()).string()) | 253 .setUrl(urlWithoutFragment(response.url()).string()) |
254 .setStatus(status) | 254 .setStatus(status) |
255 .setStatusText(statusText) | 255 .setStatusText(statusText) |
256 .setHeaders(headers) | 256 .setHeaders(headers) |
257 .setMimeType(response.mimeType()) | 257 .setMimeType(response.mimeType()) |
258 .setConnectionReused(response.connectionReused()) | 258 .setConnectionReused(response.connectionReused()) |
259 .setConnectionId(response.connectionID()) | 259 .setConnectionId(response.connectionID()) |
260 .setEncodedDataLength(encodedDataLength); | 260 .setEncodedDataLength(encodedDataLength); |
261 | 261 |
262 responseObject->setFromDiskCache(response.wasCached()); | 262 responseObject->setFromDiskCache(response.wasCached()); |
263 if (response.resourceLoadTiming()) | 263 if (response.resourceLoadTiming()) |
264 responseObject->setTiming(buildObjectForTiming(*response.resourceLoadTim
ing(), loader)); | 264 responseObject->setTiming(buildObjectForTiming(*response.resourceLoadTim
ing(), loader)); |
265 | 265 |
266 if (response.resourceLoadInfo()) { | 266 if (response.resourceLoadInfo()) { |
267 if (!response.resourceLoadInfo()->responseHeadersText.isEmpty()) | 267 if (!response.resourceLoadInfo()->responseHeadersText.isEmpty()) |
268 responseObject->setHeadersText(response.resourceLoadInfo()->response
HeadersText); | 268 responseObject->setHeadersText(response.resourceLoadInfo()->response
HeadersText); |
269 | 269 if (response.resourceLoadInfo()->requestHeaders.size()) |
270 responseObject->setRequestHeaders(buildObjectForHeaders(response.resourc
eLoadInfo()->requestHeaders)); | 270 responseObject->setRequestHeaders(buildObjectForHeaders(response.res
ourceLoadInfo()->requestHeaders)); |
271 if (!response.resourceLoadInfo()->requestHeadersText.isEmpty()) | 271 if (!response.resourceLoadInfo()->requestHeadersText.isEmpty()) |
272 responseObject->setRequestHeadersText(response.resourceLoadInfo()->r
equestHeadersText); | 272 responseObject->setRequestHeadersText(response.resourceLoadInfo()->r
equestHeadersText); |
273 } | 273 } |
274 | 274 |
275 AtomicString remoteIPAddress = response.remoteIPAddress(); | 275 AtomicString remoteIPAddress = response.remoteIPAddress(); |
276 if (!remoteIPAddress.isEmpty()) { | 276 if (!remoteIPAddress.isEmpty()) { |
277 responseObject->setRemoteIPAddress(remoteIPAddress); | 277 responseObject->setRemoteIPAddress(remoteIPAddress); |
278 responseObject->setRemotePort(response.remotePort()); | 278 responseObject->setRemotePort(response.remotePort()); |
279 } | 279 } |
280 | 280 |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 InspectorResourceAgent::InspectorResourceAgent(InspectorPageAgent* pageAgent) | 812 InspectorResourceAgent::InspectorResourceAgent(InspectorPageAgent* pageAgent) |
813 : InspectorBaseAgent<InspectorResourceAgent>("Network") | 813 : InspectorBaseAgent<InspectorResourceAgent>("Network") |
814 , m_pageAgent(pageAgent) | 814 , m_pageAgent(pageAgent) |
815 , m_frontend(0) | 815 , m_frontend(0) |
816 , m_resourcesData(adoptPtr(new NetworkResourcesData())) | 816 , m_resourcesData(adoptPtr(new NetworkResourcesData())) |
817 , m_isRecalculatingStyle(false) | 817 , m_isRecalculatingStyle(false) |
818 { | 818 { |
819 } | 819 } |
820 | 820 |
821 } // namespace WebCore | 821 } // namespace WebCore |
OLD | NEW |