diff options
Diffstat (limited to 'WebCore/platform/KURL.h')
| -rw-r--r-- | WebCore/platform/KURL.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/WebCore/platform/KURL.h b/WebCore/platform/KURL.h index 73fadd1..647330d 100644 --- a/WebCore/platform/KURL.h +++ b/WebCore/platform/KURL.h @@ -78,6 +78,7 @@ public: KURL(const KURL& base, const String& relative); KURL(const KURL& base, const String& relative, const TextEncoding&); + #if USE(GOOGLEURL) // For conversions for other structures that have already parsed and // canonicalized the URL. The input must be exactly what KURL would have @@ -104,6 +105,12 @@ public: // non-hierarchical (like "javascript:") URLs will have no path. bool hasPath() const; + // Returns true if you can set the host and port for the URL. + // Non-hierarchical URLs don't have a host and port. + bool canSetHostOrPort() const { return isHierarchical(); } + + bool canSetPathname() const { return isHierarchical(); } + #if USE(GOOGLEURL) const String& string() const { return m_url.string(); } #else @@ -113,6 +120,7 @@ public: String protocol() const; String host() const; unsigned short port() const; + bool hasPort() const; String user() const; String pass() const; String path() const; @@ -135,7 +143,7 @@ public: void setProtocol(const String&); void setHost(const String&); - // Setting the port to 0 will clear any port from the URL. + void removePort(); void setPort(unsigned short); // Input is like "foo.com" or "foo.com:8000". @@ -254,6 +262,10 @@ const KURL& blankURL(); bool protocolIs(const String& url, const char* protocol); bool protocolIsJavaScript(const String& url); +bool isValidProtocol(const String& protocol); + +bool isDefaultPortForProtocol(unsigned short port, const String& protocol); +bool portAllowed(const KURL&); // Blacklist ports that should never be used for Web resources. String mimeTypeFromDataURL(const String& url); @@ -317,6 +329,11 @@ inline bool KURL::isValid() const return m_isValid; } +inline bool KURL::hasPort() const +{ + return m_hostEnd < m_portEnd; +} + inline bool KURL::protocolInHTTPFamily() const { return m_protocolInHTTPFamily; |
