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) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
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 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if (header.startsWith(headerPrefixesToIgnoreAfterRevalidation[i], TextCa
seInsensitive)) | 89 if (header.startsWith(headerPrefixesToIgnoreAfterRevalidation[i], TextCa
seInsensitive)) |
90 return false; | 90 return false; |
91 } | 91 } |
92 return true; | 92 return true; |
93 } | 93 } |
94 | 94 |
95 DEFINE_DEBUG_ONLY_GLOBAL(RefCountedLeakCounter, cachedResourceLeakCounter, ("Res
ource")); | 95 DEFINE_DEBUG_ONLY_GLOBAL(RefCountedLeakCounter, cachedResourceLeakCounter, ("Res
ource")); |
96 | 96 |
97 class Resource::CacheHandler : public CachedMetadataHandler { | 97 class Resource::CacheHandler : public CachedMetadataHandler { |
98 public: | 98 public: |
99 static PassOwnPtr<CacheHandler> create(Resource* resource) | 99 static PassOwnPtrWillBeRawPtr<CacheHandler> create(Resource* resource) |
100 { | 100 { |
101 return adoptPtr(new CacheHandler(resource)); | 101 return adoptPtrWillBeNoop(new CacheHandler(resource)); |
102 } | 102 } |
103 ~CacheHandler() override { } | 103 ~CacheHandler() override { } |
| 104 DECLARE_VIRTUAL_TRACE(); |
104 void setCachedMetadata(unsigned, const char*, size_t, CacheType) override; | 105 void setCachedMetadata(unsigned, const char*, size_t, CacheType) override; |
105 void clearCachedMetadata(CacheType) override; | 106 void clearCachedMetadata(CacheType) override; |
106 CachedMetadata* cachedMetadata(unsigned) const override; | 107 CachedMetadata* cachedMetadata(unsigned) const override; |
107 String encoding() const override; | 108 String encoding() const override; |
108 | 109 |
109 private: | 110 private: |
110 explicit CacheHandler(Resource*); | 111 explicit CacheHandler(Resource*); |
111 Resource* m_resource; | 112 RawPtrWillBeMember<Resource> m_resource; |
112 }; | 113 }; |
113 | 114 |
114 Resource::CacheHandler::CacheHandler(Resource* resource) | 115 Resource::CacheHandler::CacheHandler(Resource* resource) |
115 : m_resource(resource) | 116 : m_resource(resource) |
116 { | 117 { |
117 } | 118 } |
118 | 119 |
| 120 DEFINE_TRACE(Resource::CacheHandler) |
| 121 { |
| 122 #if ENABLE(OILPAN) |
| 123 visitor->trace(m_resource); |
| 124 #endif |
| 125 CachedMetadataHandler::trace(visitor); |
| 126 } |
| 127 |
119 void Resource::CacheHandler::setCachedMetadata(unsigned dataTypeID, const char*
data, size_t size, CacheType type) | 128 void Resource::CacheHandler::setCachedMetadata(unsigned dataTypeID, const char*
data, size_t size, CacheType type) |
120 { | 129 { |
121 m_resource->setCachedMetadata(dataTypeID, data, size, type); | 130 m_resource->setCachedMetadata(dataTypeID, data, size, type); |
122 } | 131 } |
123 | 132 |
124 void Resource::CacheHandler::clearCachedMetadata(CacheType type) | 133 void Resource::CacheHandler::clearCachedMetadata(CacheType type) |
125 { | 134 { |
126 m_resource->clearCachedMetadata(type); | 135 m_resource->clearCachedMetadata(type); |
127 } | 136 } |
128 | 137 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 210 |
202 void Resource::dispose() | 211 void Resource::dispose() |
203 { | 212 { |
204 } | 213 } |
205 | 214 |
206 DEFINE_TRACE(Resource) | 215 DEFINE_TRACE(Resource) |
207 { | 216 { |
208 visitor->trace(m_loader); | 217 visitor->trace(m_loader); |
209 visitor->trace(m_resourceToRevalidate); | 218 visitor->trace(m_resourceToRevalidate); |
210 visitor->trace(m_proxyResource); | 219 visitor->trace(m_proxyResource); |
| 220 #if ENABLE(OILPAN) |
| 221 visitor->trace(m_cacheHandler); |
| 222 #endif |
211 } | 223 } |
212 | 224 |
213 void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& optio
ns) | 225 void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& optio
ns) |
214 { | 226 { |
215 m_options = options; | 227 m_options = options; |
216 m_loading = true; | 228 m_loading = true; |
217 | 229 |
218 if (!accept().isEmpty()) | 230 if (!accept().isEmpty()) |
219 m_resourceRequest.setHTTPAccept(accept()); | 231 m_resourceRequest.setHTTPAccept(accept()); |
220 | 232 |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 return "ImportResource"; | 1090 return "ImportResource"; |
1079 case Resource::Media: | 1091 case Resource::Media: |
1080 return "Media"; | 1092 return "Media"; |
1081 } | 1093 } |
1082 ASSERT_NOT_REACHED(); | 1094 ASSERT_NOT_REACHED(); |
1083 return "Unknown"; | 1095 return "Unknown"; |
1084 } | 1096 } |
1085 #endif // !LOG_DISABLED | 1097 #endif // !LOG_DISABLED |
1086 | 1098 |
1087 } // namespace blink | 1099 } // namespace blink |
OLD | NEW |