diff options
| author | Steve Block <steveblock@google.com> | 2009-12-17 09:55:06 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2009-12-17 09:55:06 -0800 |
| commit | b880d713c04257ca40abfef97c300afdead423b8 (patch) | |
| tree | 6982576c228bcd1a7efe98afed544d840751094c /WebCore/platform/KURL.h | |
| parent | e2e7a5c57b53f01e63a0245b4420d54b454cb373 (diff) | |
| parent | 643ca7872b450ea4efacab6188849e5aac2ba161 (diff) | |
| download | external_webkit-b880d713c04257ca40abfef97c300afdead423b8.zip external_webkit-b880d713c04257ca40abfef97c300afdead423b8.tar.gz external_webkit-b880d713c04257ca40abfef97c300afdead423b8.tar.bz2 | |
am 643ca787: Merge webkit.org at r51976 : Initial merge by git.
Merge commit '643ca7872b450ea4efacab6188849e5aac2ba161' into eclair-mr2-plus-aosp
* commit '643ca7872b450ea4efacab6188849e5aac2ba161':
Merge webkit.org at r51976 : Initial merge by git.
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; |
