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

Unified Diff: url/serialized_origin.h

Issue 170843007: Introduce url::Origin to represent Web Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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: url/serialized_origin.h
diff --git a/url/serialized_origin.h b/url/serialized_origin.h
new file mode 100644
index 0000000000000000000000000000000000000000..e7a74fd081323856445eda58986457f76cc9e5b0
--- /dev/null
+++ b/url/serialized_origin.h
@@ -0,0 +1,33 @@
+// Copyright 2014 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 URL_SERIALIZED_ORIGIN_H_
+#define URL_SERIALIZED_ORIGIN_H_
+
+#include <iosfwd>
+#include <string>
+
+#include "url/url_export.h"
+
+// SerializedOrigin represents a Web Origin serialized to a string.
+// See RFC6454 for details.
+class URL_EXPORT SerializedOrigin {
+ public:
+ SerializedOrigin();
+ explicit SerializedOrigin(const std::string& origin);
+
+ const std::string& string() const { return string_; }
+
+ bool operator==(const SerializedOrigin& that) const {
brettw 2014/03/10 20:59:04 How about writing a real function named like "bool
yhirano 2014/03/12 02:27:05 Done.
+ return string_ == that.string_;
+ }
+
+ private:
+ std::string string_;
+};
+
+URL_EXPORT std::ostream& operator<<(std::ostream& out,
brettw 2014/03/10 20:59:04 I don't think we should have this. I did the one f
yhirano 2014/03/12 02:27:05 Done.
+ const SerializedOrigin& origin);
+
+#endif // URL_SERIALIZED_ORIGIN_H_

Powered by Google App Engine
This is Rietveld 408576698