| 197 | |
| 198 | |
| 199 | void SharedKeys::setPlatformStringForKey(int key, SharedKeys::PlatformString platformKey) const { |
| 200 | LOCK(_mutex); |
| 201 | throwIf(key < 0, InvalidData, "key must be non-negative"); |
| 202 | throwIf((unsigned)key >= _count, InvalidData, "key is not yet known"); |
| 203 | if ((unsigned)key >= _platformStringsByKey.size()) |
| 204 | _platformStringsByKey.resize(key + 1); |
| 205 | #ifdef __APPLE__ |
| 206 | _platformStringsByKey[key] = CFStringCreateCopy(kCFAllocatorDefault, platformKey); |
| 207 | #else |
| 208 | _platformStringsByKey[key] = platformKey; |
| 209 | #endif |
| 210 | } |
| 211 | |
| 212 | |
| 213 | void SharedKeys::revertToCount(size_t toCount) { |