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

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

Issue 2017883002: Make revalidation to fail when received a redirect response (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 } 545 }
546 546
547 void Resource::setRevalidatingRequest(const ResourceRequest& request) 547 void Resource::setRevalidatingRequest(const ResourceRequest& request)
548 { 548 {
549 m_revalidatingRequest = request; 549 m_revalidatingRequest = request;
550 m_status = NotStarted; 550 m_status = NotStarted;
551 } 551 }
552 552
553 void Resource::willFollowRedirect(ResourceRequest& newRequest, const ResourceRes ponse& redirectResponse) 553 void Resource::willFollowRedirect(ResourceRequest& newRequest, const ResourceRes ponse& redirectResponse)
554 { 554 {
555 if (!m_revalidatingRequest.isNull()) {
556 revalidationFailed();
Nate Chapin 2016/05/27 17:10:43 Would m_redirectChain.clear() suffice?
hiroshige 2016/05/31 06:24:46 No. Just clearing |m_redirectChain| doesn't preven
557 }
kinuko 2016/05/27 14:25:01 nit: no { } for consistency
hiroshige 2016/05/31 13:09:31 Done.
555 newRequest.setAllowStoredCredentials(m_options.allowCredentials == AllowStor edCredentials); 558 newRequest.setAllowStoredCredentials(m_options.allowCredentials == AllowStor edCredentials);
556 m_redirectChain.append(RedirectPair(newRequest, redirectResponse)); 559 m_redirectChain.append(RedirectPair(newRequest, redirectResponse));
557 } 560 }
558 561
559 void Resource::setResponse(const ResourceResponse& response) 562 void Resource::setResponse(const ResourceResponse& response)
560 { 563 {
561 m_response = response; 564 m_response = response;
562 if (m_response.wasFetchedViaServiceWorker()) 565 if (m_response.wasFetchedViaServiceWorker())
563 m_cacheHandler = ServiceWorkerResponseCachedMetadataHandler::create(this , m_fetcherSecurityOrigin.get()); 566 m_cacheHandler = ServiceWorkerResponseCachedMetadataHandler::create(this , m_fetcherSecurityOrigin.get());
564 } 567 }
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 case Resource::Media: 1125 case Resource::Media:
1123 return "Media"; 1126 return "Media";
1124 case Resource::Manifest: 1127 case Resource::Manifest:
1125 return "Manifest"; 1128 return "Manifest";
1126 } 1129 }
1127 ASSERT_NOT_REACHED(); 1130 ASSERT_NOT_REACHED();
1128 return "Unknown"; 1131 return "Unknown";
1129 } 1132 }
1130 1133
1131 } // namespace blink 1134 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698