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 | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 rights reserved. | 6 rights reserved. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
11 version 2 of the License, or (at your option) any later version. | 11 version 2 of the License, or (at your option) any later version. |
12 | 12 |
13 This library is distributed in the hope that it will be useful, | 13 This library is distributed in the hope that it will be useful, |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 Library General Public License for more details. | 16 Library General Public License for more details. |
17 | 17 |
18 You should have received a copy of the GNU Library General Public License | 18 You should have received a copy of the GNU Library General Public License |
19 along with this library; see the file COPYING.LIB. If not, write to | 19 along with this library; see the file COPYING.LIB. If not, write to |
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 Boston, MA 02110-1301, USA. | 21 Boston, MA 02110-1301, USA. |
22 */ | 22 */ |
23 | 23 |
24 #ifndef Resource_h | 24 #ifndef Resource_h |
25 #define Resource_h | 25 #define Resource_h |
26 | 26 |
27 #include "core/CoreExport.h" | |
28 #include "core/fetch/CachedMetadataHandler.h" | |
29 #include "core/fetch/IntegrityMetadata.h" | |
30 #include "core/fetch/ResourceLoaderOptions.h" | |
31 #include "core/fetch/ResourceStatus.h" | |
32 #include "platform/MemoryCoordinator.h" | 27 #include "platform/MemoryCoordinator.h" |
| 28 #include "platform/PlatformExport.h" |
33 #include "platform/SharedBuffer.h" | 29 #include "platform/SharedBuffer.h" |
34 #include "platform/Timer.h" | 30 #include "platform/Timer.h" |
35 #include "platform/instrumentation/tracing/web_process_memory_dump.h" | 31 #include "platform/instrumentation/tracing/web_process_memory_dump.h" |
| 32 #include "platform/loader/fetch/CachedMetadataHandler.h" |
| 33 #include "platform/loader/fetch/IntegrityMetadata.h" |
| 34 #include "platform/loader/fetch/ResourceLoaderOptions.h" |
| 35 #include "platform/loader/fetch/ResourceStatus.h" |
36 #include "platform/network/ResourceError.h" | 36 #include "platform/network/ResourceError.h" |
37 #include "platform/network/ResourceLoadPriority.h" | 37 #include "platform/network/ResourceLoadPriority.h" |
38 #include "platform/network/ResourceRequest.h" | 38 #include "platform/network/ResourceRequest.h" |
39 #include "platform/network/ResourceResponse.h" | 39 #include "platform/network/ResourceResponse.h" |
40 #include "public/platform/WebDataConsumerHandle.h" | 40 #include "public/platform/WebDataConsumerHandle.h" |
41 #include "wtf/Allocator.h" | 41 #include "wtf/Allocator.h" |
42 #include "wtf/AutoReset.h" | 42 #include "wtf/AutoReset.h" |
43 #include "wtf/HashCountedSet.h" | 43 #include "wtf/HashCountedSet.h" |
44 #include "wtf/HashSet.h" | 44 #include "wtf/HashSet.h" |
45 #include "wtf/text/AtomicString.h" | 45 #include "wtf/text/AtomicString.h" |
46 #include "wtf/text/WTFString.h" | 46 #include "wtf/text/WTFString.h" |
47 #include <memory> | 47 #include <memory> |
48 | 48 |
49 namespace blink { | 49 namespace blink { |
50 | 50 |
51 class FetchRequest; | 51 class FetchRequest; |
52 class ResourceClient; | 52 class ResourceClient; |
53 class ResourceFetcher; | 53 class ResourceFetcher; |
54 class ResourceTimingInfo; | 54 class ResourceTimingInfo; |
55 class ResourceLoader; | 55 class ResourceLoader; |
56 class SecurityOrigin; | 56 class SecurityOrigin; |
57 | 57 |
58 // A resource that is held in the cache. Classes who want to use this object | 58 // A resource that is held in the cache. Classes who want to use this object |
59 // should derive from ResourceClient, to get the function calls in case the | 59 // should derive from ResourceClient, to get the function calls in case the |
60 // requested data has arrived. This class also does the actual communication | 60 // requested data has arrived. This class also does the actual communication |
61 // with the loader to obtain the resource from the network. | 61 // with the loader to obtain the resource from the network. |
62 class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>, | 62 class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>, |
63 public MemoryCoordinatorClient { | 63 public MemoryCoordinatorClient { |
64 USING_GARBAGE_COLLECTED_MIXIN(Resource); | 64 USING_GARBAGE_COLLECTED_MIXIN(Resource); |
65 WTF_MAKE_NONCOPYABLE(Resource); | 65 WTF_MAKE_NONCOPYABLE(Resource); |
66 | 66 |
67 public: | 67 public: |
68 // |Type| enum values are used in UMAs, so do not change the values of | 68 // |Type| enum values are used in UMAs, so do not change the values of |
69 // existing |Type|. When adding a new |Type|, append it at the end and update | 69 // existing |Type|. When adding a new |Type|, append it at the end and update |
70 // |kLastResourceType|. | 70 // |kLastResourceType|. |
71 enum Type { | 71 enum Type { |
72 MainResource, | 72 MainResource, |
73 Image, | 73 Image, |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 }; | 510 }; |
511 | 511 |
512 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 512 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
513 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ | 513 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ |
514 resource->getType() == Resource::typeName, \ | 514 resource->getType() == Resource::typeName, \ |
515 resource.getType() == Resource::typeName); | 515 resource.getType() == Resource::typeName); |
516 | 516 |
517 } // namespace blink | 517 } // namespace blink |
518 | 518 |
519 #endif | 519 #endif |
OLD | NEW |