| 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 FetchResponseData_h |    5 #ifndef FetchResponseData_h | 
|    6 #define FetchResponseData_h |    6 #define FetchResponseData_h | 
|    7  |    7  | 
|    8 #include "core/fetch/CrossOriginAccessControl.h" |    8 #include "core/fetch/CrossOriginAccessControl.h" | 
|    9 #include "modules/ModulesExport.h" |    9 #include "modules/ModulesExport.h" | 
|   10 #include "platform/heap/Handle.h" |   10 #include "platform/heap/Handle.h" | 
|   11 #include "platform/weborigin/KURL.h" |   11 #include "platform/weborigin/KURL.h" | 
|   12 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" |   12 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" | 
|   13 #include "wtf/PassRefPtr.h" |   13 #include "wtf/PassRefPtr.h" | 
 |   14 #include "wtf/Vector.h" | 
|   14 #include "wtf/text/AtomicString.h" |   15 #include "wtf/text/AtomicString.h" | 
|   15 #include <memory> |   16 #include <memory> | 
|   16  |   17  | 
|   17 namespace blink { |   18 namespace blink { | 
|   18  |   19  | 
|   19 class BodyStreamBuffer; |   20 class BodyStreamBuffer; | 
|   20 class FetchHeaderList; |   21 class FetchHeaderList; | 
|   21 class ScriptState; |   22 class ScriptState; | 
|   22 class WebServiceWorkerResponse; |   23 class WebServiceWorkerResponse; | 
|   23  |   24  | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   62   FetchResponseData* createOpaqueRedirectFilteredResponse() const; |   63   FetchResponseData* createOpaqueRedirectFilteredResponse() const; | 
|   63  |   64  | 
|   64   FetchResponseData* internalResponse() { return m_internalResponse; } |   65   FetchResponseData* internalResponse() { return m_internalResponse; } | 
|   65   const FetchResponseData* internalResponse() const { |   66   const FetchResponseData* internalResponse() const { | 
|   66     return m_internalResponse; |   67     return m_internalResponse; | 
|   67   } |   68   } | 
|   68  |   69  | 
|   69   FetchResponseData* clone(ScriptState*); |   70   FetchResponseData* clone(ScriptState*); | 
|   70  |   71  | 
|   71   Type getType() const { return m_type; } |   72   Type getType() const { return m_type; } | 
|   72   const KURL& url() const { return m_url; } |   73   const KURL* url() const; | 
|   73   unsigned short status() const { return m_status; } |   74   unsigned short status() const { return m_status; } | 
|   74   AtomicString statusMessage() const { return m_statusMessage; } |   75   AtomicString statusMessage() const { return m_statusMessage; } | 
|   75   FetchHeaderList* headerList() const { return m_headerList.get(); } |   76   FetchHeaderList* headerList() const { return m_headerList.get(); } | 
|   76   BodyStreamBuffer* buffer() const { return m_buffer; } |   77   BodyStreamBuffer* buffer() const { return m_buffer; } | 
|   77   String mimeType() const; |   78   String mimeType() const; | 
|   78   // Returns the BodyStreamBuffer of |m_internalResponse| if any. Otherwise, |   79   // Returns the BodyStreamBuffer of |m_internalResponse| if any. Otherwise, | 
|   79   // returns |m_buffer|. |   80   // returns |m_buffer|. | 
|   80   BodyStreamBuffer* internalBuffer() const; |   81   BodyStreamBuffer* internalBuffer() const; | 
|   81   String internalMIMEType() const; |   82   String internalMIMEType() const; | 
|   82   int64_t responseTime() const { return m_responseTime; } |   83   int64_t responseTime() const { return m_responseTime; } | 
|   83   String cacheStorageCacheName() const { return m_cacheStorageCacheName; } |   84   String cacheStorageCacheName() const { return m_cacheStorageCacheName; } | 
|   84   const HTTPHeaderSet& corsExposedHeaderNames() const { |   85   const HTTPHeaderSet& corsExposedHeaderNames() const { | 
|   85     return m_corsExposedHeaderNames; |   86     return m_corsExposedHeaderNames; | 
|   86   } |   87   } | 
|   87  |   88  | 
|   88   void setURL(const KURL& url) { m_url = url; } |   89   void setURLList(const Vector<KURL>&); | 
|   89   void setStatus(unsigned short status) { m_status = status; } |   90   void setStatus(unsigned short status) { m_status = status; } | 
|   90   void setStatusMessage(AtomicString statusMessage) { |   91   void setStatusMessage(AtomicString statusMessage) { | 
|   91     m_statusMessage = statusMessage; |   92     m_statusMessage = statusMessage; | 
|   92   } |   93   } | 
|   93   void setMIMEType(const String& type) { m_mimeType = type; } |   94   void setMIMEType(const String& type) { m_mimeType = type; } | 
|   94   void setResponseTime(int64_t responseTime) { m_responseTime = responseTime; } |   95   void setResponseTime(int64_t responseTime) { m_responseTime = responseTime; } | 
|   95   void setCacheStorageCacheName(const String& cacheStorageCacheName) { |   96   void setCacheStorageCacheName(const String& cacheStorageCacheName) { | 
|   96     m_cacheStorageCacheName = cacheStorageCacheName; |   97     m_cacheStorageCacheName = cacheStorageCacheName; | 
|   97   } |   98   } | 
|   98   void setCorsExposedHeaderNames(const HTTPHeaderSet& headerNames) { |   99   void setCorsExposedHeaderNames(const HTTPHeaderSet& headerNames) { | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
|  110   void populateWebServiceWorkerResponse( |  111   void populateWebServiceWorkerResponse( | 
|  111       WebServiceWorkerResponse& /* response */); |  112       WebServiceWorkerResponse& /* response */); | 
|  112  |  113  | 
|  113   DECLARE_TRACE(); |  114   DECLARE_TRACE(); | 
|  114  |  115  | 
|  115  private: |  116  private: | 
|  116   FetchResponseData(Type, unsigned short, AtomicString); |  117   FetchResponseData(Type, unsigned short, AtomicString); | 
|  117  |  118  | 
|  118   Type m_type; |  119   Type m_type; | 
|  119   std::unique_ptr<TerminationReason> m_terminationReason; |  120   std::unique_ptr<TerminationReason> m_terminationReason; | 
|  120   KURL m_url; |  121   Vector<KURL> m_urlList; | 
|  121   unsigned short m_status; |  122   unsigned short m_status; | 
|  122   AtomicString m_statusMessage; |  123   AtomicString m_statusMessage; | 
|  123   Member<FetchHeaderList> m_headerList; |  124   Member<FetchHeaderList> m_headerList; | 
|  124   Member<FetchResponseData> m_internalResponse; |  125   Member<FetchResponseData> m_internalResponse; | 
|  125   Member<BodyStreamBuffer> m_buffer; |  126   Member<BodyStreamBuffer> m_buffer; | 
|  126   String m_mimeType; |  127   String m_mimeType; | 
|  127   int64_t m_responseTime; |  128   int64_t m_responseTime; | 
|  128   String m_cacheStorageCacheName; |  129   String m_cacheStorageCacheName; | 
|  129   HTTPHeaderSet m_corsExposedHeaderNames; |  130   HTTPHeaderSet m_corsExposedHeaderNames; | 
|  130 }; |  131 }; | 
|  131  |  132  | 
|  132 }  // namespace blink |  133 }  // namespace blink | 
|  133  |  134  | 
|  134 #endif  // FetchResponseData_h |  135 #endif  // FetchResponseData_h | 
| OLD | NEW |