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/Body.h" | 10 #include "modules/serviceworkers/Body.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 static Response* create(ExecutionContext*, const String&, const Dictionary&,
ExceptionState&); | 29 static Response* create(ExecutionContext*, const String&, const Dictionary&,
ExceptionState&); |
30 static Response* create(ExecutionContext*, const ArrayBuffer*, const Diction
ary&, ExceptionState&); | 30 static Response* create(ExecutionContext*, const ArrayBuffer*, const Diction
ary&, ExceptionState&); |
31 static Response* create(ExecutionContext*, const ArrayBufferView*, const Dic
tionary&, ExceptionState&); | 31 static Response* create(ExecutionContext*, const ArrayBufferView*, const Dic
tionary&, ExceptionState&); |
32 static Response* create(ExecutionContext*, Blob*, const ResponseInit&, Excep
tionState&); | 32 static Response* create(ExecutionContext*, Blob*, const ResponseInit&, Excep
tionState&); |
33 static Response* create(ExecutionContext*, FetchResponseData*); | 33 static Response* create(ExecutionContext*, FetchResponseData*); |
34 static Response* create(ExecutionContext*, const WebServiceWorkerResponse&); | 34 static Response* create(ExecutionContext*, const WebServiceWorkerResponse&); |
35 // The 'FetchResponseData' object is shared between responses, as it is | 35 // The 'FetchResponseData' object is shared between responses, as it is |
36 // immutable to the user after Response creation. Headers are copied. | 36 // immutable to the user after Response creation. Headers are copied. |
37 static Response* create(const Response&); | 37 static Response* create(const Response&); |
38 | 38 |
| 39 const FetchResponseData* response() const { return m_response; } |
| 40 |
39 String type() const; | 41 String type() const; |
40 String url() const; | 42 String url() const; |
41 unsigned short status() const; | 43 unsigned short status() const; |
42 String statusText() const; | 44 String statusText() const; |
43 Headers* headers() const; | 45 Headers* headers() const; |
44 | 46 |
45 Response* clone() const; | 47 Response* clone() const; |
46 | 48 |
47 void populateWebServiceWorkerResponse(WebServiceWorkerResponse&); | 49 void populateWebServiceWorkerResponse(WebServiceWorkerResponse&); |
48 | 50 |
49 virtual void trace(Visitor*) OVERRIDE; | 51 virtual void trace(Visitor*) OVERRIDE; |
50 | 52 |
51 private: | 53 private: |
52 explicit Response(const Response&); | 54 explicit Response(const Response&); |
53 explicit Response(ExecutionContext*); | 55 explicit Response(ExecutionContext*); |
54 Response(ExecutionContext*, FetchResponseData*); | 56 Response(ExecutionContext*, FetchResponseData*); |
55 Response(ExecutionContext*, const WebServiceWorkerResponse&); | 57 Response(ExecutionContext*, const WebServiceWorkerResponse&); |
56 | 58 |
57 virtual PassRefPtr<BlobDataHandle> blobDataHandle() OVERRIDE; | 59 virtual PassRefPtr<BlobDataHandle> blobDataHandle() OVERRIDE; |
58 | 60 |
59 const Member<FetchResponseData> m_response; | 61 const Member<FetchResponseData> m_response; |
60 const Member<Headers> m_headers; | 62 const Member<Headers> m_headers; |
61 }; | 63 }; |
62 | 64 |
63 } // namespace blink | 65 } // namespace blink |
64 | 66 |
65 #endif // Response_h | 67 #endif // Response_h |
OLD | NEW |