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 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 | 1506 |
1507 bool InspectorNetworkAgent::fetchResourceContent(Document* document, | 1507 bool InspectorNetworkAgent::fetchResourceContent(Document* document, |
1508 const KURL& url, | 1508 const KURL& url, |
1509 String* content, | 1509 String* content, |
1510 bool* base64Encoded) { | 1510 bool* base64Encoded) { |
1511 // First try to fetch content from the cached resource. | 1511 // First try to fetch content from the cached resource. |
1512 Resource* cachedResource = document->fetcher()->cachedResource(url); | 1512 Resource* cachedResource = document->fetcher()->cachedResource(url); |
1513 if (!cachedResource) | 1513 if (!cachedResource) |
1514 cachedResource = memoryCache()->resourceForURL( | 1514 cachedResource = memoryCache()->resourceForURL( |
1515 url, document->fetcher()->getCacheIdentifier()); | 1515 url, document->fetcher()->getCacheIdentifier()); |
1516 if (cachedResource && InspectorPageAgent::cachedResourceContent( | 1516 if (cachedResource && |
1517 cachedResource, content, base64Encoded)) | 1517 InspectorPageAgent::cachedResourceContent(cachedResource, content, |
| 1518 base64Encoded)) |
1518 return true; | 1519 return true; |
1519 | 1520 |
1520 // Then fall back to resource data. | 1521 // Then fall back to resource data. |
1521 for (auto& resource : m_resourcesData->resources()) { | 1522 for (auto& resource : m_resourcesData->resources()) { |
1522 if (resource->requestedURL() == url) { | 1523 if (resource->requestedURL() == url) { |
1523 *content = resource->content(); | 1524 *content = resource->content(); |
1524 *base64Encoded = resource->base64Encoded(); | 1525 *base64Encoded = resource->base64Encoded(); |
1525 return true; | 1526 return true; |
1526 } | 1527 } |
1527 } | 1528 } |
(...skipping 20 matching lines...) Expand all Loading... |
1548 TaskRunnerHelper::get(TaskType::UnspecedLoading, | 1549 TaskRunnerHelper::get(TaskType::UnspecedLoading, |
1549 inspectedFrames->root()), | 1550 inspectedFrames->root()), |
1550 this, | 1551 this, |
1551 &InspectorNetworkAgent::removeFinishedReplayXHRFired) {} | 1552 &InspectorNetworkAgent::removeFinishedReplayXHRFired) {} |
1552 | 1553 |
1553 bool InspectorNetworkAgent::shouldForceCORSPreflight() { | 1554 bool InspectorNetworkAgent::shouldForceCORSPreflight() { |
1554 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false); | 1555 return m_state->booleanProperty(NetworkAgentState::cacheDisabled, false); |
1555 } | 1556 } |
1556 | 1557 |
1557 } // namespace blink | 1558 } // namespace blink |
OLD | NEW |