OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 WTF::PassRefPtr<SecurityOrigin>); | 116 WTF::PassRefPtr<SecurityOrigin>); |
117 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<SecurityOrigin>() const; | 117 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<SecurityOrigin>() const; |
118 BLINK_PLATFORM_EXPORT SecurityOrigin* get() const; | 118 BLINK_PLATFORM_EXPORT SecurityOrigin* get() const; |
119 #else | 119 #else |
120 // TODO(mkwst): A number of properties don't survive a round-trip | 120 // TODO(mkwst): A number of properties don't survive a round-trip |
121 // ('document.domain', for instance). We'll need to fix that for OOPI-enabled | 121 // ('document.domain', for instance). We'll need to fix that for OOPI-enabled |
122 // embedders, https://crbug.com/490074. | 122 // embedders, https://crbug.com/490074. |
123 operator url::Origin() const { | 123 operator url::Origin() const { |
124 return isUnique() ? url::Origin() | 124 return isUnique() ? url::Origin() |
125 : url::Origin::CreateFromNormalizedTupleWithSuborigin( | 125 : url::Origin::CreateFromNormalizedTupleWithSuborigin( |
126 protocol().utf8(), host().utf8(), effectivePort(), | 126 protocol().ascii(), host().ascii(), effectivePort(), |
127 suborigin().utf8()); | 127 suborigin().ascii()); |
128 } | 128 } |
129 | 129 |
130 WebSecurityOrigin(const url::Origin& origin) : m_private(0) { | 130 WebSecurityOrigin(const url::Origin& origin) : m_private(0) { |
131 if (origin.unique()) { | 131 if (origin.unique()) { |
132 assign(WebSecurityOrigin::createUnique()); | 132 assign(WebSecurityOrigin::createUnique()); |
133 return; | 133 return; |
134 } | 134 } |
135 | 135 |
136 // TODO(mkwst): This might open up issues by double-canonicalizing the host. | 136 // TODO(mkwst): This might open up issues by double-canonicalizing the host. |
137 assign(WebSecurityOrigin::createFromTupleWithSuborigin( | 137 assign(WebSecurityOrigin::createFromTupleWithSuborigin( |
(...skipping 12 matching lines...) Expand all Loading... |
150 int port, | 150 int port, |
151 const WebString& suborigin); | 151 const WebString& suborigin); |
152 | 152 |
153 void assign(WebSecurityOriginPrivate*); | 153 void assign(WebSecurityOriginPrivate*); |
154 WebSecurityOriginPrivate* m_private; | 154 WebSecurityOriginPrivate* m_private; |
155 }; | 155 }; |
156 | 156 |
157 } // namespace blink | 157 } // namespace blink |
158 | 158 |
159 #endif | 159 #endif |
OLD | NEW |