| OLD | NEW |
| 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 Loading... |
| 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 // If cache-aware loading is activated, this callback is called when the first |
| 299 // disk-cache-only request failed due to cache miss. |
| 300 virtual void willReloadAfterDiskCacheMiss() {} |
| 301 |
| 302 void deactivateCacheAwareLoading() { |
| 303 m_resourceRequest.deactivateCacheAwareLoading(); |
| 304 } |
| 305 |
| 306 // TODO(shaochuan): Workaround to persist cache-aware state, remove after |
| 307 // fixed. crbug.com/632580 |
| 308 void setResourceRequest(const ResourceRequest& resourceRequest) { |
| 309 m_resourceRequest = resourceRequest; |
| 310 } |
| 311 |
| 298 // Used by the MemoryCache to reduce the memory consumption of the entry. | 312 // Used by the MemoryCache to reduce the memory consumption of the entry. |
| 299 void prune(); | 313 void prune(); |
| 300 | 314 |
| 301 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, | 315 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, |
| 302 WebProcessMemoryDump*) const; | 316 WebProcessMemoryDump*) const; |
| 303 | 317 |
| 304 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); | 318 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); |
| 305 | 319 |
| 306 protected: | 320 protected: |
| 307 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); | 321 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 }; | 478 }; |
| 465 | 479 |
| 466 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 480 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
| 467 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ | 481 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ |
| 468 resource->getType() == Resource::typeName, \ | 482 resource->getType() == Resource::typeName, \ |
| 469 resource.getType() == Resource::typeName); | 483 resource.getType() == Resource::typeName); |
| 470 | 484 |
| 471 } // namespace blink | 485 } // namespace blink |
| 472 | 486 |
| 473 #endif | 487 #endif |
| OLD | NEW |