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

Unified Diff: net/http/http_util_icu.cc

Issue 213017: Moving two http utility functions to a separate source file due to dependency... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/http/http_util.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util_icu.cc
===================================================================
--- net/http/http_util_icu.cc (revision 0)
+++ net/http/http_util_icu.cc (revision 0)
@@ -0,0 +1,30 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
darin (slow to review) 2009/09/18 04:29:14 please update the copyright date to include 2009
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// The rules for parsing content-types were borrowed from Firefox:
+// http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834
+
+#include "net/http/http_util.h"
+
+#include "base/logging.h"
+
darin (slow to review) 2009/09/18 04:29:14 nit: there should be no newline here.
+#include "net/base/net_util.h"
+
+namespace net {
+
+// static
+std::string HttpUtil::PathForRequest(const GURL& url) {
+ DCHECK(url.is_valid() && (url.SchemeIs("http") || url.SchemeIs("https")));
+ if (url.has_query())
+ return url.path() + "?" + url.query();
+ return url.path();
+}
+
+// static
+std::string HttpUtil::SpecForRequest(const GURL& url) {
+ DCHECK(url.is_valid() && (url.SchemeIs("http") || url.SchemeIs("https")));
+ return SimplifyUrlForRequest(url).spec();
+}
+
+} // namespace net
Property changes on: net\http\http_util_icu.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « net/http/http_util.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698