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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class ResourceTimingInfo; | 49 class ResourceTimingInfo; |
50 | 50 |
51 enum FetchResourceType { | 51 enum FetchResourceType { |
52 FetchMainResource, | 52 FetchMainResource, |
53 FetchSubresource | 53 FetchSubresource |
54 }; | 54 }; |
55 | 55 |
56 class FetchContext : public NoBaseWillBeGarbageCollectedFinalized<FetchContext>
{ | 56 class FetchContext : public NoBaseWillBeGarbageCollectedFinalized<FetchContext>
{ |
57 WTF_MAKE_NONCOPYABLE(FetchContext); | 57 WTF_MAKE_NONCOPYABLE(FetchContext); |
58 public: | 58 public: |
59 static PassOwnPtrWillBeRawPtr<FetchContext> create() | 59 static FetchContext& nullInstance(); |
60 { | |
61 return adoptPtrWillBeNoop(new FetchContext); | |
62 } | |
63 | 60 |
64 virtual ~FetchContext() { } | 61 virtual ~FetchContext() { } |
65 DEFINE_INLINE_VIRTUAL_TRACE() { } | 62 DEFINE_INLINE_VIRTUAL_TRACE() { } |
66 | 63 |
| 64 virtual bool isLiveContext() { return false; } |
| 65 |
67 virtual void addAdditionalRequestHeaders(ResourceRequest&, FetchResourceType
); | 66 virtual void addAdditionalRequestHeaders(ResourceRequest&, FetchResourceType
); |
68 virtual void setFirstPartyForCookies(ResourceRequest&); | 67 virtual void setFirstPartyForCookies(ResourceRequest&); |
69 virtual CachePolicy cachePolicy() const; | 68 virtual CachePolicy cachePolicy() const; |
70 virtual ResourceRequestCachePolicy resourceRequestCachePolicy(const Resource
Request&, Resource::Type) const; | 69 virtual ResourceRequestCachePolicy resourceRequestCachePolicy(const Resource
Request&, Resource::Type) const; |
71 | 70 |
72 virtual void dispatchDidChangeResourcePriority(unsigned long identifier, Res
ourceLoadPriority, int intraPriorityValue); | 71 virtual void dispatchDidChangeResourcePriority(unsigned long identifier, Res
ourceLoadPriority, int intraPriorityValue); |
73 virtual void dispatchWillSendRequest(unsigned long identifier, ResourceReque
st&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& = Fetch
InitiatorInfo()); | 72 virtual void dispatchWillSendRequest(unsigned long identifier, ResourceReque
st&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& = Fetch
InitiatorInfo()); |
74 virtual void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&,
const ResourceResponse&); | 73 virtual void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&,
const ResourceResponse&); |
75 virtual void dispatchDidReceiveResponse(unsigned long identifier, const Reso
urceResponse&, ResourceLoader* = 0); | 74 virtual void dispatchDidReceiveResponse(unsigned long identifier, const Reso
urceResponse&, ResourceLoader* = 0); |
76 virtual void dispatchDidReceiveData(unsigned long identifier, const char* da
ta, int dataLength, int encodedDataLength); | 75 virtual void dispatchDidReceiveData(unsigned long identifier, const char* da
ta, int dataLength, int encodedDataLength); |
(...skipping 28 matching lines...) Expand all Loading... |
105 virtual void addClientHintsIfNecessary(FetchRequest&); | 104 virtual void addClientHintsIfNecessary(FetchRequest&); |
106 virtual void addCSPHeaderIfNecessary(Resource::Type, FetchRequest&); | 105 virtual void addCSPHeaderIfNecessary(Resource::Type, FetchRequest&); |
107 | 106 |
108 protected: | 107 protected: |
109 FetchContext() { } | 108 FetchContext() { } |
110 }; | 109 }; |
111 | 110 |
112 } | 111 } |
113 | 112 |
114 #endif | 113 #endif |
OLD | NEW |