Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1807)

Unified Diff: net/base/net_util_icu.cc

Issue 1131813004: Revert of Create net::FormatOriginForDisplay helper function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_util.h ('k') | net/base/net_util_icu_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util_icu.cc
diff --git a/net/base/net_util_icu.cc b/net/base/net_util_icu.cc
index bdbe2701351b46d54e695b25e323e78daf90940e..94e1a0d7232a65a7c517e714fa128fc571b47aa2 100644
--- a/net/base/net_util_icu.cc
+++ b/net/base/net_util_icu.cc
@@ -797,7 +797,7 @@
// after stripping the prefix. The only thing necessary is to add an
// adjustment to reflect the stripped prefix.
adjustments->insert(adjustments->begin(),
- base::OffsetAdjuster::Adjustment(0, kHTTPSize, 0));
+ base::OffsetAdjuster::Adjustment(0, kHTTPSize, 0));
if (prefix_end)
*prefix_end -= kHTTPSize;
@@ -829,46 +829,4 @@
return result;
}
-base::string16 FormatOriginForDisplay(const GURL& url,
- const std::string& languages,
- bool omit_scheme) {
- if (!url.IsStandard())
- return FormatUrl(url, languages);
-
- if (url.SchemeIsFile()) {
- // TODO(palmer): Determine whether to encode this policy in GURL::GetOrigin.
- return (omit_scheme ? base::ASCIIToUTF16("")
- : base::ASCIIToUTF16("file://")) +
- base::UTF8ToUTF16(url.path());
- }
-
- if (url.SchemeIsFileSystem()) {
- // TODO(palmer): Determine whether to encode this policy in GURL::GetOrigin.
- const GURL inner_url(url.spec().substr(strlen("filesystem:")));
- return base::ASCIIToUTF16("filesystem:") +
- FormatOriginForDisplay(inner_url, languages, omit_scheme);
- }
-
- const GURL origin = url.GetOrigin();
- const std::string& scheme = origin.scheme();
- const std::string& host = origin.host();
- if (scheme.empty() || host.empty())
- return FormatUrl(url, languages);
-
- base::string16 result;
-
- if (!omit_scheme)
- result = base::UTF8ToUTF16(scheme) + base::ASCIIToUTF16("://");
-
- result += base::UTF8ToUTF16(host);
-
- const int port = origin.IntPort();
- const int default_port = url::DefaultPortForScheme(origin.scheme().c_str(),
- origin.scheme().length());
- if (origin.port().length() > 0 && port != 0 && port != default_port)
- result += base::ASCIIToUTF16(":") + base::UTF8ToUTF16(origin.port());
-
- return result;
-}
-
} // namespace net
« no previous file with comments | « net/base/net_util.h ('k') | net/base/net_util_icu_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698