darin | 123ff8e | 2005-06-05 17:54:49 +0000 | [diff] [blame] | 1 | /* |
darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 2 | * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
darin | 123ff8e | 2005-06-05 17:54:49 +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 | * |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
mjs@apple.com | 9204733 | 2014-03-15 04:08:27 +0000 | [diff] [blame] | 13 | * 3. Neither the name of Apple Inc. ("Apple") nor the names of |
darin | 123ff8e | 2005-06-05 17:54:49 +0000 | [diff] [blame] | 14 | * its contributors may be used to endorse or promote products derived |
| 15 | * from this software without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
rjw | 20c863f | 2002-03-17 02:08:29 +0000 | [diff] [blame] | 28 | |
tonyg@chromium.org | 938b60e | 2011-01-17 21:38:32 +0000 | [diff] [blame] | 29 | #ifndef NetscapePlugInStreamLoader_h |
| 30 | #define NetscapePlugInStreamLoader_h |
| 31 | |
darin | c111655 | 2006-10-30 20:05:39 +0000 | [diff] [blame] | 32 | #include "ResourceLoader.h" |
| 33 | #include <wtf/Forward.h> |
cblu | 911598a | 2002-07-26 01:14:13 +0000 | [diff] [blame] | 34 | |
darin | bc60feae | 2006-10-22 06:39:11 +0000 | [diff] [blame] | 35 | namespace WebCore { |
darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 36 | |
beidson@apple.com | 1b3512e | 2012-10-16 20:22:18 +0000 | [diff] [blame] | 37 | class NetscapePlugInStreamLoader; |
cblu | 70cd5dc | 2003-03-10 18:37:12 +0000 | [diff] [blame] | 38 | |
beidson@apple.com | 1b3512e | 2012-10-16 20:22:18 +0000 | [diff] [blame] | 39 | class NetscapePlugInStreamLoaderClient { |
| 40 | public: |
| 41 | virtual void didReceiveResponse(NetscapePlugInStreamLoader*, const ResourceResponse&) = 0; |
| 42 | virtual void didReceiveData(NetscapePlugInStreamLoader*, const char*, int) = 0; |
| 43 | virtual void didFail(NetscapePlugInStreamLoader*, const ResourceError&) = 0; |
| 44 | virtual void didFinishLoading(NetscapePlugInStreamLoader*) { } |
| 45 | virtual bool wantsAllStreams() const { return false; } |
darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 46 | |
beidson@apple.com | 1b3512e | 2012-10-16 20:22:18 +0000 | [diff] [blame] | 47 | protected: |
| 48 | virtual ~NetscapePlugInStreamLoaderClient() { } |
| 49 | }; |
andersca | b425ee5 | 2007-09-18 00:11:23 +0000 | [diff] [blame] | 50 | |
ap@apple.com | 178e91d | 2014-05-18 05:29:36 +0000 | [diff] [blame] | 51 | class NetscapePlugInStreamLoader final : public ResourceLoader { |
beidson@apple.com | 1b3512e | 2012-10-16 20:22:18 +0000 | [diff] [blame] | 52 | public: |
commit-queue@webkit.org | 8cc7564 | 2014-08-22 18:25:37 +0000 | [diff] [blame] | 53 | WEBCORE_EXPORT static PassRefPtr<NetscapePlugInStreamLoader> create(Frame*, NetscapePlugInStreamLoaderClient*, const ResourceRequest&); |
beidson@apple.com | 1b3512e | 2012-10-16 20:22:18 +0000 | [diff] [blame] | 54 | virtual ~NetscapePlugInStreamLoader(); |
darin | bc60feae | 2006-10-22 06:39:11 +0000 | [diff] [blame] | 55 | |
commit-queue@webkit.org | 8cc7564 | 2014-08-22 18:25:37 +0000 | [diff] [blame] | 56 | WEBCORE_EXPORT bool isDone() const; |
darin | bc60feae | 2006-10-22 06:39:11 +0000 | [diff] [blame] | 57 | |
beidson@apple.com | 1b3512e | 2012-10-16 20:22:18 +0000 | [diff] [blame] | 58 | private: |
commit-queue@webkit.org | 2dfe6cb | 2014-01-16 19:42:50 +0000 | [diff] [blame] | 59 | virtual void didReceiveResponse(const ResourceResponse&) override; |
| 60 | virtual void didReceiveData(const char*, unsigned, long long encodedDataLength, DataPayloadType) override; |
| 61 | virtual void didReceiveBuffer(PassRefPtr<SharedBuffer>, long long encodedDataLength, DataPayloadType) override; |
| 62 | virtual void didFinishLoading(double finishTime) override; |
| 63 | virtual void didFail(const ResourceError&) override; |
darin | bc60feae | 2006-10-22 06:39:11 +0000 | [diff] [blame] | 64 | |
commit-queue@webkit.org | 2dfe6cb | 2014-01-16 19:42:50 +0000 | [diff] [blame] | 65 | virtual void releaseResources() override; |
darin | bc60feae | 2006-10-22 06:39:11 +0000 | [diff] [blame] | 66 | |
beidson@apple.com | 1b3512e | 2012-10-16 20:22:18 +0000 | [diff] [blame] | 67 | NetscapePlugInStreamLoader(Frame*, NetscapePlugInStreamLoaderClient*); |
darin | 95e399c | 2006-10-24 03:28:02 +0000 | [diff] [blame] | 68 | |
commit-queue@webkit.org | 2dfe6cb | 2014-01-16 19:42:50 +0000 | [diff] [blame] | 69 | virtual void willCancel(const ResourceError&) override; |
| 70 | virtual void didCancel(const ResourceError&) override; |
darin | bc60feae | 2006-10-22 06:39:11 +0000 | [diff] [blame] | 71 | |
beidson@apple.com | 193a060 | 2013-03-14 16:28:04 +0000 | [diff] [blame] | 72 | void didReceiveDataOrBuffer(const char*, int, PassRefPtr<SharedBuffer>, long long encodedDataLength, DataPayloadType); |
| 73 | |
beidson@apple.com | 1b3512e | 2012-10-16 20:22:18 +0000 | [diff] [blame] | 74 | NetscapePlugInStreamLoaderClient* m_client; |
| 75 | }; |
darin | bc60feae | 2006-10-22 06:39:11 +0000 | [diff] [blame] | 76 | |
rjw | 20c863f | 2002-03-17 02:08:29 +0000 | [diff] [blame] | 77 | } |
tonyg@chromium.org | 938b60e | 2011-01-17 21:38:32 +0000 | [diff] [blame] | 78 | |
| 79 | #endif // NetscapePlugInStreamLoader_h |