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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 responseObject->setHeadersText(response.resourceLoadInfo()->response
HeadersText); | 264 responseObject->setHeadersText(response.resourceLoadInfo()->response
HeadersText); |
265 | 265 |
266 responseObject->setRequestHeaders(buildObjectForHeaders(response.resourc
eLoadInfo()->requestHeaders)); | 266 responseObject->setRequestHeaders(buildObjectForHeaders(response.resourc
eLoadInfo()->requestHeaders)); |
267 if (!response.resourceLoadInfo()->requestHeadersText.isEmpty()) | 267 if (!response.resourceLoadInfo()->requestHeadersText.isEmpty()) |
268 responseObject->setRequestHeadersText(response.resourceLoadInfo()->r
equestHeadersText); | 268 responseObject->setRequestHeadersText(response.resourceLoadInfo()->r
equestHeadersText); |
269 } | 269 } |
270 | 270 |
271 return responseObject; | 271 return responseObject; |
272 } | 272 } |
273 | 273 |
274 static PassRefPtr<TypeBuilder::Network::CachedResource> buildObjectForResource(c
onst Resource& cachedResource, DocumentLoader* loader) | |
275 { | |
276 RefPtr<TypeBuilder::Network::CachedResource> resourceObject = TypeBuilder::N
etwork::CachedResource::create() | |
277 .setUrl(urlWithoutFragment(cachedResource.url()).string()) | |
278 .setType(InspectorPageAgent::cachedResourceTypeJson(cachedResource)) | |
279 .setBodySize(cachedResource.encodedSize()); | |
280 RefPtr<TypeBuilder::Network::Response> resourceResponse = buildObjectForReso
urceResponse(cachedResource.response(), loader); | |
281 if (resourceResponse) | |
282 resourceObject->setResponse(resourceResponse); | |
283 return resourceObject; | |
284 } | |
285 | |
286 InspectorResourceAgent::~InspectorResourceAgent() | 274 InspectorResourceAgent::~InspectorResourceAgent() |
287 { | 275 { |
288 if (m_state->getBoolean(ResourceAgentState::resourceAgentEnabled)) { | 276 if (m_state->getBoolean(ResourceAgentState::resourceAgentEnabled)) { |
289 ErrorString error; | 277 ErrorString error; |
290 disable(&error); | 278 disable(&error); |
291 } | 279 } |
292 ASSERT(!m_instrumentingAgents->inspectorResourceAgent()); | 280 ASSERT(!m_instrumentingAgents->inspectorResourceAgent()); |
293 } | 281 } |
294 | 282 |
295 void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentL
oader* loader, ResourceRequest& request, const ResourceResponse& redirectRespons
e, const FetchInitiatorInfo& initiatorInfo) | 283 void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentL
oader* loader, ResourceRequest& request, const ResourceResponse& redirectRespons
e, const FetchInitiatorInfo& initiatorInfo) |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 , m_overlay(overlay) | 759 , m_overlay(overlay) |
772 , m_frontend(0) | 760 , m_frontend(0) |
773 , m_resourcesData(adoptPtr(new NetworkResourcesData())) | 761 , m_resourcesData(adoptPtr(new NetworkResourcesData())) |
774 , m_loadingXHRSynchronously(false) | 762 , m_loadingXHRSynchronously(false) |
775 , m_isRecalculatingStyle(false) | 763 , m_isRecalculatingStyle(false) |
776 { | 764 { |
777 } | 765 } |
778 | 766 |
779 } // namespace WebCore | 767 } // namespace WebCore |
780 | 768 |
OLD | NEW |