Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 // FIXME(crbug.com/352043): This is temporarily enabled even on RELEASE to diagn ose a wild crash. | 40 // FIXME(crbug.com/352043): This is temporarily enabled even on RELEASE to diagn ose a wild crash. |
| 41 #define ENABLE_RESOURCE_IS_DELETED_CHECK | 41 #define ENABLE_RESOURCE_IS_DELETED_CHECK |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 struct FetchInitiatorInfo; | 45 struct FetchInitiatorInfo; |
| 46 class CachedMetadata; | 46 class CachedMetadata; |
| 47 class ResourceClient; | 47 class ResourceClient; |
| 48 class ResourcePtrBase; | 48 class ResourcePtrBase; |
| 49 class ResourceFetcher; | 49 class ResourceFetcher; |
| 50 class ResourceTimingInfo; | |
| 50 class InspectorResource; | 51 class InspectorResource; |
| 51 class ResourceLoader; | 52 class ResourceLoader; |
| 52 class SecurityOrigin; | 53 class SecurityOrigin; |
| 53 class SharedBuffer; | 54 class SharedBuffer; |
| 54 | 55 |
| 55 // A resource that is held in the cache. Classes who want to use this object sho uld derive | 56 // A resource that is held in the cache. Classes who want to use this object sho uld derive |
| 56 // from ResourceClient, to get the function calls in case the requested data has arrived. | 57 // from ResourceClient, to get the function calls in case the requested data has arrived. |
| 57 // This class also does the actual communication with the loader to obtain the r esource from the network. | 58 // This class also does the actual communication with the loader to obtain the r esource from the network. |
| 58 class CORE_EXPORT Resource : public NoBaseWillBeGarbageCollectedFinalized<Resour ce> { | 59 class CORE_EXPORT Resource : public NoBaseWillBeGarbageCollectedFinalized<Resour ce> { |
| 59 WTF_MAKE_NONCOPYABLE(Resource); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(Reso urce); | 60 WTF_MAKE_NONCOPYABLE(Resource); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(Reso urce); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 SharedBuffer* resourceBuffer() const { return m_data.get(); } | 190 SharedBuffer* resourceBuffer() const { return m_data.get(); } |
| 190 void setResourceBuffer(PassRefPtr<SharedBuffer>); | 191 void setResourceBuffer(PassRefPtr<SharedBuffer>); |
| 191 | 192 |
| 192 virtual void willFollowRedirect(ResourceRequest&, const ResourceResponse&); | 193 virtual void willFollowRedirect(ResourceRequest&, const ResourceResponse&); |
| 193 | 194 |
| 194 virtual void updateRequest(const ResourceRequest&) { } | 195 virtual void updateRequest(const ResourceRequest&) { } |
| 195 virtual void responseReceived(const ResourceResponse&, PassOwnPtr<WebDataCon sumerHandle>); | 196 virtual void responseReceived(const ResourceResponse&, PassOwnPtr<WebDataCon sumerHandle>); |
| 196 void setResponse(const ResourceResponse& response) { m_response = response; } | 197 void setResponse(const ResourceResponse& response) { m_response = response; } |
| 197 const ResourceResponse& response() const { return m_response; } | 198 const ResourceResponse& response() const { return m_response; } |
| 198 | 199 |
| 200 virtual void reportResourceTiming(const ResourceTimingInfo&) { } | |
|
kinuko
2015/06/22 07:01:00
Can we add a comment? It's not obvious whom this m
Kunihiko Sakamoto
2015/06/22 09:49:56
Added a comment. Also renamed it to more verbose n
| |
| 201 | |
| 199 // Sets the serialized metadata retrieved from the platform's cache. | 202 // Sets the serialized metadata retrieved from the platform's cache. |
| 200 virtual void setSerializedCachedMetadata(const char*, size_t); | 203 virtual void setSerializedCachedMetadata(const char*, size_t); |
| 201 | 204 |
| 202 // This may return nullptr when the resource isn't cacheable. | 205 // This may return nullptr when the resource isn't cacheable. |
| 203 CachedMetadataHandler* cacheHandler(); | 206 CachedMetadataHandler* cacheHandler(); |
| 204 | 207 |
| 205 bool hasOneHandle() const; | 208 bool hasOneHandle() const; |
| 206 bool canDelete() const; | 209 bool canDelete() const; |
| 207 | 210 |
| 208 // List of acceptable MIME types separated by ",". | 211 // List of acceptable MIME types separated by ",". |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 const char* ResourceTypeName(Resource::Type); | 437 const char* ResourceTypeName(Resource::Type); |
| 435 #endif | 438 #endif |
| 436 | 439 |
| 437 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 440 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
| 438 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \ | 441 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \ |
| 439 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); } | 442 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); } |
| 440 | 443 |
| 441 } | 444 } |
| 442 | 445 |
| 443 #endif | 446 #endif |
| OLD | NEW |