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

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: Permit memcache removal when ResourceFetcher is destroyed 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 ClearPreloadsType { ClearAllPreloads, ClearSpeculativeMarkupPreloads };
Nate Chapin 2016/01/21 19:07:14 ClearPreloadsPolicy?
Yoav Weiss 2016/01/21 20:34:09 yup
97
96 bool isPreloaded(const KURL&) const; 98 bool isPreloaded(const KURL&) const;
97 void clearPreloads(); 99 void clearPreloads(ClearPreloadsType = ClearAllPreloads);
Nate Chapin 2016/01/21 19:07:14 How many callsites are there for clearPreloads()?
Yoav Weiss 2016/01/21 20:34:09 Yeah, but the preFinalizer is taking this as a met
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 m_loader->m_allowStaleResources = m_previousState; 248 m_loader->m_allowStaleResources = m_previousState;
247 } 249 }
248 private: 250 private:
249 Member<ResourceFetcher> m_loader; 251 Member<ResourceFetcher> m_loader;
250 bool m_previousState; 252 bool m_previousState;
251 }; 253 };
252 254
253 } // namespace blink 255 } // namespace blink
254 256
255 #endif // ResourceFetcher_h 257 #endif // ResourceFetcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698