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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceLoader.cpp

Issue 1558703002: Synchronous requests that get a 304 clobber the cached response body. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/http/tests/cache/sync-xhr-304-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) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } 509 }
510 didFail(0, errorOut); 510 didFail(0, errorOut);
511 return; 511 return;
512 } 512 }
513 didReceiveResponse(0, responseOut); 513 didReceiveResponse(0, responseOut);
514 if (m_state == Terminated) 514 if (m_state == Terminated)
515 return; 515 return;
516 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo(); 516 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo();
517 int64_t encodedDataLength = resourceLoadInfo ? resourceLoadInfo->encodedData Length : WebURLLoaderClient::kUnknownEncodedDataLength; 517 int64_t encodedDataLength = resourceLoadInfo ? resourceLoadInfo->encodedData Length : WebURLLoaderClient::kUnknownEncodedDataLength;
518 m_fetcher->didReceiveData(m_resource, dataOut.data(), dataOut.size(), encode dDataLength); 518 m_fetcher->didReceiveData(m_resource, dataOut.data(), dataOut.size(), encode dDataLength);
519 m_resource->setResourceBuffer(dataOut); 519 if (dataOut.size())
Yoav Weiss 2015/12/31 06:29:17 Isn't there a scenario where the response *has* ch
Nate Chapin 2016/01/04 22:15:54 In all non-revalidation cases, Resource::m_data wi
Yoav Weiss 2016/01/05 14:13:03 What's the relationship between Resource::m_data a
520 m_resource->setResourceBuffer(dataOut);
520 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); 521 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
521 } 522 }
522 523
523 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const 524 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const
524 { 525 {
525 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); 526 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials);
526 return request; 527 return request;
527 } 528 }
528 529
529 } 530 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/cache/sync-xhr-304-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698