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 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "platform/network/ResourceError.h" | 35 #include "platform/network/ResourceError.h" |
36 #include "platform/network/ResourceLoadPriority.h" | 36 #include "platform/network/ResourceLoadPriority.h" |
37 #include "platform/network/ResourceRequest.h" | 37 #include "platform/network/ResourceRequest.h" |
38 #include "platform/network/ResourceResponse.h" | 38 #include "platform/network/ResourceResponse.h" |
39 #include "platform/tracing/web_process_memory_dump.h" | 39 #include "platform/tracing/web_process_memory_dump.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/WTFString.h" | 46 #include "wtf/text/WTFString.h" |
46 #include <memory> | 47 #include <memory> |
47 | 48 |
48 namespace blink { | 49 namespace blink { |
49 | 50 |
50 struct FetchInitiatorInfo; | |
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 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, | 341 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, |
342 WebProcessMemoryDump*) const; | 342 WebProcessMemoryDump*) const; |
343 | 343 |
344 // If this Resource is ImageResource and has the Lo-Fi response headers or is | 344 // If this Resource is ImageResource and has the Lo-Fi response headers or is |
345 // a placeholder, reload the full original image with the Lo-Fi state set to | 345 // a placeholder, reload the full original image with the Lo-Fi state set to |
346 // off and optionally bypassing the cache. | 346 // off and optionally bypassing the cache. |
347 virtual void reloadIfLoFiOrPlaceholderImage(ResourceFetcher*, | 347 virtual void reloadIfLoFiOrPlaceholderImage(ResourceFetcher*, |
348 ReloadLoFiOrPlaceholderPolicy) {} | 348 ReloadLoFiOrPlaceholderPolicy) {} |
349 | 349 |
350 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); | 350 static const char* resourceTypeToString( |
| 351 Type, |
| 352 const AtomicString& fetchInitiatorName); |
351 | 353 |
352 protected: | 354 protected: |
353 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); | 355 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); |
354 | 356 |
355 virtual void checkNotify(); | 357 virtual void checkNotify(); |
356 | 358 |
357 void markClientFinished(ResourceClient*); | 359 void markClientFinished(ResourceClient*); |
358 | 360 |
359 virtual bool hasClientsOrObservers() const { | 361 virtual bool hasClientsOrObservers() const { |
360 return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || | 362 return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 }; | 507 }; |
506 | 508 |
507 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ | 509 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ |
508 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ | 510 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ |
509 resource->getType() == Resource::typeName, \ | 511 resource->getType() == Resource::typeName, \ |
510 resource.getType() == Resource::typeName); | 512 resource.getType() == Resource::typeName); |
511 | 513 |
512 } // namespace blink | 514 } // namespace blink |
513 | 515 |
514 #endif | 516 #endif |
OLD | NEW |