| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Whether a resource client for a preload should mark the preload as | 89 // Whether a resource client for a preload should mark the preload as |
| 90 // referenced. | 90 // referenced. |
| 91 enum PreloadReferencePolicy { | 91 enum PreloadReferencePolicy { |
| 92 MarkAsReferenced, | 92 MarkAsReferenced, |
| 93 DontMarkAsReferenced, | 93 DontMarkAsReferenced, |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 // Used by reloadIfLoFiOrPlaceholderImage(). | 96 // Used by reloadIfLoFiOrPlaceholderImage(). |
| 97 enum ReloadLoFiOrPlaceholderPolicy { | 97 enum ReloadLoFiOrPlaceholderPolicy { |
| 98 kReloadIfNeeded, | 98 kReloadIfNeeded, |
| 99 kReloadAlwaysWithExistingCachePolicy, | |
| 100 kReloadAlways, | 99 kReloadAlways, |
| 101 }; | 100 }; |
| 102 | 101 |
| 103 virtual ~Resource(); | 102 virtual ~Resource(); |
| 104 | 103 |
| 105 DECLARE_VIRTUAL_TRACE(); | 104 DECLARE_VIRTUAL_TRACE(); |
| 106 | 105 |
| 107 virtual void setEncoding(const String&) {} | 106 virtual void setEncoding(const String&) {} |
| 108 virtual String encoding() const { return String(); } | 107 virtual String encoding() const { return String(); } |
| 109 virtual void appendData(const char*, size_t); | 108 virtual void appendData(const char*, size_t); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 void setEncodedDataLength(int64_t value) { | 300 void setEncodedDataLength(int64_t value) { |
| 302 m_response.setEncodedDataLength(value); | 301 m_response.setEncodedDataLength(value); |
| 303 } | 302 } |
| 304 void addToEncodedBodyLength(int value) { | 303 void addToEncodedBodyLength(int value) { |
| 305 m_response.addToEncodedBodyLength(value); | 304 m_response.addToEncodedBodyLength(value); |
| 306 } | 305 } |
| 307 void addToDecodedBodyLength(int value) { | 306 void addToDecodedBodyLength(int value) { |
| 308 m_response.addToDecodedBodyLength(value); | 307 m_response.addToDecodedBodyLength(value); |
| 309 } | 308 } |
| 310 | 309 |
| 311 virtual bool canReuse(const ResourceRequest&) const { return true; } | 310 virtual bool canReuse(const FetchRequest&) const { return true; } |
| 312 | 311 |
| 313 // If cache-aware loading is activated, this callback is called when the first | 312 // If cache-aware loading is activated, this callback is called when the first |
| 314 // disk-cache-only request failed due to cache miss. After this callback, | 313 // disk-cache-only request failed due to cache miss. After this callback, |
| 315 // cache-aware loading is deactivated and a reload with original request will | 314 // cache-aware loading is deactivated and a reload with original request will |
| 316 // be triggered right away in ResourceLoader. | 315 // be triggered right away in ResourceLoader. |
| 317 virtual void willReloadAfterDiskCacheMiss() {} | 316 virtual void willReloadAfterDiskCacheMiss() {} |
| 318 | 317 |
| 319 // TODO(shaochuan): This is for saving back the actual ResourceRequest sent | 318 // TODO(shaochuan): This is for saving back the actual ResourceRequest sent |
| 320 // in ResourceFetcher::startLoad() for retry in cache-aware loading, remove | 319 // in ResourceFetcher::startLoad() for retry in cache-aware loading, remove |
| 321 // once ResourceRequest is not modified in startLoad(). crbug.com/632580 | 320 // once ResourceRequest is not modified in startLoad(). crbug.com/632580 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 }; | 501 }; |
| 503 | 502 |
| 504 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 503 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
| 505 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ | 504 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ |
| 506 resource->getType() == Resource::typeName, \ | 505 resource->getType() == Resource::typeName, \ |
| 507 resource.getType() == Resource::typeName); | 506 resource.getType() == Resource::typeName); |
| 508 | 507 |
| 509 } // namespace blink | 508 } // namespace blink |
| 510 | 509 |
| 511 #endif | 510 #endif |
| OLD | NEW |