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

Unified Diff: net/base/cookie_utils.h

Issue 8468010: Creation of cookie_utils. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Indentation Created 9 years, 1 month 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/cookie_monster_unittest.cc ('k') | net/base/cookie_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cookie_utils.h
diff --git a/net/base/cookie_utils.h b/net/base/cookie_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..603517a52d762d06f4aaad4cfbaad1dc18bbcadd
--- /dev/null
+++ b/net/base/cookie_utils.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_COOKIE_UTILS_H_
+#define NET_BASE_COOKIE_UTILS_H_
+#pragma once
+
+#include <string>
+
+class GURL;
+
+namespace net {
+namespace cookie_utils {
wtc 2011/11/16 06:34:31 Please rename cookie_utils to cookie_util in file
+
+// Returns the effective TLD+1 for a given host. This only makes sense for http
+// and https schemes. For other schemes, the host will be returned unchanged
+// (minus any leading period).
+NET_EXPORT std::string GetEffectiveDomain(const std::string& scheme,
erikwright (departed) 2011/11/15 18:14:27 I think you need: #include "net/base/net_export.h
+ const std::string& host);
+
+// Determine the actual cookie domain based on the domain string passed
+// (if any) and the URL from which the cookie came.
+// On success returns true, and sets cookie_domain to either a
+// -host cookie domain (ex: "google.com")
+// -domain cookie domain (ex: ".google.com")
+NET_EXPORT bool GetCookieDomainWithString(const GURL& url,
+ const std::string& domain_string,
+ std::string* result);
+
+// Returns true if a domain string represents a host-only cookie,
+// i.e. it doesn't begin with a leading '.' character.
+NET_EXPORT bool DomainIsHostOnly(const std::string& domain_string);
+
+} // namspace cookie_utils
+} // namespace net
+
+#endif // NET_BASE_COOKIE_UTILS_H_
« no previous file with comments | « net/base/cookie_monster_unittest.cc ('k') | net/base/cookie_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698