| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
| 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 | 1306 |
| 1307 void ResourceFetcher::didChangeLoadingPriority(const Resource* resource, Resourc
eLoadPriority loadPriority, int intraPriorityValue) | 1307 void ResourceFetcher::didChangeLoadingPriority(const Resource* resource, Resourc
eLoadPriority loadPriority, int intraPriorityValue) |
| 1308 { | 1308 { |
| 1309 TRACE_EVENT_ASYNC_STEP_INTO1("net", "Resource", resource, "ChangePriority",
"priority", loadPriority); | 1309 TRACE_EVENT_ASYNC_STEP_INTO1("net", "Resource", resource, "ChangePriority",
"priority", loadPriority); |
| 1310 context().dispatchDidChangeResourcePriority(resource->identifier(), loadPrio
rity, intraPriorityValue); | 1310 context().dispatchDidChangeResourcePriority(resource->identifier(), loadPrio
rity, intraPriorityValue); |
| 1311 } | 1311 } |
| 1312 | 1312 |
| 1313 void ResourceFetcher::didFailLoading(const Resource* resource, const ResourceErr
or& error) | 1313 void ResourceFetcher::didFailLoading(const Resource* resource, const ResourceErr
or& error) |
| 1314 { | 1314 { |
| 1315 TRACE_EVENT_ASYNC_END0("net", "Resource", resource); | 1315 TRACE_EVENT_ASYNC_END0("net", "Resource", resource); |
| 1316 context().dispatchDidFail(m_documentLoader, resource->identifier(), error); | 1316 bool isInternalRequest = resource->options().initiatorInfo.name == FetchInit
iatorTypeNames::internal; |
| 1317 context().dispatchDidFail(m_documentLoader, resource->identifier(), error, i
sInternalRequest); |
| 1317 } | 1318 } |
| 1318 | 1319 |
| 1319 void ResourceFetcher::willSendRequest(unsigned long identifier, ResourceRequest&
request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& in
itiatorInfo) | 1320 void ResourceFetcher::willSendRequest(unsigned long identifier, ResourceRequest&
request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& in
itiatorInfo) |
| 1320 { | 1321 { |
| 1321 context().dispatchWillSendRequest(m_documentLoader, identifier, request, red
irectResponse, initiatorInfo); | 1322 context().dispatchWillSendRequest(m_documentLoader, identifier, request, red
irectResponse, initiatorInfo); |
| 1322 } | 1323 } |
| 1323 | 1324 |
| 1324 void ResourceFetcher::didReceiveResponse(const Resource* resource, const Resourc
eResponse& response) | 1325 void ResourceFetcher::didReceiveResponse(const Resource* resource, const Resourc
eResponse& response) |
| 1325 { | 1326 { |
| 1326 MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddre
ss()); | 1327 MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddre
ss()); |
| 1327 | 1328 |
| 1328 // If the response is fetched via ServiceWorker, the original URL of the res
ponse could be different from the URL of the request. | 1329 // If the response is fetched via ServiceWorker, the original URL of the res
ponse could be different from the URL of the request. |
| 1329 if (response.wasFetchedViaServiceWorker()) { | 1330 if (response.wasFetchedViaServiceWorker()) { |
| 1330 if (!canRequest(resource->type(), resource->resourceRequest(), response.
url(), resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForT
ype)) { | 1331 if (!canRequest(resource->type(), resource->resourceRequest(), response.
url(), resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForT
ype)) { |
| 1331 resource->loader()->cancel(); | 1332 resource->loader()->cancel(); |
| 1332 context().dispatchDidFail(m_documentLoader, resource->identifier(),
ResourceError(errorDomainBlinkInternal, 0, response.url().string(), "Unsafe atte
mpt to load URL " + response.url().elidedString() + " fetched by a ServiceWorker
.")); | 1333 bool isInternalRequest = resource->options().initiatorInfo.name == F
etchInitiatorTypeNames::internal; |
| 1334 context().dispatchDidFail(m_documentLoader, resource->identifier(),
ResourceError(errorDomainBlinkInternal, 0, response.url().string(), "Unsafe atte
mpt to load URL " + response.url().elidedString() + " fetched by a ServiceWorker
."), isInternalRequest); |
| 1333 return; | 1335 return; |
| 1334 } | 1336 } |
| 1335 } | 1337 } |
| 1336 context().dispatchDidReceiveResponse(m_documentLoader, resource->identifier(
), response, resource->loader()); | 1338 context().dispatchDidReceiveResponse(m_documentLoader, resource->identifier(
), response, resource->loader()); |
| 1337 } | 1339 } |
| 1338 | 1340 |
| 1339 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data,
int dataLength, int encodedDataLength) | 1341 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data,
int dataLength, int encodedDataLength) |
| 1340 { | 1342 { |
| 1341 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d
ata, dataLength, encodedDataLength); | 1343 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d
ata, dataLength, encodedDataLength); |
| 1342 } | 1344 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 | 1544 |
| 1543 void ResourceFetcher::trace(Visitor* visitor) | 1545 void ResourceFetcher::trace(Visitor* visitor) |
| 1544 { | 1546 { |
| 1545 visitor->trace(m_document); | 1547 visitor->trace(m_document); |
| 1546 visitor->trace(m_loaders); | 1548 visitor->trace(m_loaders); |
| 1547 visitor->trace(m_multipartLoaders); | 1549 visitor->trace(m_multipartLoaders); |
| 1548 ResourceLoaderHost::trace(visitor); | 1550 ResourceLoaderHost::trace(visitor); |
| 1549 } | 1551 } |
| 1550 | 1552 |
| 1551 } | 1553 } |
| OLD | NEW |