| 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 "bindings/modules/v8/UnionTypesModules.h" | 10 #include "bindings/modules/v8/UnionTypesModules.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // From Request.idl: | 46 // From Request.idl: |
| 47 String method() const; | 47 String method() const; |
| 48 KURL url() const; | 48 KURL url() const; |
| 49 Headers* headers() const { return m_headers; } | 49 Headers* headers() const { return m_headers; } |
| 50 String context() const; | 50 String context() const; |
| 51 String referrer() const; | 51 String referrer() const; |
| 52 String mode() const; | 52 String mode() const; |
| 53 String credentials() const; | 53 String credentials() const; |
| 54 | 54 |
| 55 // From Request.idl: | 55 // From Request.idl: |
| 56 Request* clone(ExceptionState&) const; | 56 Request* clone(ExceptionState&); |
| 57 | 57 |
| 58 FetchRequestData* passRequestData(); | 58 FetchRequestData* passRequestData(); |
| 59 | 59 |
| 60 void populateWebServiceWorkerRequest(WebServiceWorkerRequest&) const; | 60 void populateWebServiceWorkerRequest(WebServiceWorkerRequest&) const; |
| 61 | 61 |
| 62 void setBodyBlobHandle(PassRefPtr<BlobDataHandle>); | 62 bool hasBody() const { return m_request->buffer(); } |
| 63 bool hasBody() const { return m_request->blobDataHandle(); } | |
| 64 | 63 |
| 65 DECLARE_VIRTUAL_TRACE(); | 64 DECLARE_VIRTUAL_TRACE(); |
| 66 | 65 |
| 67 private: | 66 private: |
| 68 Request(ExecutionContext*, FetchRequestData*); | 67 Request(ExecutionContext*, FetchRequestData*); |
| 69 Request(ExecutionContext*, const WebServiceWorkerRequest&); | 68 Request(ExecutionContext*, const WebServiceWorkerRequest&); |
| 70 Request(ExecutionContext*, FetchRequestData*, Headers*); | 69 Request(ExecutionContext*, FetchRequestData*, Headers*); |
| 71 | 70 |
| 71 void setBuffer(BodyStreamBuffer*); |
| 72 void refreshBody(); |
| 73 |
| 72 static Request* createRequestWithRequestOrString(ScriptState*, Request*, con
st String&, const RequestInit&, ExceptionState&); | 74 static Request* createRequestWithRequestOrString(ScriptState*, Request*, con
st String&, const RequestInit&, ExceptionState&); |
| 73 void clearHeaderList(); | 75 void clearHeaderList(); |
| 74 | 76 |
| 75 PassRefPtr<BlobDataHandle> blobDataHandle() const override; | |
| 76 BodyStreamBuffer* buffer() const override; | |
| 77 String mimeType() const override; | 77 String mimeType() const override; |
| 78 | 78 |
| 79 const Member<FetchRequestData> m_request; | 79 const Member<FetchRequestData> m_request; |
| 80 const Member<Headers> m_headers; | 80 const Member<Headers> m_headers; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| 84 | 84 |
| 85 #endif // Request_h | 85 #endif // Request_h |
| OLD | NEW |