| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 #if DCHECK_IS_ON() | 139 #if DCHECK_IS_ON() |
| 140 DCHECK_EQ(m_creationThreadId, currentThread()); | 140 DCHECK_EQ(m_creationThreadId, currentThread()); |
| 141 #endif | 141 #endif |
| 142 this->m_supplements.set(key, supplement); | 142 this->m_supplements.set(key, supplement); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void removeSupplement(const char* key) { | 145 void removeSupplement(const char* key) { |
| 146 #if DCHECK_IS_ON() | 146 #if DCHECK_IS_ON() |
| 147 DCHECK_EQ(m_creationThreadId, currentThread()); | 147 DCHECK_EQ(m_creationThreadId, currentThread()); |
| 148 #endif | 148 #endif |
| 149 this->m_supplements.remove(key); | 149 this->m_supplements.erase(key); |
| 150 } | 150 } |
| 151 | 151 |
| 152 Supplement<T>* requireSupplement(const char* key) { | 152 Supplement<T>* requireSupplement(const char* key) { |
| 153 #if DCHECK_IS_ON() | 153 #if DCHECK_IS_ON() |
| 154 DCHECK_EQ(m_attachedThreadId, currentThread()); | 154 DCHECK_EQ(m_attachedThreadId, currentThread()); |
| 155 #endif | 155 #endif |
| 156 return this->m_supplements.get(key); | 156 return this->m_supplements.get(key); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void reattachThread() { | 159 void reattachThread() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 template <typename T> | 192 template <typename T> |
| 193 struct ThreadingTrait<Supplementable<T>> { | 193 struct ThreadingTrait<Supplementable<T>> { |
| 194 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; | 194 static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 } // namespace blink | 197 } // namespace blink |
| 198 | 198 |
| 199 #endif // Supplementable_h | 199 #endif // Supplementable_h |
| OLD | NEW |