Chromium Code Reviews| 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_ |