| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void SecurityPolicy::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceO
rigin, const String& destinationProtocol, const String& destinationDomain, bool
allowDestinationSubdomains) | 113 void SecurityPolicy::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceO
rigin, const String& destinationProtocol, const String& destinationDomain, bool
allowDestinationSubdomains) |
| 114 { | 114 { |
| 115 ASSERT(isMainThread()); | 115 ASSERT(isMainThread()); |
| 116 ASSERT(!sourceOrigin.isUnique()); | 116 ASSERT(!sourceOrigin.isUnique()); |
| 117 if (sourceOrigin.isUnique()) | 117 if (sourceOrigin.isUnique()) |
| 118 return; | 118 return; |
| 119 | 119 |
| 120 String sourceString = sourceOrigin.toString(); | 120 String sourceString = sourceOrigin.toString(); |
| 121 OriginAccessMap::AddResult result = originAccessMap().add(sourceString, null
ptr); | 121 OriginAccessMap::AddResult result = originAccessMap().add(sourceString, null
ptr); |
| 122 if (result.isNewEntry) | 122 if (result.isNewEntry) |
| 123 result.iterator->value = adoptPtr(new OriginAccessWhiteList); | 123 result.storedValue->value = adoptPtr(new OriginAccessWhiteList); |
| 124 | 124 |
| 125 OriginAccessWhiteList* list = result.iterator->value.get(); | 125 OriginAccessWhiteList* list = result.storedValue->value.get(); |
| 126 list->append(OriginAccessEntry(destinationProtocol, destinationDomain, allow
DestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::
DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress)); | 126 list->append(OriginAccessEntry(destinationProtocol, destinationDomain, allow
DestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::
DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress)); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sour
ceOrigin, const String& destinationProtocol, const String& destinationDomain, bo
ol allowDestinationSubdomains) | 129 void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sour
ceOrigin, const String& destinationProtocol, const String& destinationDomain, bo
ol allowDestinationSubdomains) |
| 130 { | 130 { |
| 131 ASSERT(isMainThread()); | 131 ASSERT(isMainThread()); |
| 132 ASSERT(!sourceOrigin.isUnique()); | 132 ASSERT(!sourceOrigin.isUnique()); |
| 133 if (sourceOrigin.isUnique()) | 133 if (sourceOrigin.isUnique()) |
| 134 return; | 134 return; |
| 135 | 135 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 150 map.remove(it); | 150 map.remove(it); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void SecurityPolicy::resetOriginAccessWhitelists() | 153 void SecurityPolicy::resetOriginAccessWhitelists() |
| 154 { | 154 { |
| 155 ASSERT(isMainThread()); | 155 ASSERT(isMainThread()); |
| 156 originAccessMap().clear(); | 156 originAccessMap().clear(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace WebCore | 159 } // namespace WebCore |
| OLD | NEW |