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

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

Issue 2676443004: Do not treat substitute-data resources as having successful HTTP status codes. (Closed)
Patch Set: Tests. Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/network/network-status-non-http-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/network/network-status-non-http-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698