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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // Used by the MemoryCache to reduce the memory consumption of the entry. | 240 // Used by the MemoryCache to reduce the memory consumption of the entry. |
241 void prune(); | 241 void prune(); |
242 | 242 |
243 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*)
const; | 243 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*)
const; |
244 | 244 |
245 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); | 245 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); |
246 | 246 |
247 protected: | 247 protected: |
248 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); | 248 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); |
249 | 249 |
250 virtual void checkNotify(); | 250 enum class MarkFinishedOption { |
| 251 ShouldMarkFinished, |
| 252 DoNotMarkFinished |
| 253 }; |
| 254 // MarkFinishedOption controls whether clients/observers are marked as |
| 255 // finished when notified of finish. |
| 256 virtual void checkNotify(MarkFinishedOption); |
| 257 void markClientFinished(ResourceClient*); |
251 | 258 |
252 virtual void destroyDecodedDataForFailedRevalidation() { } | 259 virtual void destroyDecodedDataForFailedRevalidation() { } |
253 | 260 |
254 void setEncodedSize(size_t); | 261 void setEncodedSize(size_t); |
255 void setDecodedSize(size_t); | 262 void setDecodedSize(size_t); |
256 void didAccessDecodedData(); | 263 void didAccessDecodedData(); |
257 | 264 |
258 void finishPendingClients(); | 265 void finishPendingClients(); |
259 | 266 |
260 virtual void didAddClient(ResourceClient*); | 267 virtual void didAddClient(ResourceClient*); |
(...skipping 15 matching lines...) Expand all Loading... |
276 } | 283 } |
277 | 284 |
278 ResourceRequest m_request; | 285 ResourceRequest m_request; |
279 ResourceResponse m_redirectResponse; | 286 ResourceResponse m_redirectResponse; |
280 }; | 287 }; |
281 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain;
} | 288 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain;
} |
282 | 289 |
283 virtual bool isSafeToUnlock() const { return false; } | 290 virtual bool isSafeToUnlock() const { return false; } |
284 virtual void destroyDecodedDataIfPossible() { } | 291 virtual void destroyDecodedDataIfPossible() { } |
285 | 292 |
286 virtual void markClientsAndObserversFinished(); | |
287 | |
288 // Returns the memory dump name used for tracing. See Resource::onMemoryDump
. | 293 // Returns the memory dump name used for tracing. See Resource::onMemoryDump
. |
289 String getMemoryDumpName() const; | 294 String getMemoryDumpName() const; |
290 | 295 |
291 const HashCountedSet<ResourceClient*>& clients() const { return m_clients; } | 296 const HashCountedSet<ResourceClient*>& clients() const { return m_clients; } |
292 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe
ringPolicy; } | 297 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe
ringPolicy; } |
293 | 298 |
294 void setCachePolicyBypassingCache(); | 299 void setCachePolicyBypassingCache(); |
295 void setLoFiStateOff(); | 300 void setLoFiStateOff(); |
296 | 301 |
297 RefPtr<SharedBuffer> m_data; | 302 RefPtr<SharedBuffer> m_data; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 378 |
374 Resource::Type m_type; | 379 Resource::Type m_type; |
375 }; | 380 }; |
376 | 381 |
377 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 382 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
378 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType(
) == Resource::typeName, resource.getType() == Resource::typeName); | 383 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType(
) == Resource::typeName, resource.getType() == Resource::typeName); |
379 | 384 |
380 } // namespace blink | 385 } // namespace blink |
381 | 386 |
382 #endif | 387 #endif |
OLD | NEW |