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

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

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: handle font-display: swap 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 void addToEncodedBodyLength(int value) { 289 void addToEncodedBodyLength(int value) {
290 m_response.addToEncodedBodyLength(value); 290 m_response.addToEncodedBodyLength(value);
291 } 291 }
292 void addToDecodedBodyLength(int value) { 292 void addToDecodedBodyLength(int value) {
293 m_response.addToDecodedBodyLength(value); 293 m_response.addToDecodedBodyLength(value);
294 } 294 }
295 295
296 virtual bool canReuse(const ResourceRequest&) const { return true; } 296 virtual bool canReuse(const ResourceRequest&) const { return true; }
297 297
298 virtual void willReloadAfterDiskCacheMiss() {}
299
300 void deactivateCacheAwareLoading() {
301 m_resourceRequest.deactivateCacheAwareLoading();
302 }
303
304 // TODO(632580): Workaround to persist cache-aware state, remove after fixed.
305 void setResourceRequest(const ResourceRequest& resourceRequest) {
306 m_resourceRequest = resourceRequest;
307 }
308
298 // Used by the MemoryCache to reduce the memory consumption of the entry. 309 // Used by the MemoryCache to reduce the memory consumption of the entry.
299 void prune(); 310 void prune();
300 311
301 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, 312 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail,
302 WebProcessMemoryDump*) const; 313 WebProcessMemoryDump*) const;
303 314
304 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); 315 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
305 316
306 protected: 317 protected:
307 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); 318 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 }; 476 };
466 477
467 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 478 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
468 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ 479 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \
469 resource->getType() == Resource::typeName, \ 480 resource->getType() == Resource::typeName, \
470 resource.getType() == Resource::typeName); 481 resource.getType() == Resource::typeName);
471 482
472 } // namespace blink 483 } // namespace blink
473 484
474 #endif 485 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698