OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // representation of a SecurityOrigin is similar to a URL, except it | 171 // representation of a SecurityOrigin is similar to a URL, except it |
172 // lacks a path component. The string representation does not encode | 172 // lacks a path component. The string representation does not encode |
173 // the value of the SecurityOrigin's domain property. | 173 // the value of the SecurityOrigin's domain property. |
174 // | 174 // |
175 // When using the string value, it's important to remember that it might be | 175 // When using the string value, it's important to remember that it might be |
176 // "null". This happens when this SecurityOrigin is unique. For example, | 176 // "null". This happens when this SecurityOrigin is unique. For example, |
177 // this SecurityOrigin might have come from a sandboxed iframe, the | 177 // this SecurityOrigin might have come from a sandboxed iframe, the |
178 // SecurityOrigin might be empty, or we might have explicitly decided that | 178 // SecurityOrigin might be empty, or we might have explicitly decided that |
179 // we shouldTreatURLSchemeAsNoAccess. | 179 // we shouldTreatURLSchemeAsNoAccess. |
180 String toString() const; | 180 String toString() const; |
| 181 AtomicString toAtomicString() const; |
181 | 182 |
182 // Similar to toString(), but does not take into account any factors that | 183 // Similar to toString(), but does not take into account any factors that |
183 // could make the string return "null". | 184 // could make the string return "null". |
184 String toRawString() const; | 185 String toRawString() const; |
| 186 AtomicString toRawAtomicString() const; |
185 | 187 |
186 // This method checks for equality between SecurityOrigins, not whether | 188 // This method checks for equality between SecurityOrigins, not whether |
187 // one origin can access another. It is used for hash table keys. | 189 // one origin can access another. It is used for hash table keys. |
188 // For access checks, use canAccess(). | 190 // For access checks, use canAccess(). |
189 // FIXME: If this method is really only useful for hash table keys, it | 191 // FIXME: If this method is really only useful for hash table keys, it |
190 // should be refactored into SecurityOriginHash. | 192 // should be refactored into SecurityOriginHash. |
191 bool equal(const SecurityOrigin*) const; | 193 bool equal(const SecurityOrigin*) const; |
192 | 194 |
193 // This method checks for equality, ignoring the value of document.domain | 195 // This method checks for equality, ignoring the value of document.domain |
194 // (and whether it was set) but considering the host. It is used for postMes
sage. | 196 // (and whether it was set) but considering the host. It is used for postMes
sage. |
195 bool isSameSchemeHostPort(const SecurityOrigin*) const; | 197 bool isSameSchemeHostPort(const SecurityOrigin*) const; |
196 | 198 |
197 bool needsDatabaseIdentifierQuirkForFiles() const { return m_needsDatabaseId
entifierQuirkForFiles; } | 199 bool needsDatabaseIdentifierQuirkForFiles() const { return m_needsDatabaseId
entifierQuirkForFiles; } |
198 | 200 |
199 static const String& urlWithUniqueSecurityOrigin(); | 201 static const String& urlWithUniqueSecurityOrigin(); |
200 | 202 |
201 private: | 203 private: |
202 SecurityOrigin(); | 204 SecurityOrigin(); |
203 explicit SecurityOrigin(const KURL&); | 205 explicit SecurityOrigin(const KURL&); |
204 explicit SecurityOrigin(const SecurityOrigin*); | 206 explicit SecurityOrigin(const SecurityOrigin*); |
205 | 207 |
206 // FIXME: Rename this function to something more semantic. | 208 // FIXME: Rename this function to something more semantic. |
207 bool passesFileCheck(const SecurityOrigin*) const; | 209 bool passesFileCheck(const SecurityOrigin*) const; |
| 210 void buildRawString(StringBuilder&) const; |
208 | 211 |
209 String m_protocol; | 212 String m_protocol; |
210 String m_host; | 213 String m_host; |
211 String m_domain; | 214 String m_domain; |
212 String m_filePath; | 215 String m_filePath; |
213 unsigned short m_port; | 216 unsigned short m_port; |
214 bool m_isUnique; | 217 bool m_isUnique; |
215 bool m_universalAccess; | 218 bool m_universalAccess; |
216 bool m_domainWasSetInDOM; | 219 bool m_domainWasSetInDOM; |
217 bool m_canLoadLocalResources; | 220 bool m_canLoadLocalResources; |
218 bool m_enforceFilePathSeparation; | 221 bool m_enforceFilePathSeparation; |
219 bool m_needsDatabaseIdentifierQuirkForFiles; | 222 bool m_needsDatabaseIdentifierQuirkForFiles; |
220 }; | 223 }; |
221 | 224 |
222 } // namespace WebCore | 225 } // namespace WebCore |
223 | 226 |
224 #endif // SecurityOrigin_h | 227 #endif // SecurityOrigin_h |
OLD | NEW |