Chromium Code Reviews| 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 | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 rights reserved. | 6 rights reserved. |
| 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 8 | 8 |
| 9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
| 10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 m_archive->subresourceForURL(request.url()); | 376 m_archive->subresourceForURL(request.url()); |
| 377 // Fall back to the network if the archive doesn't contain the resource. | 377 // Fall back to the network if the archive doesn't contain the resource. |
| 378 if (!archiveResource) | 378 if (!archiveResource) |
| 379 return nullptr; | 379 return nullptr; |
| 380 mimetype = archiveResource->mimeType(); | 380 mimetype = archiveResource->mimeType(); |
| 381 charset = archiveResource->textEncoding(); | 381 charset = archiveResource->textEncoding(); |
| 382 data = archiveResource->data(); | 382 data = archiveResource->data(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 ResourceResponse response(url, mimetype, data->size(), charset, String()); | 385 ResourceResponse response(url, mimetype, data->size(), charset, String()); |
| 386 response.setHTTPStatusCode(200); | |
|
Nate Chapin
2017/02/03 18:00:22
This also means data: urls won't have status code.
| |
| 387 response.setHTTPStatusText("OK"); | |
| 388 | 386 |
| 389 Resource* resource = factory.create(request.resourceRequest(), | 387 Resource* resource = factory.create(request.resourceRequest(), |
| 390 request.options(), request.charset()); | 388 request.options(), request.charset()); |
| 391 resource->setNeedsSynchronousCacheHit(substituteData.forceSynchronousLoad()); | 389 resource->setNeedsSynchronousCacheHit(substituteData.forceSynchronousLoad()); |
| 392 // FIXME: We should provide a body stream here. | 390 // FIXME: We should provide a body stream here. |
| 393 resource->responseReceived(response, nullptr); | 391 resource->responseReceived(response, nullptr); |
| 394 resource->setDataBufferingPolicy(BufferData); | 392 resource->setDataBufferingPolicy(BufferData); |
| 395 if (data->size()) | 393 if (data->size()) |
| 396 resource->setResourceBuffer(data); | 394 resource->setResourceBuffer(data); |
| 397 resource->setIdentifier(createUniqueIdentifier()); | 395 resource->setIdentifier(createUniqueIdentifier()); |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1525 visitor->trace(m_context); | 1523 visitor->trace(m_context); |
| 1526 visitor->trace(m_archive); | 1524 visitor->trace(m_archive); |
| 1527 visitor->trace(m_loaders); | 1525 visitor->trace(m_loaders); |
| 1528 visitor->trace(m_nonBlockingLoaders); | 1526 visitor->trace(m_nonBlockingLoaders); |
| 1529 visitor->trace(m_documentResources); | 1527 visitor->trace(m_documentResources); |
| 1530 visitor->trace(m_preloads); | 1528 visitor->trace(m_preloads); |
| 1531 visitor->trace(m_resourceTimingInfoMap); | 1529 visitor->trace(m_resourceTimingInfoMap); |
| 1532 } | 1530 } |
| 1533 | 1531 |
| 1534 } // namespace blink | 1532 } // namespace blink |
| OLD | NEW |