| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef FetchRequestData_h | 5 #ifndef FetchRequestData_h |
| 6 #define FetchRequestData_h | 6 #define FetchRequestData_h |
| 7 | 7 |
| 8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 #include "platform/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
| 10 #include "platform/weborigin/Referrer.h" | 10 #include "platform/weborigin/Referrer.h" |
| 11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
| 12 #include "wtf/PassRefPtr.h" | 12 #include "wtf/PassRefPtr.h" |
| 13 #include "wtf/RefCounted.h" | 13 #include "wtf/RefCounted.h" |
| 14 #include "wtf/text/AtomicString.h" | 14 #include "wtf/text/AtomicString.h" |
| 15 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 class WebServiceWorkerRequest; | 18 class WebServiceWorkerRequest; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace WebCore { | 21 namespace blink { |
| 22 | 22 |
| 23 class ExecutionContext; | 23 class ExecutionContext; |
| 24 class FetchHeaderList; | 24 class FetchHeaderList; |
| 25 struct ResourceLoaderOptions; | 25 struct ResourceLoaderOptions; |
| 26 class ResourceRequest; | 26 class ResourceRequest; |
| 27 class SecurityOrigin; | 27 class SecurityOrigin; |
| 28 struct ThreadableLoaderOptions; | 28 struct ThreadableLoaderOptions; |
| 29 | 29 |
| 30 class FetchRequestData FINAL : public RefCountedWillBeGarbageCollectedFinalized<
FetchRequestData> { | 30 class FetchRequestData FINAL : public RefCountedWillBeGarbageCollectedFinalized<
FetchRequestData> { |
| 31 WTF_MAKE_NONCOPYABLE(FetchRequestData); | 31 WTF_MAKE_NONCOPYABLE(FetchRequestData); |
| 32 public: | 32 public: |
| 33 enum Mode { SameOriginMode, NoCORSMode, CORSMode, CORSWithForcedPreflight }; | 33 enum Mode { SameOriginMode, NoCORSMode, CORSMode, CORSWithForcedPreflight }; |
| 34 enum Credentials { OmitCredentials, SameOriginCredentials, IncludeCredential
s }; | 34 enum Credentials { OmitCredentials, SameOriginCredentials, IncludeCredential
s }; |
| 35 enum Context { ChildContext, ConnectContext, DownloadContext, FontContext, F
ormContext, ImageContext, ManifestContext, MediaContext, NavigateContext, Object
Context, PingContext, PopupContext, PrefetchContext, ScriptContext, ServiceWorke
rContext, SharedWorkerContext, StyleContext, WorkerContext, NullContext }; | 35 enum Context { ChildContext, ConnectContext, DownloadContext, FontContext, F
ormContext, ImageContext, ManifestContext, MediaContext, NavigateContext, Object
Context, PingContext, PopupContext, PrefetchContext, ScriptContext, ServiceWorke
rContext, SharedWorkerContext, StyleContext, WorkerContext, NullContext }; |
| 36 enum Tainting { BasicTainting, CORSTainting, OpaqueTainting }; | 36 enum Tainting { BasicTainting, CORSTainting, OpaqueTainting }; |
| 37 | 37 |
| 38 class Referrer { | 38 class Referrer { |
| 39 WTF_MAKE_NONCOPYABLE(Referrer); | 39 WTF_MAKE_NONCOPYABLE(Referrer); |
| 40 public: | 40 public: |
| 41 Referrer() : m_type(ClientReferrer) { } | 41 Referrer() : m_type(ClientReferrer) { } |
| 42 ~Referrer() { } | 42 ~Referrer() { } |
| 43 bool isNone() const { return m_type == NoneReferrer; } | 43 bool isNone() const { return m_type == NoneReferrer; } |
| 44 bool isClient() const { return m_type == ClientReferrer; } | 44 bool isClient() const { return m_type == ClientReferrer; } |
| 45 bool isURL() const { return m_type == URLReferrer; } | 45 bool isURL() const { return m_type == URLReferrer; } |
| 46 void setNone() | 46 void setNone() |
| 47 { | 47 { |
| 48 m_referrer = WebCore::Referrer(); | 48 m_referrer = blink::Referrer(); |
| 49 m_type = NoneReferrer; | 49 m_type = NoneReferrer; |
| 50 } | 50 } |
| 51 void setClient(const WebCore::Referrer& referrer) | 51 void setClient(const blink::Referrer& referrer) |
| 52 { | 52 { |
| 53 m_referrer = referrer; | 53 m_referrer = referrer; |
| 54 m_type = ClientReferrer; | 54 m_type = ClientReferrer; |
| 55 } | 55 } |
| 56 void setURL(const WebCore::Referrer& referrer) | 56 void setURL(const blink::Referrer& referrer) |
| 57 { | 57 { |
| 58 m_referrer = referrer; | 58 m_referrer = referrer; |
| 59 m_type = URLReferrer; | 59 m_type = URLReferrer; |
| 60 } | 60 } |
| 61 WebCore::Referrer referrer() const { return m_referrer; } | 61 blink::Referrer referrer() const { return m_referrer; } |
| 62 private: | 62 private: |
| 63 enum Type { NoneReferrer, ClientReferrer, URLReferrer }; | 63 enum Type { NoneReferrer, ClientReferrer, URLReferrer }; |
| 64 Type m_type; | 64 Type m_type; |
| 65 WebCore::Referrer m_referrer; | 65 blink::Referrer m_referrer; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 static PassRefPtrWillBeRawPtr<FetchRequestData> create(ExecutionContext*); | 68 static PassRefPtrWillBeRawPtr<FetchRequestData> create(ExecutionContext*); |
| 69 static PassRefPtrWillBeRawPtr<FetchRequestData> create(const blink::WebServi
ceWorkerRequest&); | 69 static PassRefPtrWillBeRawPtr<FetchRequestData> create(const blink::WebServi
ceWorkerRequest&); |
| 70 PassRefPtrWillBeRawPtr<FetchRequestData> createRestrictedCopy(ExecutionConte
xt*, PassRefPtr<SecurityOrigin>) const; | 70 PassRefPtrWillBeRawPtr<FetchRequestData> createRestrictedCopy(ExecutionConte
xt*, PassRefPtr<SecurityOrigin>) const; |
| 71 ~FetchRequestData(); | 71 ~FetchRequestData(); |
| 72 | 72 |
| 73 void setMethod(AtomicString method) { m_method = method; } | 73 void setMethod(AtomicString method) { m_method = method; } |
| 74 const AtomicString method() const { return m_method; } | 74 const AtomicString method() const { return m_method; } |
| 75 void setURL(const KURL& url) { m_url = url; } | 75 void setURL(const KURL& url) { m_url = url; } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // FIXME: Support m_authenticationFlag; | 107 // FIXME: Support m_authenticationFlag; |
| 108 // FIXME: Support m_synchronousFlag; | 108 // FIXME: Support m_synchronousFlag; |
| 109 Mode m_mode; | 109 Mode m_mode; |
| 110 Credentials m_credentials; | 110 Credentials m_credentials; |
| 111 // FIXME: Support m_useURLCredentialsFlag; | 111 // FIXME: Support m_useURLCredentialsFlag; |
| 112 // FIXME: Support m_manualRedirectFlag; | 112 // FIXME: Support m_manualRedirectFlag; |
| 113 // FIXME: Support m_redirectCount; | 113 // FIXME: Support m_redirectCount; |
| 114 Tainting m_responseTainting; | 114 Tainting m_responseTainting; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace WebCore | 117 } // namespace blink |
| 118 | 118 |
| 119 #endif // FetchRequestData_h | 119 #endif // FetchRequestData_h |
| OLD | NEW |