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