| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebDataSourceImpl_h | 31 #ifndef WebDataSourceImpl_h |
| 32 #define WebDataSourceImpl_h | 32 #define WebDataSourceImpl_h |
| 33 | 33 |
| 34 #include "core/loader/DocumentLoader.h" | 34 #include "core/loader/DocumentLoader.h" |
| 35 #include "platform/exported/WrappedResourceRequest.h" | 35 #include "platform/exported/WrappedResourceRequest.h" |
| 36 #include "platform/exported/WrappedResourceResponse.h" | 36 #include "platform/exported/WrappedResourceResponse.h" |
| 37 #include "platform/heap/Handle.h" | |
| 38 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
| 39 #include "public/web/WebDataSource.h" | 38 #include "public/web/WebDataSource.h" |
| 40 #include "web/WebPluginLoadObserver.h" | 39 #include "web/WebPluginLoadObserver.h" |
| 41 #include "wtf/OwnPtr.h" | 40 #include "wtf/OwnPtr.h" |
| 42 #include "wtf/PassOwnPtr.h" | 41 #include "wtf/PassOwnPtr.h" |
| 43 #include "wtf/Vector.h" | 42 #include "wtf/Vector.h" |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| 46 | 45 |
| 47 class WebPluginLoadObserver; | 46 class WebPluginLoadObserver; |
| 48 | 47 |
| 49 class WebDataSourceImpl final : public DocumentLoader, public WebDataSource { | 48 class WebDataSourceImpl final : public DocumentLoader, public WebDataSource { |
| 50 public: | 49 public: |
| 51 static PassRefPtrWillBeRawPtr<WebDataSourceImpl> create(LocalFrame*, const R
esourceRequest&, const SubstituteData&); | 50 static PassRefPtr<WebDataSourceImpl> create(LocalFrame*, const ResourceReque
st&, const SubstituteData&); |
| 52 | 51 |
| 53 static WebDataSourceImpl* fromDocumentLoader(DocumentLoader* loader) | 52 static WebDataSourceImpl* fromDocumentLoader(DocumentLoader* loader) |
| 54 { | 53 { |
| 55 return static_cast<WebDataSourceImpl*>(loader); | 54 return static_cast<WebDataSourceImpl*>(loader); |
| 56 } | 55 } |
| 57 | 56 |
| 58 // WebDataSource methods: | 57 // WebDataSource methods: |
| 59 virtual const WebURLRequest& originalRequest() const override; | 58 virtual const WebURLRequest& originalRequest() const override; |
| 60 virtual const WebURLRequest& request() const override; | 59 virtual const WebURLRequest& request() const override; |
| 61 virtual const WebURLResponse& response() const override; | 60 virtual const WebURLResponse& response() const override; |
| 62 virtual bool hasUnreachableURL() const override; | 61 virtual bool hasUnreachableURL() const override; |
| 63 virtual WebURL unreachableURL() const override; | 62 virtual WebURL unreachableURL() const override; |
| 64 virtual void appendRedirect(const WebURL&) override; | 63 virtual void appendRedirect(const WebURL&) override; |
| 65 virtual void redirectChain(WebVector<WebURL>&) const override; | 64 virtual void redirectChain(WebVector<WebURL>&) const override; |
| 66 virtual bool isClientRedirect() const override; | 65 virtual bool isClientRedirect() const override; |
| 67 virtual bool replacesCurrentHistoryItem() const override; | 66 virtual bool replacesCurrentHistoryItem() const override; |
| 68 virtual WebNavigationType navigationType() const override; | 67 virtual WebNavigationType navigationType() const override; |
| 69 virtual ExtraData* extraData() const override; | 68 virtual ExtraData* extraData() const override; |
| 70 virtual void setExtraData(ExtraData*) override; | 69 virtual void setExtraData(ExtraData*) override; |
| 71 virtual void setNavigationStartTime(double) override; | 70 virtual void setNavigationStartTime(double) override; |
| 72 | 71 |
| 73 static WebNavigationType toWebNavigationType(NavigationType); | 72 static WebNavigationType toWebNavigationType(NavigationType); |
| 74 | 73 |
| 75 PassOwnPtr<WebPluginLoadObserver> releasePluginLoadObserver() { return m_plu
ginLoadObserver.release(); } | 74 PassOwnPtr<WebPluginLoadObserver> releasePluginLoadObserver() { return m_plu
ginLoadObserver.release(); } |
| 76 static void setNextPluginLoadObserver(PassOwnPtr<WebPluginLoadObserver>); | 75 static void setNextPluginLoadObserver(PassOwnPtr<WebPluginLoadObserver>); |
| 77 | 76 |
| 78 DECLARE_VIRTUAL_TRACE(); | |
| 79 | |
| 80 private: | 77 private: |
| 81 WebDataSourceImpl(LocalFrame*, const ResourceRequest&, const SubstituteData&
); | 78 WebDataSourceImpl(LocalFrame*, const ResourceRequest&, const SubstituteData&
); |
| 82 virtual ~WebDataSourceImpl(); | 79 virtual ~WebDataSourceImpl(); |
| 83 virtual void detachFromFrame() override; | |
| 84 | 80 |
| 85 // Mutable because the const getters will magically sync these to the | 81 // Mutable because the const getters will magically sync these to the |
| 86 // latest version from WebKit. | 82 // latest version from WebKit. |
| 87 mutable WrappedResourceRequest m_originalRequestWrapper; | 83 mutable WrappedResourceRequest m_originalRequestWrapper; |
| 88 mutable WrappedResourceRequest m_requestWrapper; | 84 mutable WrappedResourceRequest m_requestWrapper; |
| 89 mutable WrappedResourceResponse m_responseWrapper; | 85 mutable WrappedResourceResponse m_responseWrapper; |
| 90 | 86 |
| 91 OwnPtr<ExtraData> m_extraData; | 87 OwnPtr<ExtraData> m_extraData; |
| 92 OwnPtr<WebPluginLoadObserver> m_pluginLoadObserver; | 88 OwnPtr<WebPluginLoadObserver> m_pluginLoadObserver; |
| 93 }; | 89 }; |
| 94 | 90 |
| 95 } // namespace blink | 91 } // namespace blink |
| 96 | 92 |
| 97 #endif // WebDataSourceImpl_h | 93 #endif // WebDataSourceImpl_h |
| OLD | NEW |