| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef FetchContext_h | 31 #ifndef FetchContext_h |
| 32 #define FetchContext_h | 32 #define FetchContext_h |
| 33 | 33 |
| 34 #include "core/fetch/CachePolicy.h" | 34 #include "core/fetch/CachePolicy.h" |
| 35 #include "core/fetch/FetchInitiatorInfo.h" | 35 #include "core/fetch/FetchInitiatorInfo.h" |
| 36 #include "core/fetch/Resource.h" | 36 #include "core/fetch/Resource.h" |
| 37 #include "platform/heap/Handle.h" |
| 37 #include "platform/network/ResourceLoadPriority.h" | 38 #include "platform/network/ResourceLoadPriority.h" |
| 38 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 class Document; | 43 class Document; |
| 43 class DocumentLoader; | 44 class DocumentLoader; |
| 44 class LocalFrame; | 45 class LocalFrame; |
| 45 class KURL; | 46 class KURL; |
| 46 class Page; | 47 class Page; |
| 47 class ResourceError; | 48 class ResourceError; |
| 48 class ResourceLoader; | 49 class ResourceLoader; |
| 49 class ResourceResponse; | 50 class ResourceResponse; |
| 50 class ResourceRequest; | 51 class ResourceRequest; |
| 51 | 52 |
| 52 enum FetchResourceType { | 53 enum FetchResourceType { |
| 53 FetchMainResource, | 54 FetchMainResource, |
| 54 FetchSubresource | 55 FetchSubresource |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 class FetchContext { | 58 class FetchContext : public NoBaseWillBeGarbageCollectedFinalized<FetchContext>
{ |
| 58 WTF_MAKE_NONCOPYABLE(FetchContext); | 59 WTF_MAKE_NONCOPYABLE(FetchContext); |
| 59 public: | 60 public: |
| 60 static FetchContext& nullInstance(); | 61 static FetchContext& nullInstance(); |
| 61 | 62 |
| 62 FetchContext() { } | 63 FetchContext() { } |
| 63 virtual ~FetchContext() { } | 64 virtual ~FetchContext() { } |
| 65 virtual void trace(Visitor*) { } |
| 64 | 66 |
| 65 virtual void reportLocalLoadFailed(const KURL&); | 67 virtual void reportLocalLoadFailed(const KURL&); |
| 66 virtual void addAdditionalRequestHeaders(Document*, ResourceRequest&, FetchR
esourceType); | 68 virtual void addAdditionalRequestHeaders(Document*, ResourceRequest&, FetchR
esourceType); |
| 67 virtual void setFirstPartyForCookies(ResourceRequest&); | 69 virtual void setFirstPartyForCookies(ResourceRequest&); |
| 68 virtual CachePolicy cachePolicy(Document*) const; | 70 virtual CachePolicy cachePolicy(Document*) const; |
| 69 | 71 |
| 70 virtual void dispatchDidChangeResourcePriority(unsigned long identifier, Res
ourceLoadPriority, int intraPriorityValue); | 72 virtual void dispatchDidChangeResourcePriority(unsigned long identifier, Res
ourceLoadPriority, int intraPriorityValue); |
| 71 virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long identifi
er, ResourceRequest&, const ResourceResponse& redirectResponse, const FetchIniti
atorInfo& = FetchInitiatorInfo()); | 73 virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long identifi
er, ResourceRequest&, const ResourceResponse& redirectResponse, const FetchIniti
atorInfo& = FetchInitiatorInfo()); |
| 72 virtual void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&,
const ResourceResponse&); | 74 virtual void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&,
const ResourceResponse&); |
| 73 virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long ident
ifier, const ResourceResponse&, ResourceLoader* = 0); | 75 virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long ident
ifier, const ResourceResponse&, ResourceLoader* = 0); |
| 74 virtual void dispatchDidReceiveData(DocumentLoader*, unsigned long identifie
r, const char* data, int dataLength, int encodedDataLength); | 76 virtual void dispatchDidReceiveData(DocumentLoader*, unsigned long identifie
r, const char* data, int dataLength, int encodedDataLength); |
| 75 virtual void dispatchDidDownloadData(DocumentLoader*, unsigned long identifi
er, int dataLength, int encodedDataLength); | 77 virtual void dispatchDidDownloadData(DocumentLoader*, unsigned long identifi
er, int dataLength, int encodedDataLength); |
| 76 virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identif
ier, double finishTime, int64_t encodedDataLength); | 78 virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identif
ier, double finishTime, int64_t encodedDataLength); |
| 77 virtual void dispatchDidFail(DocumentLoader*, unsigned long identifier, cons
t ResourceError&); | 79 virtual void dispatchDidFail(DocumentLoader*, unsigned long identifier, cons
t ResourceError&); |
| 78 virtual void sendRemainingDelegateMessages(DocumentLoader*, unsigned long id
entifier, const ResourceResponse&, int dataLength); | 80 virtual void sendRemainingDelegateMessages(DocumentLoader*, unsigned long id
entifier, const ResourceResponse&, int dataLength); |
| 79 }; | 81 }; |
| 80 | 82 |
| 81 } | 83 } |
| 82 | 84 |
| 83 #endif | 85 #endif |
| OLD | NEW |