OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Motorola Mobility Inc. | 3 * Copyright (C) 2012 Motorola Mobility Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 11 matching lines...) Expand all Loading... |
22 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef DOMURL_h | 27 #ifndef DOMURL_h |
28 #define DOMURL_h | 28 #define DOMURL_h |
29 | 29 |
30 #include "bindings/v8/ScriptWrappable.h" | 30 #include "bindings/v8/ScriptWrappable.h" |
31 #include "core/dom/DOMURLUtils.h" | 31 #include "core/dom/DOMURLUtils.h" |
| 32 #include "heap/Handle.h" |
32 #include "platform/weborigin/KURL.h" | 33 #include "platform/weborigin/KURL.h" |
33 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
34 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
35 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
36 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
37 | 38 |
38 namespace WebCore { | 39 namespace WebCore { |
39 | 40 |
40 class Blob; | 41 class Blob; |
41 class ExceptionState; | 42 class ExceptionState; |
42 class ExecutionContext; | 43 class ExecutionContext; |
43 class URLRegistrable; | 44 class URLRegistrable; |
44 | 45 |
45 class DOMURL FINAL : public ScriptWrappable, public DOMURLUtils, public RefCount
ed<DOMURL> { | 46 class DOMURL FINAL : public RefCountedWillBeGarbageCollectedFinalized<DOMURL>, p
ublic ScriptWrappable, public DOMURLUtils { |
46 | 47 DECLARE_GC_INFO; |
47 public: | 48 public: |
48 static PassRefPtr<DOMURL> create(const String& url, ExceptionState& exceptio
nState) | 49 static PassRefPtrWillBeRawPtr<DOMURL> create(const String& url, ExceptionSta
te& exceptionState) |
49 { | 50 { |
50 return adoptRef(new DOMURL(url, blankURL(), exceptionState)); | 51 return adoptRefWillBeNoop(new DOMURL(url, blankURL(), exceptionState)); |
51 } | 52 } |
52 static PassRefPtr<DOMURL> create(const String& url, const String& base, Exce
ptionState& exceptionState) | 53 static PassRefPtrWillBeRawPtr<DOMURL> create(const String& url, const String
& base, ExceptionState& exceptionState) |
53 { | 54 { |
54 return adoptRef(new DOMURL(url, KURL(KURL(), base), exceptionState)); | 55 return adoptRefWillBeNoop(new DOMURL(url, KURL(KURL(), base), exceptionS
tate)); |
55 } | 56 } |
56 static PassRefPtr<DOMURL> create(const String& url, PassRefPtr<DOMURL> base,
ExceptionState& exceptionState) | 57 static PassRefPtrWillBeRawPtr<DOMURL> create(const String& url, PassRefPtrWi
llBeRawPtr<DOMURL> base, ExceptionState& exceptionState) |
57 { | 58 { |
58 ASSERT(base); | 59 ASSERT(base); |
59 return adoptRef(new DOMURL(url, base->m_url, exceptionState)); | 60 return adoptRefWillBeNoop(new DOMURL(url, base->m_url, exceptionState)); |
60 } | 61 } |
61 | 62 |
62 static String createObjectURL(ExecutionContext*, Blob*); | 63 static String createObjectURL(ExecutionContext*, Blob*); |
63 static void revokeObjectURL(ExecutionContext*, const String&); | 64 static void revokeObjectURL(ExecutionContext*, const String&); |
64 | 65 |
65 static String createPublicURL(ExecutionContext*, URLRegistrable*); | 66 static String createPublicURL(ExecutionContext*, URLRegistrable*); |
66 | 67 |
67 virtual KURL url() const OVERRIDE { return m_url; } | 68 virtual KURL url() const OVERRIDE { return m_url; } |
68 virtual void setURL(const KURL& url) OVERRIDE { m_url = url; } | 69 virtual void setURL(const KURL& url) OVERRIDE { m_url = url; } |
69 | 70 |
70 virtual String input() const OVERRIDE { return m_input; } | 71 virtual String input() const OVERRIDE { return m_input; } |
71 virtual void setInput(const String&) OVERRIDE; | 72 virtual void setInput(const String&) OVERRIDE; |
72 | 73 |
| 74 void trace(Visitor*) { } |
| 75 |
73 private: | 76 private: |
74 DOMURL(const String& url, const KURL& base, ExceptionState&); | 77 DOMURL(const String& url, const KURL& base, ExceptionState&); |
75 | 78 |
76 KURL m_url; | 79 KURL m_url; |
77 String m_input; | 80 String m_input; |
78 }; | 81 }; |
79 | 82 |
80 } // namespace WebCore | 83 } // namespace WebCore |
81 | 84 |
82 #endif // DOMURL_h | 85 #endif // DOMURL_h |
OLD | NEW |