beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 1 | /* |
bfulgham@apple.com | d7fd9fd | 2015-08-20 00:00:38 +0000 | [diff] [blame] | 2 | * Copyright (C) 2008, 2015 Apple Inc. All Rights Reserved. |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #ifndef WebArchive_h |
| 27 | #define WebArchive_h |
beidson@apple.com | dfa17df1 | 2008-04-01 23:11:00 +0000 | [diff] [blame] | 28 | |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 29 | #include "WebKit.h" |
| 30 | |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 31 | #include <wtf/RefPtr.h> |
| 32 | |
| 33 | namespace WebCore { |
| 34 | class LegacyWebArchive; |
| 35 | } |
| 36 | |
Hironori.Fujii@sony.com | cc2ddeb | 2018-12-13 06:44:39 +0000 | [diff] [blame] | 37 | class WebArchive final : public IWebArchive |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 38 | { |
| 39 | public: |
adachan@apple.com | 98102f6 | 2008-04-03 19:00:40 +0000 | [diff] [blame] | 40 | static WebArchive* createInstance(); |
cdumez@apple.com | c12c816 | 2017-05-13 17:33:30 +0000 | [diff] [blame] | 41 | static WebArchive* createInstance(RefPtr<WebCore::LegacyWebArchive>&&); |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 42 | protected: |
cdumez@apple.com | c12c816 | 2017-05-13 17:33:30 +0000 | [diff] [blame] | 43 | WebArchive(RefPtr<WebCore::LegacyWebArchive>&&); |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 44 | ~WebArchive(); |
| 45 | |
| 46 | public: |
| 47 | // IUnknown |
bfulgham@apple.com | d7fd9fd | 2015-08-20 00:00:38 +0000 | [diff] [blame] | 48 | virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject); |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 49 | virtual ULONG STDMETHODCALLTYPE AddRef(); |
| 50 | virtual ULONG STDMETHODCALLTYPE Release(); |
| 51 | |
| 52 | // IWebArchive |
bfulgham@apple.com | d7fd9fd | 2015-08-20 00:00:38 +0000 | [diff] [blame] | 53 | virtual HRESULT STDMETHODCALLTYPE initWithMainResource(_In_opt_ IWebResource* mainResource, |
| 54 | __inout_ecount_full(cSubResources) IWebResource** subResources, int cSubResources, |
| 55 | __inout_ecount_full(cSubFrameArchives) IWebArchive** subFrameArchives, int cSubFrameArchives); |
| 56 | virtual HRESULT STDMETHODCALLTYPE initWithData(_In_opt_ IStream*); |
| 57 | virtual HRESULT STDMETHODCALLTYPE initWithNode(_In_opt_ IDOMNode*); |
| 58 | virtual HRESULT STDMETHODCALLTYPE mainResource(_COM_Outptr_opt_ IWebResource**); |
| 59 | virtual HRESULT STDMETHODCALLTYPE subResources(_COM_Outptr_opt_ IEnumVARIANT**); |
| 60 | virtual HRESULT STDMETHODCALLTYPE subframeArchives(_COM_Outptr_opt_ IEnumVARIANT**); |
| 61 | virtual HRESULT STDMETHODCALLTYPE data(_COM_Outptr_opt_ IStream**); |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 62 | |
| 63 | protected: |
bfulgham@apple.com | d7fd9fd | 2015-08-20 00:00:38 +0000 | [diff] [blame] | 64 | ULONG m_refCount { 0 }; |
bfulgham@apple.com | 14ef42c | 2019-08-08 22:03:58 +0000 | [diff] [blame] | 65 | #if USE(CF) |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 66 | RefPtr<WebCore::LegacyWebArchive> m_archive; |
bfulgham@apple.com | 14ef42c | 2019-08-08 22:03:58 +0000 | [diff] [blame] | 67 | #endif |
beidson@apple.com | 74e89da | 2008-04-01 20:26:27 +0000 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | #endif // WebArchive_h |