OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebURL_h | 31 #ifndef WebURL_h |
32 #define WebURL_h | 32 #define WebURL_h |
33 | 33 |
34 #include "WebCString.h" | 34 #include "WebCString.h" |
35 #include "WebString.h" | 35 #include "WebString.h" |
36 #include <url/third_party/mozilla/url_parse.h> | 36 #include <url/third_party/mozilla/url_parse.h> |
37 | 37 |
38 #if INSIDE_BLINK | 38 #if !INSIDE_BLINK |
39 namespace blink { class KURL; } | |
40 #else | |
41 #include <url/gurl.h> | 39 #include <url/gurl.h> |
42 #endif | 40 #endif |
43 | 41 |
44 namespace blink { | 42 namespace blink { |
45 | 43 |
| 44 class KURL; |
| 45 |
46 class WebURL { | 46 class WebURL { |
47 public: | 47 public: |
48 ~WebURL() | 48 ~WebURL() |
49 { | 49 { |
50 } | 50 } |
51 | 51 |
52 WebURL() | 52 WebURL() |
53 : m_isValid(false) | 53 : m_isValid(false) |
54 { | 54 { |
55 } | 55 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 { | 95 { |
96 return m_string.isEmpty(); | 96 return m_string.isEmpty(); |
97 } | 97 } |
98 | 98 |
99 bool isNull() const | 99 bool isNull() const |
100 { | 100 { |
101 return m_string.isEmpty(); | 101 return m_string.isEmpty(); |
102 } | 102 } |
103 | 103 |
104 #if INSIDE_BLINK | 104 #if INSIDE_BLINK |
105 BLINK_PLATFORM_EXPORT WebURL(const blink::KURL&); | 105 BLINK_PLATFORM_EXPORT WebURL(const KURL&); |
106 BLINK_PLATFORM_EXPORT WebURL& operator=(const blink::KURL&); | 106 BLINK_PLATFORM_EXPORT WebURL& operator=(const KURL&); |
107 BLINK_PLATFORM_EXPORT operator blink::KURL() const; | 107 BLINK_PLATFORM_EXPORT operator KURL() const; |
108 #else | 108 #else |
109 WebURL(const GURL& url) | 109 WebURL(const GURL& url) |
110 : m_string(WebString::fromUTF8(url.possibly_invalid_spec())) | 110 : m_string(WebString::fromUTF8(url.possibly_invalid_spec())) |
111 , m_parsed(url.parsed_for_possibly_invalid_spec()) | 111 , m_parsed(url.parsed_for_possibly_invalid_spec()) |
112 , m_isValid(url.is_valid()) | 112 , m_isValid(url.is_valid()) |
113 { | 113 { |
114 } | 114 } |
115 | 115 |
116 WebURL& operator=(const GURL& url) | 116 WebURL& operator=(const GURL& url) |
117 { | 117 { |
(...skipping 21 matching lines...) Expand all Loading... |
139 } | 139 } |
140 | 140 |
141 inline bool operator!=(const WebURL& a, const WebURL& b) | 141 inline bool operator!=(const WebURL& a, const WebURL& b) |
142 { | 142 { |
143 return !(a == b); | 143 return !(a == b); |
144 } | 144 } |
145 | 145 |
146 } // namespace blink | 146 } // namespace blink |
147 | 147 |
148 #endif | 148 #endif |
OLD | NEW |