| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef URL_ORIGIN_H_ | 5 #ifndef URL_ORIGIN_H_ |
| 6 #define URL_ORIGIN_H_ | 6 #define URL_ORIGIN_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 14 #include "base/unguessable_token.h" |
| 14 #include "url/scheme_host_port.h" | 15 #include "url/scheme_host_port.h" |
| 15 #include "url/third_party/mozilla/url_parse.h" | 16 #include "url/third_party/mozilla/url_parse.h" |
| 16 #include "url/url_canon.h" | 17 #include "url/url_canon.h" |
| 17 #include "url/url_constants.h" | 18 #include "url/url_constants.h" |
| 18 #include "url/url_export.h" | 19 #include "url/url_export.h" |
| 19 | 20 |
| 20 class GURL; | 21 class GURL; |
| 21 | 22 |
| 22 namespace url { | 23 namespace url { |
| 23 | 24 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 base::StringPiece host, | 168 base::StringPiece host, |
| 168 uint16_t port, | 169 uint16_t port, |
| 169 base::StringPiece suborigin, | 170 base::StringPiece suborigin, |
| 170 SchemeHostPort::ConstructPolicy policy); | 171 SchemeHostPort::ConstructPolicy policy); |
| 171 Origin(std::string scheme, | 172 Origin(std::string scheme, |
| 172 std::string host, | 173 std::string host, |
| 173 uint16_t port, | 174 uint16_t port, |
| 174 std::string suborigin, | 175 std::string suborigin, |
| 175 SchemeHostPort::ConstructPolicy policy); | 176 SchemeHostPort::ConstructPolicy policy); |
| 176 | 177 |
| 178 bool unique_; |
| 179 |
| 177 SchemeHostPort tuple_; | 180 SchemeHostPort tuple_; |
| 178 bool unique_; | |
| 179 std::string suborigin_; | 181 std::string suborigin_; |
| 182 |
| 183 // This should only be used for equality comparison when both origins are |
| 184 // unique. |
| 185 base::UnguessableToken unique_id_; |
| 180 }; | 186 }; |
| 181 | 187 |
| 182 URL_EXPORT std::ostream& operator<<(std::ostream& out, const Origin& origin); | 188 URL_EXPORT std::ostream& operator<<(std::ostream& out, const Origin& origin); |
| 183 | 189 |
| 184 URL_EXPORT bool IsSameOriginWith(const GURL& a, const GURL& b); | 190 URL_EXPORT bool IsSameOriginWith(const GURL& a, const GURL& b); |
| 185 URL_EXPORT bool IsSamePhysicalOriginWith(const GURL& a, const GURL& b); | 191 URL_EXPORT bool IsSamePhysicalOriginWith(const GURL& a, const GURL& b); |
| 186 | 192 |
| 187 } // namespace url | 193 } // namespace url |
| 188 | 194 |
| 189 #endif // URL_ORIGIN_H_ | 195 #endif // URL_ORIGIN_H_ |
| OLD | NEW |