OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 int port = databaseIdentifier.right(databaseIdentifier.length() - separator2
- 1).toInt(&portOkay); | 262 int port = databaseIdentifier.right(databaseIdentifier.length() - separator2
- 1).toInt(&portOkay); |
263 if (!portOkay && separator2 + 1 == static_cast<int>(databaseIdentifier.lengt
h())) | 263 if (!portOkay && separator2 + 1 == static_cast<int>(databaseIdentifier.lengt
h())) |
264 return create(KURL()); | 264 return create(KURL()); |
265 | 265 |
266 if (port < 0 || port > 65535) | 266 if (port < 0 || port > 65535) |
267 return create(KURL()); | 267 return create(KURL()); |
268 | 268 |
269 // Split out the 3 sections of data | 269 // Split out the 3 sections of data |
270 String protocol = databaseIdentifier.substring(0, separator1); | 270 String protocol = databaseIdentifier.substring(0, separator1); |
271 String host = databaseIdentifier.substring(separator1 + 1, separator2 - sepa
rator1 - 1); | 271 String host = databaseIdentifier.substring(separator1 + 1, separator2 - sepa
rator1 - 1); |
272 return create(KURL(KURL(), protocol + "://" + host + ":" + String::number(po
rt))); | 272 return create(KURL(protocol + "://" + host + ":" + String::number(port))); |
273 } | 273 } |
274 | 274 |
275 String SecurityOrigin::databaseIdentifier() const | 275 String SecurityOrigin::databaseIdentifier() const |
276 { | 276 { |
277 DEFINE_STATIC_LOCAL(String, separatorString, (&SeparatorCharacter, 1)); | 277 DEFINE_STATIC_LOCAL(String, separatorString, (&SeparatorCharacter, 1)); |
278 return m_protocol + separatorString + m_host + separatorString + String::num
ber(m_port); | 278 return m_protocol + separatorString + m_host + separatorString + String::num
ber(m_port); |
279 } | 279 } |
280 | 280 |
281 bool SecurityOrigin::equal(const SecurityOrigin* other) const | 281 bool SecurityOrigin::equal(const SecurityOrigin* other) const |
282 { | 282 { |
(...skipping 18 matching lines...) Expand all Loading... |
301 return false; | 301 return false; |
302 | 302 |
303 if (m_port != other->m_port) | 303 if (m_port != other->m_port) |
304 return false; | 304 return false; |
305 | 305 |
306 return true; | 306 return true; |
307 } | 307 } |
308 | 308 |
309 } // namespace WebCore | 309 } // namespace WebCore |
310 | 310 |
OLD | NEW |