| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #ifndef WebDataSourceImpl_h | 31 #ifndef WebDataSourceImpl_h |
| 32 #define WebDataSourceImpl_h | 32 #define WebDataSourceImpl_h |
| 33 | 33 |
| 34 #include "core/frame/FrameTypes.h" | 34 #include "core/frame/FrameTypes.h" |
| 35 #include "core/loader/DocumentLoader.h" | 35 #include "core/loader/DocumentLoader.h" |
| 36 #include "platform/exported/WrappedResourceRequest.h" | 36 #include "platform/exported/WrappedResourceRequest.h" |
| 37 #include "platform/exported/WrappedResourceResponse.h" | 37 #include "platform/exported/WrappedResourceResponse.h" |
| 38 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 39 #include "platform/weborigin/KURL.h" | 39 #include "platform/weborigin/KURL.h" |
| 40 #include "public/platform/WebURL.h" |
| 40 #include "public/web/WebDataSource.h" | 41 #include "public/web/WebDataSource.h" |
| 41 #include "wtf/Vector.h" | 42 #include "wtf/Vector.h" |
| 42 #include <memory> | 43 #include <memory> |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 | 46 |
| 46 class WebDataSourceImpl final : public DocumentLoader, public WebDataSource { | 47 class WebDataSourceImpl final : public DocumentLoader, public WebDataSource { |
| 47 public: | 48 public: |
| 48 static WebDataSourceImpl* create(LocalFrame*, | 49 static WebDataSourceImpl* create(LocalFrame*, |
| 49 const ResourceRequest&, | 50 const ResourceRequest&, |
| 50 const SubstituteData&, | 51 const SubstituteData&, |
| 51 ClientRedirectPolicy); | 52 ClientRedirectPolicy, |
| 53 Document* requestorDocument); |
| 52 | 54 |
| 53 static WebDataSourceImpl* fromDocumentLoader(DocumentLoader* loader) { | 55 static WebDataSourceImpl* fromDocumentLoader(DocumentLoader* loader) { |
| 54 return static_cast<WebDataSourceImpl*>(loader); | 56 return static_cast<WebDataSourceImpl*>(loader); |
| 55 } | 57 } |
| 56 | 58 |
| 57 // WebDataSource methods: | 59 // WebDataSource methods: |
| 60 WebURL requestorURL() const override; |
| 58 const WebURLRequest& originalRequest() const override; | 61 const WebURLRequest& originalRequest() const override; |
| 59 const WebURLRequest& request() const override; | 62 const WebURLRequest& request() const override; |
| 60 const WebURLResponse& response() const override; | 63 const WebURLResponse& response() const override; |
| 61 bool hasUnreachableURL() const override; | 64 bool hasUnreachableURL() const override; |
| 62 WebURL unreachableURL() const override; | 65 WebURL unreachableURL() const override; |
| 63 void appendRedirect(const WebURL&) override; | 66 void appendRedirect(const WebURL&) override; |
| 64 void redirectChain(WebVector<WebURL>&) const override; | 67 void redirectChain(WebVector<WebURL>&) const override; |
| 65 bool isClientRedirect() const override; | 68 bool isClientRedirect() const override; |
| 66 bool replacesCurrentHistoryItem() const override; | 69 bool replacesCurrentHistoryItem() const override; |
| 67 WebNavigationType navigationType() const override; | 70 WebNavigationType navigationType() const override; |
| 68 ExtraData* getExtraData() const override; | 71 ExtraData* getExtraData() const override; |
| 69 void setExtraData(ExtraData*) override; | 72 void setExtraData(ExtraData*) override; |
| 70 void setNavigationStartTime(double) override; | 73 void setNavigationStartTime(double) override; |
| 71 void updateNavigation(double redirectStartTime, | 74 void updateNavigation(double redirectStartTime, |
| 72 double redirectEndTime, | 75 double redirectEndTime, |
| 73 double fetchStartTime, | 76 double fetchStartTime, |
| 74 const WebVector<WebURL>& redirectChain) override; | 77 const WebVector<WebURL>& redirectChain) override; |
| 75 void setSubresourceFilter(WebDocumentSubresourceFilter*) override; | 78 void setSubresourceFilter(WebDocumentSubresourceFilter*) override; |
| 76 | 79 |
| 77 static WebNavigationType toWebNavigationType(NavigationType); | 80 static WebNavigationType toWebNavigationType(NavigationType); |
| 78 | 81 |
| 79 DECLARE_VIRTUAL_TRACE(); | 82 DECLARE_VIRTUAL_TRACE(); |
| 80 | 83 |
| 81 private: | 84 private: |
| 82 WebDataSourceImpl(LocalFrame*, | 85 WebDataSourceImpl(LocalFrame*, |
| 83 const ResourceRequest&, | 86 const ResourceRequest&, |
| 84 const SubstituteData&, | 87 const SubstituteData&, |
| 85 ClientRedirectPolicy); | 88 ClientRedirectPolicy, |
| 89 Document* requestorDocument); |
| 86 ~WebDataSourceImpl() override; | 90 ~WebDataSourceImpl() override; |
| 87 void detachFromFrame() override; | 91 void detachFromFrame() override; |
| 88 String debugName() const override { return "WebDataSourceImpl"; } | 92 String debugName() const override { return "WebDataSourceImpl"; } |
| 89 | 93 |
| 90 // Mutable because the const getters will magically sync these to the | 94 // Mutable because the const getters will magically sync these to the |
| 91 // latest version from WebKit. | 95 // latest version from WebKit. |
| 92 mutable WrappedResourceRequest m_originalRequestWrapper; | 96 mutable WrappedResourceRequest m_originalRequestWrapper; |
| 93 mutable WrappedResourceRequest m_requestWrapper; | 97 mutable WrappedResourceRequest m_requestWrapper; |
| 94 mutable WrappedResourceResponse m_responseWrapper; | 98 mutable WrappedResourceResponse m_responseWrapper; |
| 95 | 99 |
| 96 std::unique_ptr<ExtraData> m_extraData; | 100 std::unique_ptr<ExtraData> m_extraData; |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 } // namespace blink | 103 } // namespace blink |
| 100 | 104 |
| 101 #endif // WebDataSourceImpl_h | 105 #endif // WebDataSourceImpl_h |
| OLD | NEW |