summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-12-06 01:58:21 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-06 09:58:40 +0000
commit3a0887767fb5ddfc95bdb86dadbb4a442ed023bb (patch)
tree459f782c2bd6065ab13a913e329a83239e9dbcb5
parent0027a48cdffe4f37afe5d6097a0be0ffa68aab30 (diff)
downloadchromium_src-3a0887767fb5ddfc95bdb86dadbb4a442ed023bb.zip
chromium_src-3a0887767fb5ddfc95bdb86dadbb4a442ed023bb.tar.gz
chromium_src-3a0887767fb5ddfc95bdb86dadbb4a442ed023bb.tar.bz2
Uninline GURL's comparison operators.
This reduces binary size by ~70KB on a linux64 release build. BUG=none Review URL: https://codereview.chromium.org/787443003 Cr-Commit-Position: refs/heads/master@{#307170}
-rw-r--r--url/gurl.cc16
-rw-r--r--url/gurl.h16
2 files changed, 20 insertions, 12 deletions
diff --git a/url/gurl.cc b/url/gurl.cc
index b580125..46ca408 100644
--- a/url/gurl.cc
+++ b/url/gurl.cc
@@ -177,6 +177,22 @@ const std::string& GURL::spec() const {
return EmptyStringForGURL();
}
+bool GURL::operator==(const GURL& other) const {
+ return spec_ == other.spec_;
+}
+
+bool GURL::operator!=(const GURL& other) const {
+ return spec_ != other.spec_;
+}
+
+bool GURL::operator<(const GURL& other) const {
+ return spec_ < other.spec_;
+}
+
+bool GURL::operator>(const GURL& other) const {
+ return spec_ > other.spec_;
+}
+
GURL GURL::Resolve(const std::string& relative) const {
return ResolveWithCharsetConverter(relative, NULL);
}
diff --git a/url/gurl.h b/url/gurl.h
index f370934..ef1e529 100644
--- a/url/gurl.h
+++ b/url/gurl.h
@@ -112,20 +112,12 @@ class URL_EXPORT GURL {
}
// Defiant equality operator!
- bool operator==(const GURL& other) const {
- return spec_ == other.spec_;
- }
- bool operator!=(const GURL& other) const {
- return spec_ != other.spec_;
- }
+ bool operator==(const GURL& other) const;
+ bool operator!=(const GURL& other) const;
// Allows GURL to used as a key in STL (for example, a std::set or std::map).
- bool operator<(const GURL& other) const {
- return spec_ < other.spec_;
- }
- bool operator>(const GURL& other) const {
- return spec_ > other.spec_;
- }
+ bool operator<(const GURL& other) const;
+ bool operator>(const GURL& other) const;
// Resolves a URL that's possibly relative to this object's URL, and returns
// it. Absolute URLs are also handled according to the rules of URLs on web