| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class ResourceLoader; | 50 class ResourceLoader; |
| 51 class SecurityOrigin; | 51 class SecurityOrigin; |
| 52 class SharedBuffer; | 52 class SharedBuffer; |
| 53 | 53 |
| 54 // A resource that is held in the cache. Classes who want to use this object sho
uld derive | 54 // A resource that is held in the cache. Classes who want to use this object sho
uld derive |
| 55 // from ResourceClient, to get the function calls in case the requested data has
arrived. | 55 // from ResourceClient, to get the function calls in case the requested data has
arrived. |
| 56 // This class also does the actual communication with the loader to obtain the r
esource from the network. | 56 // This class also does the actual communication with the loader to obtain the r
esource from the network. |
| 57 class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource> { | 57 class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource> { |
| 58 WTF_MAKE_NONCOPYABLE(Resource); | 58 WTF_MAKE_NONCOPYABLE(Resource); |
| 59 public: | 59 public: |
| 60 // |Type| enum values are used in UMAs, so do not change the values of |
| 61 // existing |Type|. When adding a new |Type|, append it at the end and |
| 62 // update |kLastResourceType|. |
| 60 enum Type { | 63 enum Type { |
| 61 MainResource, | 64 MainResource, |
| 62 Image, | 65 Image, |
| 63 CSSStyleSheet, | 66 CSSStyleSheet, |
| 64 Script, | 67 Script, |
| 65 Font, | 68 Font, |
| 66 Raw, | 69 Raw, |
| 67 SVGDocument, | 70 SVGDocument, |
| 68 XSLStyleSheet, | 71 XSLStyleSheet, |
| 69 LinkPrefetch, | 72 LinkPrefetch, |
| 70 LinkPreload, | 73 LinkPreload, |
| 71 TextTrack, | 74 TextTrack, |
| 72 ImportResource, | 75 ImportResource, |
| 73 Media, // Audio or video file requested by a HTML5 media element | 76 Media, // Audio or video file requested by a HTML5 media element |
| 74 Manifest | 77 Manifest |
| 75 }; | 78 }; |
| 79 static const int kLastResourceType = Manifest + 1; |
| 76 | 80 |
| 77 enum Status { | 81 enum Status { |
| 78 NotStarted, | 82 NotStarted, |
| 79 Pending, // load in progress | 83 Pending, // load in progress |
| 80 Cached, // load completed successfully | 84 Cached, // load completed successfully |
| 81 LoadError, | 85 LoadError, |
| 82 DecodeError | 86 DecodeError |
| 83 }; | 87 }; |
| 84 | 88 |
| 85 // Exposed for testing. | 89 // Exposed for testing. |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 371 |
| 368 Resource::Type m_type; | 372 Resource::Type m_type; |
| 369 }; | 373 }; |
| 370 | 374 |
| 371 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 375 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
| 372 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); |
| 373 | 377 |
| 374 } // namespace blink | 378 } // namespace blink |
| 375 | 379 |
| 376 #endif | 380 #endif |
| OLD | NEW |