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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 return false; | 298 return false; |
299 | 299 |
300 return true; | 300 return true; |
301 } | 301 } |
302 | 302 |
303 bool SecurityOrigin::canReceiveDragData(const SecurityOrigin* dragInitiator) con
st | 303 bool SecurityOrigin::canReceiveDragData(const SecurityOrigin* dragInitiator) con
st |
304 { | 304 { |
305 if (this == dragInitiator) | 305 if (this == dragInitiator) |
306 return true; | 306 return true; |
307 | 307 |
308 // FIXME: Currently we treat data URLs as having a unique origin, contrary t
o the | |
309 // current (9/19/2009) draft of the HTML5 specification. We still want to al
low | |
310 // drop across data URLs, so we special case data URLs below. If we change t
o | |
311 // match HTML5 w.r.t. data URL security, then we can remove this check. | |
312 if (m_protocol == "data") | |
313 return true; | |
314 | |
315 return canAccess(dragInitiator); | 308 return canAccess(dragInitiator); |
316 } | 309 } |
317 | 310 |
318 bool SecurityOrigin::isAccessWhiteListed(const SecurityOrigin* targetOrigin) con
st | 311 bool SecurityOrigin::isAccessWhiteListed(const SecurityOrigin* targetOrigin) con
st |
319 { | 312 { |
320 if (OriginAccessWhiteList* list = originAccessMap().get(toString())) { | 313 if (OriginAccessWhiteList* list = originAccessMap().get(toString())) { |
321 for (size_t i = 0; i < list->size(); ++i) { | 314 for (size_t i = 0; i < list->size(); ++i) { |
322 if (list->at(i).matchesOrigin(*targetOrigin)) | 315 if (list->at(i).matchesOrigin(*targetOrigin)) |
323 return true; | 316 return true; |
324 } | 317 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 | 596 |
604 void SecurityOrigin::resetOriginAccessWhitelists() | 597 void SecurityOrigin::resetOriginAccessWhitelists() |
605 { | 598 { |
606 ASSERT(isMainThread()); | 599 ASSERT(isMainThread()); |
607 OriginAccessMap& map = originAccessMap(); | 600 OriginAccessMap& map = originAccessMap(); |
608 deleteAllValues(map); | 601 deleteAllValues(map); |
609 map.clear(); | 602 map.clear(); |
610 } | 603 } |
611 | 604 |
612 } // namespace WebCore | 605 } // namespace WebCore |
OLD | NEW |