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

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

Issue 848853002: Tag ResourceRequest as originating from reserved IP ranges. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@documentinit
Patch Set: Created 5 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 | « no previous file | Source/platform/exported/WebURLRequest.cpp » ('j') | 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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 { 882 {
883 if (!frame()) 883 if (!frame())
884 return; 884 return;
885 885
886 if (request.cachePolicy() == UseProtocolCachePolicy) 886 if (request.cachePolicy() == UseProtocolCachePolicy)
887 request.setCachePolicy(resourceRequestCachePolicy(request, type)); 887 request.setCachePolicy(resourceRequestCachePolicy(request, type));
888 if (request.requestContext() == WebURLRequest::RequestContextUnspecified) 888 if (request.requestContext() == WebURLRequest::RequestContextUnspecified)
889 determineRequestContext(request, type); 889 determineRequestContext(request, type);
890 if (type == Resource::LinkPrefetch || type == Resource::LinkSubresource) 890 if (type == Resource::LinkPrefetch || type == Resource::LinkSubresource)
891 request.setHTTPHeaderField("Purpose", "prefetch"); 891 request.setHTTPHeaderField("Purpose", "prefetch");
892 if (frame()->document())
893 request.setOriginatesFromReservedIPRange(frame()->document()->isHostedIn ReservedIPRange());
892 894
893 context().addAdditionalRequestHeaders(document(), request, (type == Resource ::MainResource) ? FetchMainResource : FetchSubresource); 895 context().addAdditionalRequestHeaders(document(), request, (type == Resource ::MainResource) ? FetchMainResource : FetchSubresource);
894 } 896 }
895 897
896 ResourcePtr<Resource> ResourceFetcher::createResourceForRevalidation(const Fetch Request& request, Resource* resource) 898 ResourcePtr<Resource> ResourceFetcher::createResourceForRevalidation(const Fetch Request& request, Resource* resource)
897 { 899 {
898 ASSERT(resource); 900 ASSERT(resource);
899 ASSERT(memoryCache()->contains(resource)); 901 ASSERT(memoryCache()->contains(resource));
900 ASSERT(resource->isLoaded()); 902 ASSERT(resource->isLoaded());
901 ASSERT(resource->canUseCacheValidator()); 903 ASSERT(resource->canUseCacheValidator());
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 1577
1576 void ResourceFetcher::trace(Visitor* visitor) 1578 void ResourceFetcher::trace(Visitor* visitor)
1577 { 1579 {
1578 visitor->trace(m_document); 1580 visitor->trace(m_document);
1579 visitor->trace(m_loaders); 1581 visitor->trace(m_loaders);
1580 visitor->trace(m_nonBlockingLoaders); 1582 visitor->trace(m_nonBlockingLoaders);
1581 ResourceLoaderHost::trace(visitor); 1583 ResourceLoaderHost::trace(visitor);
1582 } 1584 }
1583 1585
1584 } 1586 }
OLDNEW
« no previous file with comments | « no previous file | Source/platform/exported/WebURLRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698