OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 12 matching lines...) Expand all Loading... |
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 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 | 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 | 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. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef ArchiveResource_h | 29 #ifndef ArchiveResource_h |
30 #define ArchiveResource_h | 30 #define ArchiveResource_h |
31 | 31 |
32 #include "platform/SharedBuffer.h" | 32 #include "platform/SharedBuffer.h" |
| 33 #include "platform/heap/Handle.h" |
33 #include "platform/network/ResourceResponse.h" | 34 #include "platform/network/ResourceResponse.h" |
34 #include "platform/weborigin/KURL.h" | 35 #include "platform/weborigin/KURL.h" |
35 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
36 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
37 | 38 |
38 namespace WebCore { | 39 namespace WebCore { |
39 | 40 |
40 class PLATFORM_EXPORT ArchiveResource : public RefCounted<ArchiveResource> { | 41 class PLATFORM_EXPORT ArchiveResource FINAL : public RefCountedWillBeGarbageColl
ectedFinalized<ArchiveResource> { |
41 public: | 42 public: |
42 static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KU
RL&, const ResourceResponse&); | 43 static PassRefPtrWillBeRawPtr<ArchiveResource> create(PassRefPtr<SharedBuffe
r>, const KURL&, const ResourceResponse&); |
43 static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KU
RL&, | 44 static PassRefPtrWillBeRawPtr<ArchiveResource> create(PassRefPtr<SharedBuffe
r>, const KURL&, |
44 const AtomicString& mimeType, const AtomicString& textEncoding, const St
ring& frameName, | 45 const AtomicString& mimeType, const AtomicString& textEncoding, const St
ring& frameName, |
45 const ResourceResponse& = ResourceResponse()); | 46 const ResourceResponse& = ResourceResponse()); |
46 | 47 |
| 48 ~ArchiveResource(); |
| 49 |
47 const KURL& url() const { return m_url; } | 50 const KURL& url() const { return m_url; } |
48 const ResourceResponse& response() const { return m_response; } | 51 const ResourceResponse& response() const { return m_response; } |
49 SharedBuffer* data() const { return m_data.get(); } | 52 SharedBuffer* data() const { return m_data.get(); } |
50 const AtomicString& mimeType() const { return m_mimeType; } | 53 const AtomicString& mimeType() const { return m_mimeType; } |
51 const AtomicString& textEncoding() const { return m_textEncoding; } | 54 const AtomicString& textEncoding() const { return m_textEncoding; } |
52 const String& frameName() const { return m_frameName; } | 55 const String& frameName() const { return m_frameName; } |
53 | 56 |
| 57 void trace(Visitor*) { } |
| 58 |
54 private: | 59 private: |
55 ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const AtomicString& m
imeType, const AtomicString& textEncoding, const String& frameName, const Resour
ceResponse&); | 60 ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const AtomicString& m
imeType, const AtomicString& textEncoding, const String& frameName, const Resour
ceResponse&); |
56 | 61 |
57 KURL m_url; | 62 KURL m_url; |
58 ResourceResponse m_response; | 63 ResourceResponse m_response; |
59 RefPtr<SharedBuffer> m_data; | 64 RefPtr<SharedBuffer> m_data; |
60 AtomicString m_mimeType; | 65 AtomicString m_mimeType; |
61 AtomicString m_textEncoding; | 66 AtomicString m_textEncoding; |
62 String m_frameName; | 67 String m_frameName; |
63 }; | 68 }; |
64 | 69 |
65 } | 70 } |
66 | 71 |
67 #endif // ArchiveResource_h | 72 #endif // ArchiveResource_h |
OLD | NEW |