| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return; | 130 return; |
| 131 | 131 |
| 132 String sourceString = sourceOrigin.toString(); | 132 String sourceString = sourceOrigin.toString(); |
| 133 OriginAccessMap& map = originAccessMap(); | 133 OriginAccessMap& map = originAccessMap(); |
| 134 OriginAccessMap::iterator it = map.find(sourceString); | 134 OriginAccessMap::iterator it = map.find(sourceString); |
| 135 if (it == map.end()) | 135 if (it == map.end()) |
| 136 return; | 136 return; |
| 137 | 137 |
| 138 OriginAccessWhiteList* list = it->value.get(); | 138 OriginAccessWhiteList* list = it->value.get(); |
| 139 size_t index = list->find(OriginAccessEntry(destinationProtocol, destination
Domain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : Origin
AccessEntry::DisallowSubdomains)); | 139 size_t index = list->find(OriginAccessEntry(destinationProtocol, destination
Domain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : Origin
AccessEntry::DisallowSubdomains)); |
| 140 if (index == notFound) | 140 if (index == kNotFound) |
| 141 return; | 141 return; |
| 142 | 142 |
| 143 list->remove(index); | 143 list->remove(index); |
| 144 | 144 |
| 145 if (list->isEmpty()) | 145 if (list->isEmpty()) |
| 146 map.remove(it); | 146 map.remove(it); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void SecurityPolicy::resetOriginAccessWhitelists() | 149 void SecurityPolicy::resetOriginAccessWhitelists() |
| 150 { | 150 { |
| 151 ASSERT(isMainThread()); | 151 ASSERT(isMainThread()); |
| 152 originAccessMap().clear(); | 152 originAccessMap().clear(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace WebCore | 155 } // namespace WebCore |
| OLD | NEW |