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

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

Issue 2319483002: Turn off isLinkPreload() when used (Closed)
Patch Set: Turn off LinkPreload when resource is used + tests Created 4 years, 3 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
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 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 AtomicString httpContentType() const; 208 AtomicString httpContentType() const;
209 209
210 bool wasCanceled() const { return m_error.isCancellation(); } 210 bool wasCanceled() const { return m_error.isCancellation(); }
211 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; } 211 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; }
212 bool loadFailedOrCanceled() { return !m_error.isNull(); } 212 bool loadFailedOrCanceled() { return !m_error.isNull(); }
213 213
214 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu fferingPolicy; } 214 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu fferingPolicy; }
215 void setDataBufferingPolicy(DataBufferingPolicy); 215 void setDataBufferingPolicy(DataBufferingPolicy);
216 216
217 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; } 217 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; }
218 bool isPreloaded() const { return m_preloadCount; } 218 bool isPreloaded() const { return m_isPreloaded; }
219 void increasePreloadCount() { ++m_preloadCount; } 219 void setIsPreloaded(bool isPreloaded) { m_isPreloaded = isPreloaded; }
220 void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; }
221 220
222 bool canReuseRedirectChain(); 221 bool canReuseRedirectChain();
223 bool mustRevalidateDueToCacheHeaders(); 222 bool mustRevalidateDueToCacheHeaders();
224 bool canUseCacheValidator(); 223 bool canUseCacheValidator();
225 bool isCacheValidator() const { return m_isRevalidating; } 224 bool isCacheValidator() const { return m_isRevalidating; }
226 bool hasCacheControlNoStoreHeader() const; 225 bool hasCacheControlNoStoreHeader() const;
227 bool hasVaryHeader() const; 226 bool hasVaryHeader() const;
228 virtual bool mustRefetchDueToIntegrityMetadata(const FetchRequest& request) const { return false; } 227 virtual bool mustRefetchDueToIntegrityMetadata(const FetchRequest& request) const { return false; }
229 228
230 double currentAge() const; 229 double currentAge() const;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 338
340 size_t m_encodedSize; 339 size_t m_encodedSize;
341 size_t m_decodedSize; 340 size_t m_decodedSize;
342 341
343 // Resource::calculateOverheadSize() is affected by changes in 342 // Resource::calculateOverheadSize() is affected by changes in
344 // |m_resourceRequest.url()|, but |m_overheadSize| is not updated after 343 // |m_resourceRequest.url()|, but |m_overheadSize| is not updated after
345 // initial |m_resourceRequest| is given, to reduce MemoryCache manipulation 344 // initial |m_resourceRequest| is given, to reduce MemoryCache manipulation
346 // and thus potential bugs. crbug.com/594644 345 // and thus potential bugs. crbug.com/594644
347 const size_t m_overheadSize; 346 const size_t m_overheadSize;
348 347
349 unsigned m_preloadCount; 348 bool m_isPreloaded;
350 349
351 double m_preloadDiscoveryTime; 350 double m_preloadDiscoveryTime;
352 351
353 String m_cacheIdentifier; 352 String m_cacheIdentifier;
354 353
355 unsigned m_preloadResult : 2; // PreloadResult 354 unsigned m_preloadResult : 2; // PreloadResult
356 unsigned m_type : 4; // Type 355 unsigned m_type : 4; // Type
357 unsigned m_status : 3; // Status 356 unsigned m_status : 3; // Status
358 357
359 unsigned m_needsSynchronousCacheHit : 1; 358 unsigned m_needsSynchronousCacheHit : 1;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 391
393 Resource::Type m_type; 392 Resource::Type m_type;
394 }; 393 };
395 394
396 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 395 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
397 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); 396 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName);
398 397
399 } // namespace blink 398 } // namespace blink
400 399
401 #endif 400 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698