summaryrefslogtreecommitdiffstats
path: root/url/gurl.h
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-18 21:19:45 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-18 21:19:45 +0000
commit318076b4adca3868e0f2438953e69f2ce2d6336f (patch)
tree98d4c5d4a5442c86c526cca6538a099de4f04360 /url/gurl.h
parent3c9185a2ddfbe06f42d0aca50d1a6e33b3ed3a8b (diff)
downloadchromium_src-318076b4adca3868e0f2438953e69f2ce2d6336f.zip
chromium_src-318076b4adca3868e0f2438953e69f2ce2d6336f.tar.gz
chromium_src-318076b4adca3868e0f2438953e69f2ce2d6336f.tar.bz2
url: Build it as a static library.
This is temporary just to avoid weird link issues in Windows XP. - Update the gyp file. - Rename the gyp file from googleurl.gyp to url.gyp, so it matches the directory name. - Update the header include paths. - Update the header include guards. - Rename the target name from googleurl to url and googleurl_unittests to url_unittests. - Remove GURL_API (this will be replaced by URL_EXPORT when we componentize it again). - Remove url_common.h (will be replaced by url_export.h when we componentize it again). BUG=229660 TEST=url_unittests R=brettw@chromium.org Review URL: https://codereview.chromium.org/13998025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url/gurl.h')
-rw-r--r--url/gurl.h75
1 files changed, 37 insertions, 38 deletions
diff --git a/url/gurl.h b/url/gurl.h
index 76c595d..4f0c97a 100644
--- a/url/gurl.h
+++ b/url/gurl.h
@@ -27,17 +27,16 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef GOOGLEURL_SRC_GURL_H__
-#define GOOGLEURL_SRC_GURL_H__
+#ifndef URL_GURL_H_
+#define URL_GURL_H_
#include <iosfwd>
#include <string>
#include "base/string16.h"
-#include "googleurl/src/url_canon.h"
-#include "googleurl/src/url_canon_stdstring.h"
-#include "googleurl/src/url_common.h"
-#include "googleurl/src/url_parse.h"
+#include "url/url_canon.h"
+#include "url/url_canon_stdstring.h"
+#include "url/url_parse.h"
class GURL {
public:
@@ -45,11 +44,11 @@ class GURL {
typedef url_canon::StdStringReplacements<string16> ReplacementsW;
// Creates an empty, invalid URL.
- GURL_API GURL();
+ GURL();
// Copy construction is relatively inexpensive, with most of the time going
// to reallocating the string. It does not re-parse.
- GURL_API GURL(const GURL& other);
+ GURL(const GURL& other);
// The narrow version requires the input be UTF-8. Invalid UTF-8 input will
// result in an invalid URL.
@@ -58,20 +57,20 @@ class GURL {
// encode the query parameters. It is probably sufficient for the narrow
// version to assume the query parameter encoding should be the same as the
// input encoding.
- GURL_API explicit GURL(const std::string& url_string
- /*, output_param_encoding*/);
- GURL_API explicit GURL(const string16& url_string
- /*, output_param_encoding*/);
+ explicit GURL(const std::string& url_string
+ /*, output_param_encoding*/);
+ explicit GURL(const string16& url_string
+ /*, output_param_encoding*/);
// Constructor for URLs that have already been parsed and canonicalized. This
// is used for conversions from KURL, for example. The caller must supply all
// information associated with the URL, which must be correct and consistent.
- GURL_API GURL(const char* canonical_spec, size_t canonical_spec_len,
- const url_parse::Parsed& parsed, bool is_valid);
+ GURL(const char* canonical_spec, size_t canonical_spec_len,
+ const url_parse::Parsed& parsed, bool is_valid);
- GURL_API ~GURL();
+ ~GURL();
- GURL_API GURL& operator=(const GURL& other);
+ GURL& operator=(const GURL& other);
// Returns true when this object represents a valid parsed URL. When not
// valid, other functions will still succeed, but you will not get canonical
@@ -103,7 +102,7 @@ class GURL {
// Used invalid_spec() below to get the unusable spec of an invalid URL. This
// separation is designed to prevent errors that may cause security problems
// that could result from the mistaken use of an invalid URL.
- GURL_API const std::string& spec() const;
+ const std::string& spec() const;
// Returns the potentially invalid spec for a the URL. This spec MUST NOT be
// modified or sent over the network. It is designed to be displayed in error
@@ -155,8 +154,8 @@ class GURL {
//
// It is an error to resolve a URL relative to an invalid URL. The result
// will be the empty URL.
- GURL_API GURL Resolve(const std::string& relative) const;
- GURL_API GURL Resolve(const string16& relative) const;
+ GURL Resolve(const std::string& relative) const;
+ GURL Resolve(const string16& relative) const;
// Like Resolve() above but takes a character set encoder which will be used
// for any query text specified in the input. The charset converter parameter
@@ -165,10 +164,10 @@ class GURL {
// TODO(brettw): These should be replaced with versions that take something
// more friendly than a raw CharsetConverter (maybe like an ICU character set
// name).
- GURL_API GURL ResolveWithCharsetConverter(
+ GURL ResolveWithCharsetConverter(
const std::string& relative,
url_canon::CharsetConverter* charset_converter) const;
- GURL_API GURL ResolveWithCharsetConverter(
+ GURL ResolveWithCharsetConverter(
const string16& relative,
url_canon::CharsetConverter* charset_converter) const;
@@ -183,9 +182,9 @@ class GURL {
//
// Note that we use the more general url_canon::Replacements type to give
// callers extra flexibility rather than our override.
- GURL_API GURL ReplaceComponents(
+ GURL ReplaceComponents(
const url_canon::Replacements<char>& replacements) const;
- GURL_API GURL ReplaceComponents(
+ GURL ReplaceComponents(
const url_canon::Replacements<char16>& replacements) const;
// A helper function that is equivalent to replacing the path with a slash
@@ -197,7 +196,7 @@ class GURL {
//
// It is an error to get an empty path on an invalid URL. The result
// will be the empty URL.
- GURL_API GURL GetWithEmptyPath() const;
+ GURL GetWithEmptyPath() const;
// A helper function to return a GURL containing just the scheme, host,
// and port from a URL. Equivalent to clearing any username and password,
@@ -208,19 +207,19 @@ class GURL {
//
// It is an error to get the origin of an invalid URL. The result
// will be the empty URL.
- GURL_API GURL GetOrigin() const;
+ GURL GetOrigin() const;
// Returns true if the scheme for the current URL is a known "standard"
// scheme. Standard schemes have an authority and a path section. This
// includes file: and filesystem:, which some callers may want to filter out
// explicitly by calling SchemeIsFile[System].
- GURL_API bool IsStandard() const;
+ bool IsStandard() const;
// Returns true if the given parameter (should be lower-case ASCII to match
// the canonicalized scheme) is the scheme for this URL. This call is more
// efficient than getting the scheme and comparing it because no copies or
// object constructions are done.
- GURL_API bool SchemeIs(const char* lower_ascii_scheme) const;
+ bool SchemeIs(const char* lower_ascii_scheme) const;
// We often need to know if this is a file URL. File URLs are "standard", but
// are often treated separately by some programs.
@@ -242,7 +241,7 @@ class GURL {
// Returns true if the hostname is an IP address. Note: this function isn't
// as cheap as a simple getter because it re-parses the hostname to verify.
// This currently identifies only IPv4 addresses (bug 822685).
- GURL_API bool HostIsIPAddress() const;
+ bool HostIsIPAddress() const;
// Getters for various components of the URL. The returned string will be
// empty if the component is empty or is not present.
@@ -308,24 +307,24 @@ class GURL {
// Returns a parsed version of the port. Can also be any of the special
// values defined in Parsed for ExtractPort.
- GURL_API int IntPort() const;
+ int IntPort() const;
// Returns the port number of the url, or the default port number.
// If the scheme has no concept of port (or unknown default) returns
// PORT_UNSPECIFIED.
- GURL_API int EffectiveIntPort() const;
+ int EffectiveIntPort() const;
// Extracts the filename portion of the path and returns it. The filename
// is everything after the last slash in the path. This may be empty.
- GURL_API std::string ExtractFileName() const;
+ std::string ExtractFileName() const;
// Returns the path that should be sent to the server. This is the path,
// parameter, and query portions of the URL. It is guaranteed to be ASCII.
- GURL_API std::string PathForRequest() const;
+ std::string PathForRequest() const;
// Returns the host, excluding the square brackets surrounding IPv6 address
// literals. This can be useful for passing to getaddrinfo().
- GURL_API std::string HostNoBrackets() const;
+ std::string HostNoBrackets() const;
// Returns true if this URL's host matches or is in the same domain as
// the given input string. For example if this URL was "www.google.com",
@@ -337,7 +336,7 @@ class GURL {
//
// If function DomainIs has parameter domain_len, which means the parameter
// lower_ascii_domain does not gurantee to terminate with NULL character.
- GURL_API bool DomainIs(const char* lower_ascii_domain, int domain_len) const;
+ bool DomainIs(const char* lower_ascii_domain, int domain_len) const;
// If function DomainIs only has parameter lower_ascii_domain, which means
// domain string should be terminate with NULL character.
@@ -348,12 +347,12 @@ class GURL {
// Swaps the contents of this GURL object with the argument without doing
// any memory allocations.
- GURL_API void Swap(GURL* other);
+ void Swap(GURL* other);
// Returns a reference to a singleton empty GURL. This object is for callers
// who return references but don't have anything to return in some cases.
// This function may be called from any thread.
- GURL_API static const GURL& EmptyGURL();
+ static const GURL& EmptyGURL();
// Returns the inner URL of a nested URL [currently only non-null for
// filesystem: URLs].
@@ -387,6 +386,6 @@ class GURL {
};
// Stream operator so GURL can be used in assertion statements.
-GURL_API std::ostream& operator<<(std::ostream& out, const GURL& url);
+std::ostream& operator<<(std::ostream& out, const GURL& url);
-#endif // GOOGLEURL_SRC_GURL_H__
+#endif // URL_GURL_H_