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

Unified Diff: net/base/url_util.h

Issue 24261010: Allow explicitly whitelisted apps/extensions in public sessions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix handing of guest user ID. Created 7 years, 2 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 | « content/public/test/test_utils.cc ('k') | net/base/url_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/url_util.h
diff --git a/net/base/url_util.h b/net/base/url_util.h
index 5d5e58bc617950158014ad22f0f62f5d24d5dfcc..83d03562f86abf57a3db81b4ca408cb2f0956945 100644
--- a/net/base/url_util.h
+++ b/net/base/url_util.h
@@ -7,7 +7,9 @@
#include <string>
+#include "base/compiler_specific.h"
#include "net/base/net_export.h"
+#include "url/url_parse.h"
class GURL;
@@ -44,6 +46,30 @@ NET_EXPORT GURL AppendOrReplaceQueryParameter(const GURL& url,
const std::string& name,
const std::string& value);
+// Iterates over the key-value pairs in the query portion of |url|.
+class NET_EXPORT QueryIterator {
+ public:
+ explicit QueryIterator(const GURL& url);
+ ~QueryIterator();
+
+ std::string GetKey() const;
+ std::string GetValue() const;
+ const std::string& GetUnescapedValue();
+
+ bool IsAtEnd() const;
+ void Advance();
+
+ private:
+ const GURL& url_;
+ url_parse::Component query_;
+ bool at_end_;
+ url_parse::Component key_;
+ url_parse::Component value_;
+ std::string unescaped_value_;
+
+ DISALLOW_COPY_AND_ASSIGN(QueryIterator);
+};
+
// Looks for |search_key| in the query portion of |url|. Returns true if the
// key is found and sets |out_value| to the unescaped value for the key.
// Returns false if the key is not found.
« no previous file with comments | « content/public/test/test_utils.cc ('k') | net/base/url_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698