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 Response_h | 5 #ifndef Response_h |
6 #define Response_h | 6 #define Response_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/FetchBodyStream.h" | 10 #include "modules/serviceworkers/FetchBodyStream.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class ExceptionState; | 22 class ExceptionState; |
23 class ResponseInit; | 23 class ResponseInit; |
24 class WebServiceWorkerResponse; | 24 class WebServiceWorkerResponse; |
25 | 25 |
26 class Response FINAL : public RefCountedWillBeGarbageCollected<Response>, public
ScriptWrappable { | 26 class Response FINAL : public RefCountedWillBeGarbageCollected<Response>, public
ScriptWrappable { |
27 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Response); | 27 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Response); |
28 public: | 28 public: |
29 static PassRefPtrWillBeRawPtr<Response> create(Blob*, const Dictionary&, Exc
eptionState&); | 29 static PassRefPtrWillBeRawPtr<Response> create(Blob*, const Dictionary&, Exc
eptionState&); |
30 static PassRefPtrWillBeRawPtr<Response> create(const String&, const Dictiona
ry&, ExceptionState&); | 30 static PassRefPtrWillBeRawPtr<Response> create(const String&, const Dictiona
ry&, ExceptionState&); |
31 static PassRefPtrWillBeRawPtr<Response> create(Blob*, const ResponseInit&, E
xceptionState&); | 31 static PassRefPtrWillBeRawPtr<Response> create(Blob*, const ResponseInit&, E
xceptionState&); |
32 | |
33 static PassRefPtrWillBeRawPtr<Response> create(PassRefPtrWillBeRawPtr<FetchR
esponseData>); | 32 static PassRefPtrWillBeRawPtr<Response> create(PassRefPtrWillBeRawPtr<FetchR
esponseData>); |
| 33 static PassRefPtrWillBeRawPtr<Response> create(const WebServiceWorkerRespons
e&); |
34 | 34 |
35 String type() const; | 35 String type() const; |
36 String url() const; | 36 String url() const; |
37 unsigned short status() const; | 37 unsigned short status() const; |
38 String statusText() const; | 38 String statusText() const; |
39 PassRefPtrWillBeRawPtr<Headers> headers() const; | 39 PassRefPtrWillBeRawPtr<Headers> headers() const; |
40 | 40 |
41 PassRefPtrWillBeRawPtr<FetchBodyStream> body(ExecutionContext*); | 41 PassRefPtrWillBeRawPtr<FetchBodyStream> body(ExecutionContext*); |
42 | 42 |
43 void populateWebServiceWorkerResponse(WebServiceWorkerResponse&); | 43 void populateWebServiceWorkerResponse(WebServiceWorkerResponse&); |
44 | 44 |
45 void trace(Visitor*); | 45 void trace(Visitor*); |
46 | 46 |
47 private: | 47 private: |
48 Response(); | 48 Response(); |
49 explicit Response(PassRefPtrWillBeRawPtr<FetchResponseData>); | 49 explicit Response(PassRefPtrWillBeRawPtr<FetchResponseData>); |
| 50 explicit Response(const WebServiceWorkerResponse&); |
50 | 51 |
51 RefPtrWillBeMember<FetchResponseData> m_response; | 52 RefPtrWillBeMember<FetchResponseData> m_response; |
52 RefPtrWillBeMember<Headers> m_headers; | 53 RefPtrWillBeMember<Headers> m_headers; |
53 RefPtrWillBeMember<FetchBodyStream> m_fetchBodyStream; | 54 RefPtrWillBeMember<FetchBodyStream> m_fetchBodyStream; |
54 }; | 55 }; |
55 | 56 |
56 } // namespace blink | 57 } // namespace blink |
57 | 58 |
58 #endif // Response_h | 59 #endif // Response_h |
OLD | NEW |