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

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

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: move callback impl to FontResource, remove unittests for now, fix Created 4 years, 2 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 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 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 284
285 void addToEncodedBodyLength(int value) { 285 void addToEncodedBodyLength(int value) {
286 m_response.addToEncodedBodyLength(value); 286 m_response.addToEncodedBodyLength(value);
287 } 287 }
288 void addToDecodedBodyLength(int value) { 288 void addToDecodedBodyLength(int value) {
289 m_response.addToDecodedBodyLength(value); 289 m_response.addToDecodedBodyLength(value);
290 } 290 }
291 291
292 virtual bool canReuse(const ResourceRequest&) const { return true; } 292 virtual bool canReuse(const ResourceRequest&) const { return true; }
293 293
294 virtual void willReloadAfterDiskCacheMiss() {}
295
296 void deactivateCacheAwareLoading() {
297 m_resourceRequest.deactivateCacheAwareLoading();
298 }
299
300 // TODO(632580): Workaround to persist cache-aware state, remove after fixed.
301 void setResourceRequest(const ResourceRequest& resourceRequest) {
302 m_resourceRequest = resourceRequest;
303 }
304
294 // Used by the MemoryCache to reduce the memory consumption of the entry. 305 // Used by the MemoryCache to reduce the memory consumption of the entry.
295 void prune(); 306 void prune();
296 307
297 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, 308 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail,
298 WebProcessMemoryDump*) const; 309 WebProcessMemoryDump*) const;
299 310
300 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); 311 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
301 312
302 protected: 313 protected:
303 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); 314 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 }; 469 };
459 470
460 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 471 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
461 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ 472 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \
462 resource->getType() == Resource::typeName, \ 473 resource->getType() == Resource::typeName, \
463 resource.getType() == Resource::typeName); 474 resource.getType() == Resource::typeName);
464 475
465 } // namespace blink 476 } // namespace blink
466 477
467 #endif 478 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698