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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #ifndef Resource_h | 23 #ifndef Resource_h |
24 #define Resource_h | 24 #define Resource_h |
25 | 25 |
26 #include "core/fetch/ResourceLoaderOptions.h" | 26 #include "core/fetch/ResourceLoaderOptions.h" |
27 #include "platform/Timer.h" | 27 #include "platform/Timer.h" |
28 #include "platform/network/ResourceError.h" | 28 #include "platform/network/ResourceError.h" |
29 #include "platform/network/ResourceLoadPriority.h" | 29 #include "platform/network/ResourceLoadPriority.h" |
30 #include "platform/network/ResourceRequest.h" | 30 #include "platform/network/ResourceRequest.h" |
31 #include "platform/network/ResourceResponse.h" | 31 #include "platform/network/ResourceResponse.h" |
| 32 #include "public/platform/WebDataConsumerHandle.h" |
32 #include "wtf/HashCountedSet.h" | 33 #include "wtf/HashCountedSet.h" |
33 #include "wtf/HashSet.h" | 34 #include "wtf/HashSet.h" |
34 #include "wtf/OwnPtr.h" | 35 #include "wtf/OwnPtr.h" |
35 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
36 | 37 |
37 // FIXME(crbug.com/352043): This is temporarily enabled even on RELEASE to diagn
ose a wild crash. | 38 // FIXME(crbug.com/352043): This is temporarily enabled even on RELEASE to diagn
ose a wild crash. |
38 #define ENABLE_RESOURCE_IS_DELETED_CHECK | 39 #define ENABLE_RESOURCE_IS_DELETED_CHECK |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool passesAccessControlCheck(SecurityOrigin*, String& errorDescription); | 183 bool passesAccessControlCheck(SecurityOrigin*, String& errorDescription); |
183 | 184 |
184 void clearLoader(); | 185 void clearLoader(); |
185 | 186 |
186 SharedBuffer* resourceBuffer() const { return m_data.get(); } | 187 SharedBuffer* resourceBuffer() const { return m_data.get(); } |
187 void setResourceBuffer(PassRefPtr<SharedBuffer>); | 188 void setResourceBuffer(PassRefPtr<SharedBuffer>); |
188 | 189 |
189 virtual void willFollowRedirect(ResourceRequest&, const ResourceResponse&); | 190 virtual void willFollowRedirect(ResourceRequest&, const ResourceResponse&); |
190 | 191 |
191 virtual void updateRequest(const ResourceRequest&) { } | 192 virtual void updateRequest(const ResourceRequest&) { } |
192 virtual void responseReceived(const ResourceResponse&); | 193 virtual void responseReceived(const ResourceResponse&, PassOwnPtr<WebDataCon
sumerHandle>); |
193 void setResponse(const ResourceResponse& response) { m_response = response;
} | 194 void setResponse(const ResourceResponse& response) { m_response = response;
} |
194 const ResourceResponse& response() const { return m_response; } | 195 const ResourceResponse& response() const { return m_response; } |
195 | 196 |
196 // Sets the serialized metadata retrieved from the platform's cache. | 197 // Sets the serialized metadata retrieved from the platform's cache. |
197 void setSerializedCachedMetadata(const char*, size_t); | 198 void setSerializedCachedMetadata(const char*, size_t); |
198 | 199 |
199 // Caches the given metadata in association with this resource and suggests | 200 // Caches the given metadata in association with this resource and suggests |
200 // that the platform persist it. The dataTypeID is a pseudo-randomly chosen | 201 // that the platform persist it. The dataTypeID is a pseudo-randomly chosen |
201 // identifier that is used to distinguish data generated by the caller. | 202 // identifier that is used to distinguish data generated by the caller. |
202 void setCachedMetadata(unsigned dataTypeID, const char*, size_t, MetadataCac
heType = SendToPlatform); | 203 void setCachedMetadata(unsigned dataTypeID, const char*, size_t, MetadataCac
heType = SendToPlatform); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 const char* ResourceTypeName(Resource::Type); | 421 const char* ResourceTypeName(Resource::Type); |
421 #endif | 422 #endif |
422 | 423 |
423 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 424 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
424 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() =
= Resource::typeName, resource.type() == Resource::typeName); \ | 425 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() =
= Resource::typeName, resource.type() == Resource::typeName); \ |
425 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource
>& ptr) { return to##typeName##Resource(ptr.get()); } | 426 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource
>& ptr) { return to##typeName##Resource(ptr.get()); } |
426 | 427 |
427 } | 428 } |
428 | 429 |
429 #endif | 430 #endif |
OLD | NEW |