| 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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 if (initiatorInfo.name == FetchInitiatorTypeNames::internal) | 500 if (initiatorInfo.name == FetchInitiatorTypeNames::internal) |
| 501 return; | 501 return; |
| 502 | 502 |
| 503 if (initiatorInfo.name == FetchInitiatorTypeNames::document && loader->subst
ituteData().isValid()) | 503 if (initiatorInfo.name == FetchInitiatorTypeNames::document && loader->subst
ituteData().isValid()) |
| 504 return; | 504 return; |
| 505 | 505 |
| 506 protocol::DictionaryValue* headers = m_state->getObject(ResourceAgentState::
extraRequestHeaders); | 506 protocol::DictionaryValue* headers = m_state->getObject(ResourceAgentState::
extraRequestHeaders); |
| 507 if (headers) { | 507 if (headers) { |
| 508 for (size_t i = 0; i < headers->size(); ++i) { | 508 for (size_t i = 0; i < headers->size(); ++i) { |
| 509 auto header = headers->at(i); | 509 auto header = headers->at(i); |
| 510 String value; | 510 String16 value; |
| 511 if (header.second->asString(&value)) | 511 if (header.second->asString(&value)) |
| 512 request.setHTTPHeaderField(AtomicString(header.first), AtomicStr
ing(value)); | 512 request.setHTTPHeaderField(AtomicString(header.first), AtomicStr
ing(String(value))); |
| 513 } | 513 } |
| 514 } | 514 } |
| 515 | 515 |
| 516 request.setReportRawHeaders(true); | 516 request.setReportRawHeaders(true); |
| 517 | 517 |
| 518 if (m_state->booleanProperty(ResourceAgentState::cacheDisabled, false)) { | 518 if (m_state->booleanProperty(ResourceAgentState::cacheDisabled, false)) { |
| 519 request.setCachePolicy(ReloadBypassingCache); | 519 request.setCachePolicy(ReloadBypassingCache); |
| 520 request.setShouldResetAppCache(true); | 520 request.setShouldResetAppCache(true); |
| 521 } | 521 } |
| 522 | 522 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 bool hasContent = InspectorPageAgent::cachedResourceContent(cachedResource,
&content, &base64Encoded); | 751 bool hasContent = InspectorPageAgent::cachedResourceContent(cachedResource,
&content, &base64Encoded); |
| 752 Vector<String> requestIds = m_resourcesData->removeResource(cachedResource); | 752 Vector<String> requestIds = m_resourcesData->removeResource(cachedResource); |
| 753 if (hasContent && !isErrorStatusCode(cachedResource->response().httpStatusCo
de())) { | 753 if (hasContent && !isErrorStatusCode(cachedResource->response().httpStatusCo
de())) { |
| 754 for (auto& request : requestIds) | 754 for (auto& request : requestIds) |
| 755 m_resourcesData->setResourceContent(request, content, base64Encoded)
; | 755 m_resourcesData->setResourceContent(request, content, base64Encoded)
; |
| 756 } | 756 } |
| 757 } | 757 } |
| 758 | 758 |
| 759 void InspectorResourceAgent::applyUserAgentOverride(String* userAgent) | 759 void InspectorResourceAgent::applyUserAgentOverride(String* userAgent) |
| 760 { | 760 { |
| 761 String userAgentOverride; | 761 String16 userAgentOverride; |
| 762 m_state->getString(ResourceAgentState::userAgentOverride, &userAgentOverride
); | 762 m_state->getString(ResourceAgentState::userAgentOverride, &userAgentOverride
); |
| 763 if (!userAgentOverride.isEmpty()) | 763 if (!userAgentOverride.isEmpty()) |
| 764 *userAgent = userAgentOverride; | 764 *userAgent = userAgentOverride; |
| 765 } | 765 } |
| 766 | 766 |
| 767 void InspectorResourceAgent::willRecalculateStyle(Document*) | 767 void InspectorResourceAgent::willRecalculateStyle(Document*) |
| 768 { | 768 { |
| 769 m_isRecalculatingStyle = true; | 769 m_isRecalculatingStyle = true; |
| 770 } | 770 } |
| 771 | 771 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish
edReplayXHRFired) | 1111 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish
edReplayXHRFired) |
| 1112 { | 1112 { |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 bool InspectorResourceAgent::shouldForceCORSPreflight() | 1115 bool InspectorResourceAgent::shouldForceCORSPreflight() |
| 1116 { | 1116 { |
| 1117 return m_state->booleanProperty(ResourceAgentState::cacheDisabled, false); | 1117 return m_state->booleanProperty(ResourceAgentState::cacheDisabled, false); |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 } // namespace blink | 1120 } // namespace blink |
| OLD | NEW |