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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.h

Issue 1615803004: Avoid double download for late discovered link preload resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 4 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 void setImagesEnabled(bool); 87 void setImagesEnabled(bool);
88 88
89 bool shouldDeferImageLoad(const KURL&) const; 89 bool shouldDeferImageLoad(const KURL&) const;
90 90
91 FetchContext& context() const { return m_context ? *m_context.get() : FetchC ontext::nullInstance(); } 91 FetchContext& context() const { return m_context ? *m_context.get() : FetchC ontext::nullInstance(); }
92 void clearContext() { m_context.clear(); } 92 void clearContext() { m_context.clear(); }
93 93
94 int requestCount() const; 94 int requestCount() const;
95 95
96 enum ClearPreloadsPolicy { ClearAllPreloads, ClearSpeculativeMarkupPreloads };
97
96 bool isPreloaded(const KURL&) const; 98 bool isPreloaded(const KURL&) const;
97 void clearPreloads(); 99 void clearPreloads(ClearPreloadsPolicy = ClearAllPreloads);
98 void preloadStarted(Resource*); 100 void preloadStarted(Resource*);
99 void printPreloadStats(); 101 void printPreloadStats();
100 102
101 void addAllArchiveResources(MHTMLArchive*); 103 void addAllArchiveResources(MHTMLArchive*);
102 ArchiveResourceCollection* archiveResourceCollection() const { return m_arch iveResourceCollection.get(); } 104 ArchiveResourceCollection* archiveResourceCollection() const { return m_arch iveResourceCollection.get(); }
103 105
104 void setDefersLoading(bool); 106 void setDefersLoading(bool);
105 void stopFetching(); 107 void stopFetching();
106 bool isFetching() const; 108 bool isFetching() const;
107 109
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 m_loader->m_allowStaleResources = m_previousState; 249 m_loader->m_allowStaleResources = m_previousState;
248 } 250 }
249 private: 251 private:
250 Member<ResourceFetcher> m_loader; 252 Member<ResourceFetcher> m_loader;
251 bool m_previousState; 253 bool m_previousState;
252 }; 254 };
253 255
254 } // namespace blink 256 } // namespace blink
255 257
256 #endif // ResourceFetcher_h 258 #endif // ResourceFetcher_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698