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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 CSSStyleSheet, | 64 CSSStyleSheet, |
65 Script, | 65 Script, |
66 Font, | 66 Font, |
67 Raw, | 67 Raw, |
68 SVGDocument, | 68 SVGDocument, |
69 XSLStyleSheet, | 69 XSLStyleSheet, |
70 LinkPrefetch, | 70 LinkPrefetch, |
71 LinkSubresource, | 71 LinkSubresource, |
72 TextTrack, | 72 TextTrack, |
73 Shader, | 73 Shader, |
74 ImportResource | 74 ImportResource, |
| 75 Media // Audio or video file requested by a HTML5 media element |
75 }; | 76 }; |
76 | 77 |
77 enum Status { | 78 enum Status { |
78 Unknown, // let cache decide what to do with it | 79 Unknown, // let cache decide what to do with it |
79 Pending, // only partially loaded | 80 Pending, // only partially loaded |
80 Cached, // regular case | 81 Cached, // regular case |
81 LoadError, | 82 LoadError, |
82 DecodeError | 83 DecodeError |
83 }; | 84 }; |
84 | 85 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 virtual bool stillNeedsLoad() const { return false; } | 146 virtual bool stillNeedsLoad() const { return false; } |
146 | 147 |
147 ResourceLoader* loader() const { return m_loader.get(); } | 148 ResourceLoader* loader() const { return m_loader.get(); } |
148 | 149 |
149 virtual bool isImage() const { return false; } | 150 virtual bool isImage() const { return false; } |
150 bool ignoreForRequestCount() const | 151 bool ignoreForRequestCount() const |
151 { | 152 { |
152 return type() == MainResource | 153 return type() == MainResource |
153 || type() == LinkPrefetch | 154 || type() == LinkPrefetch |
154 || type() == LinkSubresource | 155 || type() == LinkSubresource |
155 || type() == Raw; | 156 || type() == Media |
| 157 || type() == Raw |
| 158 || type() == TextTrack; |
156 } | 159 } |
157 | 160 |
158 // Computes the status of an object after loading. | 161 // Computes the status of an object after loading. |
159 // Updates the expire date on the cache entry file | 162 // Updates the expire date on the cache entry file |
160 void finish(double finishTime = 0.0); | 163 void finish(double finishTime = 0.0); |
161 | 164 |
162 // FIXME: Remove the stringless variant once all the callsites' error messag
es are updated. | 165 // FIXME: Remove the stringless variant once all the callsites' error messag
es are updated. |
163 bool passesAccessControlCheck(SecurityOrigin*); | 166 bool passesAccessControlCheck(SecurityOrigin*); |
164 bool passesAccessControlCheck(SecurityOrigin*, String& errorDescription); | 167 bool passesAccessControlCheck(SecurityOrigin*, String& errorDescription); |
165 | 168 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 const char* ResourceTypeName(Resource::Type); | 392 const char* ResourceTypeName(Resource::Type); |
390 #endif | 393 #endif |
391 | 394 |
392 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 395 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
393 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() =
= Resource::typeName, resource.type() == Resource::typeName); \ | 396 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() =
= Resource::typeName, resource.type() == Resource::typeName); \ |
394 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource
>& ptr) { return to##typeName##Resource(ptr.get()); } | 397 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource
>& ptr) { return to##typeName##Resource(ptr.get()); } |
395 | 398 |
396 } | 399 } |
397 | 400 |
398 #endif | 401 #endif |
OLD | NEW |