| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 void addToEncodedBodyLength(int value) { | 304 void addToEncodedBodyLength(int value) { |
| 305 m_response.addToEncodedBodyLength(value); | 305 m_response.addToEncodedBodyLength(value); |
| 306 } | 306 } |
| 307 void addToDecodedBodyLength(int value) { | 307 void addToDecodedBodyLength(int value) { |
| 308 m_response.addToDecodedBodyLength(value); | 308 m_response.addToDecodedBodyLength(value); |
| 309 } | 309 } |
| 310 | 310 |
| 311 virtual bool canReuse(const ResourceRequest&) const { return true; } | 311 virtual bool canReuse(const ResourceRequest&) const { return true; } |
| 312 | 312 |
| 313 // If cache-aware loading is activated, this callback is called when the first |
| 314 // disk-cache-only request failed due to cache miss. |
| 315 virtual void willReloadAfterDiskCacheMiss() {} |
| 316 |
| 317 void deactivateCacheAwareLoading() { |
| 318 m_resourceRequest.deactivateCacheAwareLoading(); |
| 319 } |
| 320 |
| 321 // TODO(shaochuan): Workaround to persist cache-aware state, remove after |
| 322 // fixed. crbug.com/632580 |
| 323 void setResourceRequest(const ResourceRequest& resourceRequest) { |
| 324 m_resourceRequest = resourceRequest; |
| 325 } |
| 326 |
| 313 // Used by the MemoryCache to reduce the memory consumption of the entry. | 327 // Used by the MemoryCache to reduce the memory consumption of the entry. |
| 314 void prune(); | 328 void prune(); |
| 315 | 329 |
| 316 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, | 330 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, |
| 317 WebProcessMemoryDump*) const; | 331 WebProcessMemoryDump*) const; |
| 318 | 332 |
| 319 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); | 333 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); |
| 320 | 334 |
| 321 protected: | 335 protected: |
| 322 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); | 336 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 }; | 496 }; |
| 483 | 497 |
| 484 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 498 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
| 485 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ | 499 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ |
| 486 resource->getType() == Resource::typeName, \ | 500 resource->getType() == Resource::typeName, \ |
| 487 resource.getType() == Resource::typeName); | 501 resource.getType() == Resource::typeName); |
| 488 | 502 |
| 489 } // namespace blink | 503 } // namespace blink |
| 490 | 504 |
| 491 #endif | 505 #endif |
| OLD | NEW |