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

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

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) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 for (const auto& resource : resources) 284 for (const auto& resource : resources)
285 resource->finishPendingClients(); 285 resource->finishPendingClients();
286 } 286 }
287 287
288 Resource::Resource(const ResourceRequest& request, Type type, const ResourceLoad erOptions& options) 288 Resource::Resource(const ResourceRequest& request, Type type, const ResourceLoad erOptions& options)
289 : m_loadFinishTime(0) 289 : m_loadFinishTime(0)
290 , m_identifier(0) 290 , m_identifier(0)
291 , m_encodedSize(0) 291 , m_encodedSize(0)
292 , m_decodedSize(0) 292 , m_decodedSize(0)
293 , m_overheadSize(calculateOverheadSize()) 293 , m_overheadSize(calculateOverheadSize())
294 , m_preloadCount(0) 294 , m_isPreloaded(false)
295 , m_preloadDiscoveryTime(0.0) 295 , m_preloadDiscoveryTime(0.0)
296 , m_cacheIdentifier(MemoryCache::defaultCacheIdentifier()) 296 , m_cacheIdentifier(MemoryCache::defaultCacheIdentifier())
297 , m_preloadResult(PreloadNotReferenced) 297 , m_preloadResult(PreloadNotReferenced)
298 , m_type(type) 298 , m_type(type)
299 , m_status(NotStarted) 299 , m_status(NotStarted)
300 , m_needsSynchronousCacheHit(false) 300 , m_needsSynchronousCacheHit(false)
301 , m_linkPreload(false) 301 , m_linkPreload(false)
302 , m_isRevalidating(false) 302 , m_isRevalidating(false)
303 , m_isAlive(false) 303 , m_isAlive(false)
304 , m_options(options) 304 , m_options(options)
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 builder.append(", Finished="); 605 builder.append(", Finished=");
606 builder.appendNumber(m_finishedClients.size()); 606 builder.appendNumber(m_finishedClients.size());
607 } 607 }
608 builder.append(')'); 608 builder.append(')');
609 } 609 }
610 if (m_loader) { 610 if (m_loader) {
611 if (!builder.isEmpty()) 611 if (!builder.isEmpty())
612 builder.append(' '); 612 builder.append(' ');
613 builder.append("m_loader"); 613 builder.append("m_loader");
614 } 614 }
615 if (m_preloadCount) { 615 if (m_isPreloaded) {
616 if (!builder.isEmpty()) 616 if (!builder.isEmpty())
617 builder.append(' '); 617 builder.append(' ');
618 builder.append("m_preloadCount("); 618 builder.append("m_isPreloaded");
619 builder.appendNumber(m_preloadCount);
620 builder.append(')');
621 } 619 }
622 if (memoryCache()->contains(this)) { 620 if (memoryCache()->contains(this)) {
623 if (!builder.isEmpty()) 621 if (!builder.isEmpty())
624 builder.append(' '); 622 builder.append(' ');
625 builder.append("in_memory_cache"); 623 builder.append("in_memory_cache");
626 } 624 }
627 return builder.toString(); 625 return builder.toString();
628 } 626 }
629 627
630 void Resource::didAddClient(ResourceClient* c) 628 void Resource::didAddClient(ResourceClient* c)
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 case Resource::TextTrack: 1063 case Resource::TextTrack:
1066 case Resource::Media: 1064 case Resource::Media:
1067 case Resource::Manifest: 1065 case Resource::Manifest:
1068 return false; 1066 return false;
1069 } 1067 }
1070 ASSERT_NOT_REACHED(); 1068 ASSERT_NOT_REACHED();
1071 return false; 1069 return false;
1072 } 1070 }
1073 1071
1074 } // namespace blink 1072 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698