| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 LinkPrefetch, | 70 LinkPrefetch, |
| 71 LinkPreload, | 71 LinkPreload, |
| 72 TextTrack, | 72 TextTrack, |
| 73 ImportResource, | 73 ImportResource, |
| 74 Media, // Audio or video file requested by a HTML5 media element | 74 Media, // Audio or video file requested by a HTML5 media element |
| 75 Manifest | 75 Manifest |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 enum Status { | 78 enum Status { |
| 79 NotStarted, | 79 NotStarted, |
| 80 LoadStartScheduled, // scheduled but not yet started, only used by fonts
. | |
| 81 Pending, // load in progress | 80 Pending, // load in progress |
| 82 Cached, // load completed successfully | 81 Cached, // load completed successfully |
| 83 LoadError, | 82 LoadError, |
| 84 DecodeError | 83 DecodeError |
| 85 }; | 84 }; |
| 86 | 85 |
| 87 // Exposed for testing. | 86 // Exposed for testing. |
| 88 static Resource* create(const ResourceRequest& request, Type type, const Res
ourceLoaderOptions& options = ResourceLoaderOptions()) | 87 static Resource* create(const ResourceRequest& request, Type type, const Res
ourceLoaderOptions& options = ResourceLoaderOptions()) |
| 89 { | 88 { |
| 90 return new Resource(request, type, options); | 89 return new Resource(request, type, options); |
| 91 } | 90 } |
| 92 virtual ~Resource(); | 91 virtual ~Resource(); |
| 93 | 92 |
| 94 virtual void removedFromMemoryCache(); | 93 virtual void removedFromMemoryCache(); |
| 95 DECLARE_VIRTUAL_TRACE(); | 94 DECLARE_VIRTUAL_TRACE(); |
| 96 | 95 |
| 97 virtual void load(ResourceFetcher*); | 96 void load(ResourceFetcher*); |
| 98 | 97 |
| 99 virtual void setEncoding(const String&) { } | 98 virtual void setEncoding(const String&) { } |
| 100 virtual String encoding() const { return String(); } | 99 virtual String encoding() const { return String(); } |
| 101 virtual void appendData(const char*, size_t); | 100 virtual void appendData(const char*, size_t); |
| 102 virtual void error(Resource::Status); | 101 virtual void error(Resource::Status); |
| 103 virtual void setCORSFailed() { } | 102 virtual void setCORSFailed() { } |
| 104 | 103 |
| 105 void setNeedsSynchronousCacheHit(bool needsSynchronousCacheHit) { m_needsSyn
chronousCacheHit = needsSynchronousCacheHit; } | 104 void setNeedsSynchronousCacheHit(bool needsSynchronousCacheHit) { m_needsSyn
chronousCacheHit = needsSynchronousCacheHit; } |
| 106 | 105 |
| 107 void setLinkPreload(bool isLinkPreload) { m_linkPreload = isLinkPreload; } | 106 void setLinkPreload(bool isLinkPreload) { m_linkPreload = isLinkPreload; } |
| 108 bool isLinkPreload() const { return m_linkPreload; } | 107 bool isLinkPreload() const { return m_linkPreload; } |
| 109 | 108 |
| 110 void setResourceError(const ResourceError& error) { m_error = error; } | 109 void setResourceError(const ResourceError& error) { m_error = error; } |
| 111 const ResourceError& resourceError() const { return m_error; } | 110 const ResourceError& resourceError() const { return m_error; } |
| 112 | 111 |
| 113 void setIdentifier(unsigned long identifier) { m_identifier = identifier; } | 112 void setIdentifier(unsigned long identifier) { m_identifier = identifier; } |
| 114 unsigned long identifier() const { return m_identifier; } | 113 unsigned long identifier() const { return m_identifier; } |
| 115 | 114 |
| 116 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return false; } | 115 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return false; } |
| 117 | 116 |
| 118 const ResourceRequest& resourceRequest() const { return m_resourceRequest; } | 117 const ResourceRequest& resourceRequest() const { return m_resourceRequest; } |
| 119 const ResourceRequest& lastResourceRequest() const; | 118 const ResourceRequest& lastResourceRequest() const; |
| 120 | 119 |
| 121 void setRevalidatingRequest(const ResourceRequest& request) { m_revalidating
Request = request; } | 120 void setRevalidatingRequest(const ResourceRequest&); |
| 122 | 121 |
| 123 // This url can have a fragment, but it can match resources that differ by t
he fragment only. | 122 // This url can have a fragment, but it can match resources that differ by t
he fragment only. |
| 124 const KURL& url() const { return m_resourceRequest.url();} | 123 const KURL& url() const { return m_resourceRequest.url();} |
| 125 Type getType() const { return static_cast<Type>(m_type); } | 124 Type getType() const { return static_cast<Type>(m_type); } |
| 126 const ResourceLoaderOptions& options() const { return m_options; } | 125 const ResourceLoaderOptions& options() const { return m_options; } |
| 127 ResourceLoaderOptions& mutableOptions() { return m_options; } | 126 ResourceLoaderOptions& mutableOptions() { return m_options; } |
| 128 | 127 |
| 129 void didChangePriority(ResourceLoadPriority, int intraPriorityValue); | 128 void didChangePriority(ResourceLoadPriority, int intraPriorityValue); |
| 130 virtual ResourcePriority priorityFromObservers() { return ResourcePriority()
; } | 129 virtual ResourcePriority priorityFromObservers() { return ResourcePriority()
; } |
| 131 | 130 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 371 |
| 373 Resource::Type m_type; | 372 Resource::Type m_type; |
| 374 }; | 373 }; |
| 375 | 374 |
| 376 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 375 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
| 377 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType(
) == Resource::typeName, resource.getType() == Resource::typeName); | 376 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType(
) == Resource::typeName, resource.getType() == Resource::typeName); |
| 378 | 377 |
| 379 } // namespace blink | 378 } // namespace blink |
| 380 | 379 |
| 381 #endif | 380 #endif |
| OLD | NEW |