OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebSerializedOrigin_h | 5 #ifndef WebSerializedOrigin_h |
6 #define WebSerializedOrigin_h | 6 #define WebSerializedOrigin_h |
7 | 7 |
8 #include "WebString.h" | 8 #include "WebString.h" |
9 | 9 |
10 #if !INSIDE_BLINK | 10 #if !INSIDE_BLINK |
11 #include <url/origin.h> | 11 #include <url/origin.h> |
12 #endif | 12 #endif |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class SecurityOrigin; | 16 class SecurityOrigin; |
| 17 class WebSecurityOrigin; |
17 | 18 |
18 // WebSerializedOrigin represents a serialized Web Origin specified in RFC6454. | 19 // WebSerializedOrigin represents a serialized Web Origin specified in RFC6454. |
19 class WebSerializedOrigin { | 20 class WebSerializedOrigin { |
20 public: | 21 public: |
21 WebSerializedOrigin() : m_string("null") { } | 22 WebSerializedOrigin() : m_string("null") { } |
| 23 BLINK_PLATFORM_EXPORT WebSerializedOrigin(const WebSecurityOrigin&); |
| 24 |
22 #if INSIDE_BLINK | 25 #if INSIDE_BLINK |
23 BLINK_PLATFORM_EXPORT WebSerializedOrigin(const SecurityOrigin&); | 26 BLINK_PLATFORM_EXPORT WebSerializedOrigin(const SecurityOrigin&); |
24 #else | 27 #else |
25 WebSerializedOrigin(const url::Origin& origin) : m_string(WebString::fromUTF
8(origin.string())) { } | 28 WebSerializedOrigin(const url::Origin& origin) : m_string(WebString::fromUTF
8(origin.string())) { } |
26 operator url::Origin() const { return url::Origin(m_string.utf8()); } | 29 operator url::Origin() const { return url::Origin(m_string.utf8()); } |
27 #endif | 30 #endif |
28 | 31 |
29 const WebString& string() const | 32 const WebString& string() const |
30 { | 33 { |
31 return m_string; | 34 return m_string; |
32 } | 35 } |
33 | 36 |
34 private: | 37 private: |
35 const WebString m_string; | 38 const WebString m_string; |
36 }; | 39 }; |
37 | 40 |
38 } // namespace blink | 41 } // namespace blink |
39 | 42 |
40 #endif // #ifndef SerializedOrigin_h | 43 #endif // #ifndef SerializedOrigin_h |
OLD | NEW |