| 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 Request_h | 5 #ifndef Request_h |
| 6 #define Request_h | 6 #define Request_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "modules/serviceworkers/FetchRequestData.h" | 10 #include "modules/serviceworkers/FetchRequestData.h" |
| 11 #include "modules/serviceworkers/Headers.h" | 11 #include "modules/serviceworkers/Headers.h" |
| 12 #include "platform/heap/Handle.h" |
| 12 #include "platform/weborigin/KURL.h" | 13 #include "platform/weborigin/KURL.h" |
| 13 #include "wtf/RefCounted.h" | 14 #include "wtf/RefCounted.h" |
| 14 #include "wtf/RefPtr.h" | 15 #include "wtf/RefPtr.h" |
| 15 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 16 | 17 |
| 17 namespace blink { class WebServiceWorkerRequest; } | 18 namespace blink { class WebServiceWorkerRequest; } |
| 18 | 19 |
| 19 namespace WebCore { | 20 namespace WebCore { |
| 20 | 21 |
| 21 struct RequestInit; | 22 class RequestInit; |
| 22 class ResourceRequest; | 23 class ResourceRequest; |
| 23 struct ResourceLoaderOptions; | 24 struct ResourceLoaderOptions; |
| 24 struct ThreadableLoaderOptions; | 25 struct ThreadableLoaderOptions; |
| 25 | 26 |
| 26 class Request FINAL : public RefCounted<Request>, public ScriptWrappable { | 27 class Request FINAL : public RefCountedWillBeGarbageCollected<Request>, public S
criptWrappable { |
| 28 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Request); |
| 27 public: | 29 public: |
| 28 static PassRefPtr<Request> create(ExecutionContext*, const String&, Exceptio
nState&); | 30 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, const Strin
g&, ExceptionState&); |
| 29 static PassRefPtr<Request> create(ExecutionContext*, const String&, const Di
ctionary&, ExceptionState&); | 31 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, const Strin
g&, const Dictionary&, ExceptionState&); |
| 30 static PassRefPtr<Request> create(ExecutionContext*, Request*, ExceptionStat
e&); | 32 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, Request*, E
xceptionState&); |
| 31 static PassRefPtr<Request> create(ExecutionContext*, Request*, const Diction
ary&, ExceptionState&); | 33 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, Request*, c
onst Dictionary&, ExceptionState&); |
| 32 | 34 |
| 33 static PassRefPtr<Request> create(PassRefPtr<FetchRequestData>); | 35 static PassRefPtrWillBeRawPtr<Request> create(PassRefPtrWillBeRawPtr<FetchRe
questData>); |
| 34 | 36 |
| 35 static PassRefPtr<Request> create(const blink::WebServiceWorkerRequest&); | 37 static PassRefPtrWillBeRawPtr<Request> create(const blink::WebServiceWorkerR
equest&); |
| 36 | 38 |
| 37 ~Request() { }; | 39 PassRefPtrWillBeRawPtr<FetchRequestData> request() { return m_request; } |
| 38 | |
| 39 PassRefPtr<FetchRequestData> request() { return m_request; } | |
| 40 | 40 |
| 41 String method() const; | 41 String method() const; |
| 42 String url() const; | 42 String url() const; |
| 43 PassRefPtr<Headers> headers() const { return m_headers; } | 43 PassRefPtrWillBeRawPtr<Headers> headers() const { return m_headers; } |
| 44 // FIXME: Support body. | 44 // FIXME: Support body. |
| 45 String referrer() const; | 45 String referrer() const; |
| 46 String mode() const; | 46 String mode() const; |
| 47 String credentials() const; | 47 String credentials() const; |
| 48 | 48 |
| 49 PassOwnPtr<ResourceRequest> createResourceRequest() const; | 49 PassOwnPtr<ResourceRequest> createResourceRequest() const; |
| 50 | 50 |
| 51 void trace(Visitor*); |
| 52 |
| 51 private: | 53 private: |
| 52 explicit Request(PassRefPtr<FetchRequestData>); | 54 explicit Request(PassRefPtrWillBeRawPtr<FetchRequestData>); |
| 53 explicit Request(const blink::WebServiceWorkerRequest&); | 55 explicit Request(const blink::WebServiceWorkerRequest&); |
| 54 | 56 |
| 55 RefPtr<FetchRequestData> m_request; | 57 RefPtrWillBeMember<FetchRequestData> m_request; |
| 56 RefPtr<Headers> m_headers; | 58 RefPtrWillBeMember<Headers> m_headers; |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace WebCore | 61 } // namespace WebCore |
| 60 | 62 |
| 61 #endif // Request_h | 63 #endif // Request_h |
| OLD | NEW |