| 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" |
| 11 #include "modules/serviceworkers/FetchResponseData.h" | 11 #include "modules/serviceworkers/FetchResponseData.h" |
| 12 #include "modules/serviceworkers/Headers.h" | 12 #include "modules/serviceworkers/Headers.h" |
| 13 #include "platform/blob/BlobData.h" | 13 #include "platform/blob/BlobData.h" |
| 14 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
| 15 #include "wtf/RefCounted.h" | |
| 16 #include "wtf/RefPtr.h" | 15 #include "wtf/RefPtr.h" |
| 17 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 18 | 17 |
| 19 namespace blink { | 18 namespace blink { |
| 20 | 19 |
| 21 class Blob; | 20 class Blob; |
| 22 class ExceptionState; | 21 class ExceptionState; |
| 23 class ResponseInit; | 22 class ResponseInit; |
| 24 class WebServiceWorkerResponse; | 23 class WebServiceWorkerResponse; |
| 25 | 24 |
| 26 class Response FINAL : public RefCountedWillBeGarbageCollected<Response>, public
ScriptWrappable { | 25 class Response FINAL : public GarbageCollected<Response>, public ScriptWrappable
{ |
| 27 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Response); | |
| 28 DEFINE_WRAPPERTYPEINFO(); | 26 DEFINE_WRAPPERTYPEINFO(); |
| 29 public: | 27 public: |
| 30 static PassRefPtrWillBeRawPtr<Response> create(Blob*, const Dictionary&, Exc
eptionState&); | 28 static Response* create(Blob*, const Dictionary&, ExceptionState&); |
| 31 static PassRefPtrWillBeRawPtr<Response> create(const String&, const Dictiona
ry&, ExceptionState&); | 29 static Response* create(const String&, const Dictionary&, ExceptionState&); |
| 32 static PassRefPtrWillBeRawPtr<Response> create(Blob*, const ResponseInit&, E
xceptionState&); | 30 static Response* create(Blob*, const ResponseInit&, ExceptionState&); |
| 33 | 31 |
| 34 static PassRefPtrWillBeRawPtr<Response> create(PassRefPtrWillBeRawPtr<FetchR
esponseData>); | 32 static Response* create(FetchResponseData*); |
| 35 | 33 |
| 36 String type() const; | 34 String type() const; |
| 37 String url() const; | 35 String url() const; |
| 38 unsigned short status() const; | 36 unsigned short status() const; |
| 39 String statusText() const; | 37 String statusText() const; |
| 40 PassRefPtrWillBeRawPtr<Headers> headers() const; | 38 Headers* headers() const; |
| 41 | 39 |
| 42 PassRefPtrWillBeRawPtr<FetchBodyStream> body(ExecutionContext*); | 40 FetchBodyStream* body(ExecutionContext*); |
| 43 | 41 |
| 44 void populateWebServiceWorkerResponse(WebServiceWorkerResponse&); | 42 void populateWebServiceWorkerResponse(WebServiceWorkerResponse&); |
| 45 | 43 |
| 46 void trace(Visitor*); | 44 void trace(Visitor*); |
| 47 | 45 |
| 48 private: | 46 private: |
| 49 Response(); | 47 Response(); |
| 50 explicit Response(PassRefPtrWillBeRawPtr<FetchResponseData>); | 48 explicit Response(FetchResponseData*); |
| 51 | 49 |
| 52 RefPtrWillBeMember<FetchResponseData> m_response; | 50 Member<FetchResponseData> m_response; |
| 53 RefPtrWillBeMember<Headers> m_headers; | 51 Member<Headers> m_headers; |
| 54 RefPtrWillBeMember<FetchBodyStream> m_fetchBodyStream; | 52 Member<FetchBodyStream> m_fetchBodyStream; |
| 55 }; | 53 }; |
| 56 | 54 |
| 57 } // namespace blink | 55 } // namespace blink |
| 58 | 56 |
| 59 #endif // Response_h | 57 #endif // Response_h |
| OLD | NEW |