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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 context().dispatchDidFail(m_documentLoader, resource->identifier(), error); | 1283 context().dispatchDidFail(m_documentLoader, resource->identifier(), error); |
1284 } | 1284 } |
1285 | 1285 |
1286 void ResourceFetcher::willSendRequest(unsigned long identifier, ResourceRequest&
request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& in
itiatorInfo) | 1286 void ResourceFetcher::willSendRequest(unsigned long identifier, ResourceRequest&
request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& in
itiatorInfo) |
1287 { | 1287 { |
1288 context().dispatchWillSendRequest(m_documentLoader, identifier, request, red
irectResponse, initiatorInfo); | 1288 context().dispatchWillSendRequest(m_documentLoader, identifier, request, red
irectResponse, initiatorInfo); |
1289 } | 1289 } |
1290 | 1290 |
1291 void ResourceFetcher::didReceiveResponse(const Resource* resource, const Resourc
eResponse& response) | 1291 void ResourceFetcher::didReceiveResponse(const Resource* resource, const Resourc
eResponse& response) |
1292 { | 1292 { |
1293 // FIXME: When response.wasFetchedViaServiceWorker() is true, we need to che
ck the URL of the responce for CSP and CORS. | 1293 if (response.wasFetchedViaServiceWorker()) { |
| 1294 if (!canRequest(resource->type(), response.url(), resource->options(), f
alse, FetchRequest::UseDefaultOriginRestrictionForType)) { |
| 1295 resource->loader()->cancel(); |
| 1296 context().dispatchDidFail(m_documentLoader, resource->identifier(),
ResourceError(errorDomainBlinkInternal, 0, response.url().string(), "Original ur
l check of ServiceWorker fetched resource failed.")); |
| 1297 return; |
| 1298 } |
| 1299 } |
1294 context().dispatchDidReceiveResponse(m_documentLoader, resource->identifier(
), response, resource->loader()); | 1300 context().dispatchDidReceiveResponse(m_documentLoader, resource->identifier(
), response, resource->loader()); |
1295 } | 1301 } |
1296 | 1302 |
1297 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data,
int dataLength, int encodedDataLength) | 1303 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data,
int dataLength, int encodedDataLength) |
1298 { | 1304 { |
1299 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d
ata, dataLength, encodedDataLength); | 1305 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d
ata, dataLength, encodedDataLength); |
1300 } | 1306 } |
1301 | 1307 |
1302 void ResourceFetcher::didDownloadData(const Resource* resource, int dataLength,
int encodedDataLength) | 1308 void ResourceFetcher::didDownloadData(const Resource* resource, int dataLength,
int encodedDataLength) |
1303 { | 1309 { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 } | 1506 } |
1501 } | 1507 } |
1502 | 1508 |
1503 void ResourceFetcher::trace(Visitor* visitor) | 1509 void ResourceFetcher::trace(Visitor* visitor) |
1504 { | 1510 { |
1505 visitor->trace(m_document); | 1511 visitor->trace(m_document); |
1506 ResourceLoaderHost::trace(visitor); | 1512 ResourceLoaderHost::trace(visitor); |
1507 } | 1513 } |
1508 | 1514 |
1509 } | 1515 } |
OLD | NEW |