enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 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. AND ITS CONTRIBUTORS ``AS IS'' |
| 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #ifndef WebArchive_h |
| 27 | #define WebArchive_h |
| 28 | |
mitz@apple.com | 111c4e8 | 2014-02-11 18:00:45 +0000 | [diff] [blame] | 29 | #if PLATFORM(COCOA) |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 30 | |
| 31 | #include "APIObject.h" |
| 32 | #include <wtf/PassRefPtr.h> |
| 33 | #include <wtf/RefPtr.h> |
| 34 | |
andersca@apple.com | fee681d | 2013-11-13 22:05:12 +0000 | [diff] [blame] | 35 | namespace API { |
| 36 | class Array; |
andersca@apple.com | 2e5d7c6 | 2013-12-16 20:21:24 +0000 | [diff] [blame] | 37 | class Data; |
andersca@apple.com | fee681d | 2013-11-13 22:05:12 +0000 | [diff] [blame] | 38 | } |
| 39 | |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 40 | namespace WebCore { |
| 41 | class LegacyWebArchive; |
| 42 | class Range; |
| 43 | } |
| 44 | |
andersca@apple.com | e54ba96 | 2014-05-06 22:44:56 +0000 | [diff] [blame] | 45 | namespace API { |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 46 | |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 47 | class WebArchiveResource; |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 48 | |
andersca@apple.com | be156ca | 2013-12-10 21:28:37 +0000 | [diff] [blame] | 49 | class WebArchive : public API::ObjectImpl<API::Object::Type::WebArchive> { |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 50 | public: |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 51 | virtual ~WebArchive(); |
| 52 | |
gyuyoung.kim@webkit.org | 5f7960e | 2015-06-17 03:33:26 +0000 | [diff] [blame] | 53 | static Ref<WebArchive> create(WebArchiveResource* mainResource, PassRefPtr<API::Array> subresources, PassRefPtr<API::Array> subframeArchives); |
| 54 | static Ref<WebArchive> create(API::Data*); |
| 55 | static Ref<WebArchive> create(PassRefPtr<WebCore::LegacyWebArchive>); |
| 56 | static Ref<WebArchive> create(WebCore::Range*); |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 57 | |
| 58 | WebArchiveResource* mainResource(); |
andersca@apple.com | fee681d | 2013-11-13 22:05:12 +0000 | [diff] [blame] | 59 | API::Array* subresources(); |
| 60 | API::Array* subframeArchives(); |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 61 | |
zandobersek@gmail.com | 8de57cd | 2015-04-27 20:13:53 +0000 | [diff] [blame] | 62 | Ref<API::Data> data(); |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 63 | |
| 64 | WebCore::LegacyWebArchive* coreLegacyWebArchive(); |
| 65 | |
| 66 | private: |
andersca@apple.com | fee681d | 2013-11-13 22:05:12 +0000 | [diff] [blame] | 67 | WebArchive(WebArchiveResource* mainResource, PassRefPtr<API::Array> subresources, PassRefPtr<API::Array> subframeArchives); |
andersca@apple.com | 2e5d7c6 | 2013-12-16 20:21:24 +0000 | [diff] [blame] | 68 | WebArchive(API::Data*); |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 69 | WebArchive(PassRefPtr<WebCore::LegacyWebArchive>); |
| 70 | |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 71 | RefPtr<WebCore::LegacyWebArchive> m_legacyWebArchive; |
| 72 | RefPtr<WebArchiveResource> m_cachedMainResource; |
andersca@apple.com | fee681d | 2013-11-13 22:05:12 +0000 | [diff] [blame] | 73 | RefPtr<API::Array> m_cachedSubresources; |
| 74 | RefPtr<API::Array> m_cachedSubframeArchives; |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 75 | }; |
| 76 | |
andersca@apple.com | e54ba96 | 2014-05-06 22:44:56 +0000 | [diff] [blame] | 77 | } // namespace API |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 78 | |
mitz@apple.com | 111c4e8 | 2014-02-11 18:00:45 +0000 | [diff] [blame] | 79 | #endif // PLATFORM(COCOA) |
enrica@apple.com | 7eb1d5b | 2013-01-31 21:14:58 +0000 | [diff] [blame] | 80 | |
| 81 | #endif // WebArchive_h |