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
rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
6 | 6 |
7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) { } | 187 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) { } |
188 | 188 |
189 // Sets the serialized metadata retrieved from the platform's cache. | 189 // Sets the serialized metadata retrieved from the platform's cache. |
190 virtual void setSerializedCachedMetadata(const char*, size_t); | 190 virtual void setSerializedCachedMetadata(const char*, size_t); |
191 | 191 |
192 // This may return nullptr when the resource isn't cacheable. | 192 // This may return nullptr when the resource isn't cacheable. |
193 CachedMetadataHandler* cacheHandler(); | 193 CachedMetadataHandler* cacheHandler(); |
194 | 194 |
195 String reasonNotDeletable() const; | 195 String reasonNotDeletable() const; |
196 | 196 |
197 // List of acceptable MIME types separated by ",". | |
198 // A MIME type may contain a wildcard, e.g. "text/*". | |
199 AtomicString accept() const { return m_accept; } | |
200 void setAccept(const AtomicString& accept) { m_accept = accept; } | |
201 | |
202 AtomicString httpContentType() const; | 197 AtomicString httpContentType() const; |
203 | 198 |
204 bool wasCanceled() const { return m_error.isCancellation(); } | 199 bool wasCanceled() const { return m_error.isCancellation(); } |
205 bool errorOccurred() const { return m_status == LoadError || m_status == Dec
odeError; } | 200 bool errorOccurred() const { return m_status == LoadError || m_status == Dec
odeError; } |
206 bool loadFailedOrCanceled() { return !m_error.isNull(); } | 201 bool loadFailedOrCanceled() { return !m_error.isNull(); } |
207 | 202 |
208 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu
fferingPolicy; } | 203 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu
fferingPolicy; } |
209 void setDataBufferingPolicy(DataBufferingPolicy); | 204 void setDataBufferingPolicy(DataBufferingPolicy); |
210 | 205 |
211 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() ==
PreloadNotReferenced; } | 206 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() ==
PreloadNotReferenced; } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 virtual bool isSafeToUnlock() const { return false; } | 301 virtual bool isSafeToUnlock() const { return false; } |
307 virtual void destroyDecodedDataIfPossible() { } | 302 virtual void destroyDecodedDataIfPossible() { } |
308 | 303 |
309 void markClientsFinished(); | 304 void markClientsFinished(); |
310 | 305 |
311 // Returns the memory dump name used for tracing. See Resource::onMemoryDump
. | 306 // Returns the memory dump name used for tracing. See Resource::onMemoryDump
. |
312 String getMemoryDumpName() const; | 307 String getMemoryDumpName() const; |
313 | 308 |
314 ResourceRequest m_resourceRequest; | 309 ResourceRequest m_resourceRequest; |
315 ResourceRequest m_revalidatingRequest; | 310 ResourceRequest m_revalidatingRequest; |
316 AtomicString m_accept; | |
317 PersistentWillBeMember<ResourceLoader> m_loader; | 311 PersistentWillBeMember<ResourceLoader> m_loader; |
318 ResourceLoaderOptions m_options; | 312 ResourceLoaderOptions m_options; |
319 | 313 |
320 ResourceResponse m_response; | 314 ResourceResponse m_response; |
321 double m_responseTimestamp; | 315 double m_responseTimestamp; |
322 | 316 |
323 RefPtr<SharedBuffer> m_data; | 317 RefPtr<SharedBuffer> m_data; |
324 Timer<Resource> m_cancelTimer; | 318 Timer<Resource> m_cancelTimer; |
325 | 319 |
326 private: | 320 private: |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 Resource::Type m_type; | 383 Resource::Type m_type; |
390 }; | 384 }; |
391 | 385 |
392 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 386 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
393 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType(
) == Resource::typeName, resource.getType() == Resource::typeName); \ | 387 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType(
) == Resource::typeName, resource.getType() == Resource::typeName); \ |
394 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R
esource>& ptr) { return to##typeName##Resource(ptr.get()); } | 388 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R
esource>& ptr) { return to##typeName##Resource(ptr.get()); } |
395 | 389 |
396 } // namespace blink | 390 } // namespace blink |
397 | 391 |
398 #endif | 392 #endif |
OLD | NEW |