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

Unified Diff: extensions/common/url_pattern.cc

Issue 300573002: Add stream operators for URLPattern and URLPatternSet and unit test for URLPatternSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src@permissions
Patch Set: Review comments Created 6 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
Index: extensions/common/url_pattern.cc
diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc
index 020be3c40dfb4b64cab952257bc90cfddcc9271e..81176d2c69ceea96b35e9c0096cc31427f397f66 100644
--- a/extensions/common/url_pattern.cc
+++ b/extensions/common/url_pattern.cc
@@ -4,6 +4,8 @@
#include "extensions/common/url_pattern.h"
+#include <ostream>
+
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
@@ -148,6 +150,10 @@ bool URLPattern::operator==(const URLPattern& other) const {
return GetAsString() == other.GetAsString();
}
+std::ostream& operator<<(std::ostream& out, const URLPattern& url_pattern) {
+ return out << '"' << url_pattern.GetAsString() << '"';
+}
+
URLPattern::ParseResult URLPattern::Parse(const std::string& pattern) {
spec_.clear();
SetMatchAllURLs(false);

Powered by Google App Engine
This is Rietveld 408576698