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

Side by Side Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 201973002: Re-set referrer on issuing a validation request for a cached resource. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Emit header()s first Created 6 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
« no previous file with comments | « LayoutTests/http/tests/cache/subresource-revalidation-referrer-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 rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 773
774 ResourcePtr<Resource> ResourceFetcher::revalidateResource(const FetchRequest& re quest, Resource* resource) 774 ResourcePtr<Resource> ResourceFetcher::revalidateResource(const FetchRequest& re quest, Resource* resource)
775 { 775 {
776 ASSERT(resource); 776 ASSERT(resource);
777 ASSERT(resource->inCache()); 777 ASSERT(resource->inCache());
778 ASSERT(resource->isLoaded()); 778 ASSERT(resource->isLoaded());
779 ASSERT(resource->canUseCacheValidator()); 779 ASSERT(resource->canUseCacheValidator());
780 ASSERT(!resource->resourceToRevalidate()); 780 ASSERT(!resource->resourceToRevalidate());
781 781
782 ResourceRequest revalidatingRequest(resource->resourceRequest()); 782 ResourceRequest revalidatingRequest(resource->resourceRequest());
783 revalidatingRequest.clearHTTPReferrer();
783 addAdditionalRequestHeaders(revalidatingRequest, resource->type()); 784 addAdditionalRequestHeaders(revalidatingRequest, resource->type());
784 785
785 const AtomicString& lastModified = resource->response().httpHeaderField("Las t-Modified"); 786 const AtomicString& lastModified = resource->response().httpHeaderField("Las t-Modified");
786 const AtomicString& eTag = resource->response().httpHeaderField("ETag"); 787 const AtomicString& eTag = resource->response().httpHeaderField("ETag");
787 if (!lastModified.isEmpty() || !eTag.isEmpty()) { 788 if (!lastModified.isEmpty() || !eTag.isEmpty()) {
788 ASSERT(context().cachePolicy(document()) != CachePolicyReload); 789 ASSERT(context().cachePolicy(document()) != CachePolicyReload);
789 if (context().cachePolicy(document()) == CachePolicyRevalidate) 790 if (context().cachePolicy(document()) == CachePolicyRevalidate)
790 revalidatingRequest.setHTTPHeaderField("Cache-Control", "max-age=0") ; 791 revalidatingRequest.setHTTPHeaderField("Cache-Control", "max-age=0") ;
791 if (!lastModified.isEmpty()) 792 if (!lastModified.isEmpty())
792 revalidatingRequest.setHTTPHeaderField("If-Modified-Since", lastModi fied); 793 revalidatingRequest.setHTTPHeaderField("If-Modified-Since", lastModi fied);
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 case Revalidate: 1400 case Revalidate:
1400 ++m_revalidateCount; 1401 ++m_revalidateCount;
1401 return; 1402 return;
1402 case Use: 1403 case Use:
1403 ++m_useCount; 1404 ++m_useCount;
1404 return; 1405 return;
1405 } 1406 }
1406 } 1407 }
1407 1408
1408 } 1409 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/cache/subresource-revalidation-referrer-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698