Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp

Issue 2750433002: Do not treat substitute-data resources as having successful HTTP status codes. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 m_archive->subresourceForURL(request.url()); 380 m_archive->subresourceForURL(request.url());
381 // Fall back to the network if the archive doesn't contain the resource. 381 // Fall back to the network if the archive doesn't contain the resource.
382 if (!archiveResource) 382 if (!archiveResource)
383 return nullptr; 383 return nullptr;
384 mimetype = archiveResource->mimeType(); 384 mimetype = archiveResource->mimeType();
385 charset = archiveResource->textEncoding(); 385 charset = archiveResource->textEncoding();
386 data = archiveResource->data(); 386 data = archiveResource->data();
387 } 387 }
388 388
389 ResourceResponse response(url, mimetype, data->size(), charset); 389 ResourceResponse response(url, mimetype, data->size(), charset);
390 response.setHTTPStatusCode(200); 390 if (!substituteData.isValid() && url.protocolIsData()) {
391 response.setHTTPStatusText("OK"); 391 response.setHTTPStatusCode(200);
392 response.setHTTPStatusText("OK");
393 }
392 394
393 Resource* resource = factory.create(request.resourceRequest(), 395 Resource* resource = factory.create(request.resourceRequest(),
394 request.options(), request.charset()); 396 request.options(), request.charset());
395 resource->setNeedsSynchronousCacheHit(substituteData.forceSynchronousLoad()); 397 resource->setNeedsSynchronousCacheHit(substituteData.forceSynchronousLoad());
396 // FIXME: We should provide a body stream here. 398 // FIXME: We should provide a body stream here.
397 resource->responseReceived(response, nullptr); 399 resource->responseReceived(response, nullptr);
398 resource->setDataBufferingPolicy(BufferData); 400 resource->setDataBufferingPolicy(BufferData);
399 if (data->size()) 401 if (data->size())
400 resource->setResourceBuffer(data); 402 resource->setResourceBuffer(data);
401 resource->setIdentifier(createUniqueIdentifier()); 403 resource->setIdentifier(createUniqueIdentifier());
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 visitor->trace(m_context); 1554 visitor->trace(m_context);
1553 visitor->trace(m_archive); 1555 visitor->trace(m_archive);
1554 visitor->trace(m_loaders); 1556 visitor->trace(m_loaders);
1555 visitor->trace(m_nonBlockingLoaders); 1557 visitor->trace(m_nonBlockingLoaders);
1556 visitor->trace(m_documentResources); 1558 visitor->trace(m_documentResources);
1557 visitor->trace(m_preloads); 1559 visitor->trace(m_preloads);
1558 visitor->trace(m_resourceTimingInfoMap); 1560 visitor->trace(m_resourceTimingInfoMap);
1559 } 1561 }
1560 1562
1561 } // namespace blink 1563 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698