OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. 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 | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 template<class KeyType, class InfoType> | 43 template<class KeyType, class InfoType> |
44 class MappedInfo { | 44 class MappedInfo { |
45 public: | 45 public: |
46 static InfoType* ensureInfo(const KeyType* key) | 46 static InfoType* ensureInfo(const KeyType* key) |
47 { | 47 { |
48 InfoMap& infoMap = MappedInfo<KeyType, InfoType>::infoMap(); | 48 InfoMap& infoMap = MappedInfo<KeyType, InfoType>::infoMap(); |
49 if (InfoType* info = infoMap.get(key)) | 49 if (InfoType* info = infoMap.get(key)) |
50 return info; | 50 return info; |
51 typename InfoMap::AddResult result = infoMap.add(key, InfoType::createIn
fo(key)); | 51 typename InfoMap::AddResult result = infoMap.add(key, InfoType::createIn
fo(key)); |
52 return result.iterator->value.get(); | 52 return result.storedValue->value.get(); |
53 } | 53 } |
54 static void removeInfo(const KeyType* key) { infoMap().remove(key); } | 54 static void removeInfo(const KeyType* key) { infoMap().remove(key); } |
55 static InfoType* info(const KeyType* key) { return infoMap().get(key); } | 55 static InfoType* info(const KeyType* key) { return infoMap().get(key); } |
56 private: | 56 private: |
57 typedef HashMap<const KeyType*, OwnPtr<InfoType> > InfoMap; | 57 typedef HashMap<const KeyType*, OwnPtr<InfoType> > InfoMap; |
58 static InfoMap& infoMap() | 58 static InfoMap& infoMap() |
59 { | 59 { |
60 DEFINE_STATIC_LOCAL(InfoMap, staticInfoMap, ()); | 60 DEFINE_STATIC_LOCAL(InfoMap, staticInfoMap, ()); |
61 return staticInfoMap; | 61 return staticInfoMap; |
62 } | 62 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 private: | 172 private: |
173 mutable OwnPtr<Shape> m_shape; | 173 mutable OwnPtr<Shape> m_shape; |
174 LayoutSize m_shapeLogicalSize; | 174 LayoutSize m_shapeLogicalSize; |
175 }; | 175 }; |
176 | 176 |
177 bool checkShapeImageOrigin(Document&, ImageResource&); | 177 bool checkShapeImageOrigin(Document&, ImageResource&); |
178 | 178 |
179 } | 179 } |
180 #endif | 180 #endif |
OLD | NEW |