| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 PassOwnPtrWillBeRawPtr<IdTargetObserverRegistry> IdTargetObserverRegistry::creat
e() | 33 PassOwnPtrWillBeRawPtr<IdTargetObserverRegistry> IdTargetObserverRegistry::creat
e() |
| 34 { | 34 { |
| 35 return adoptPtrWillBeNoop(new IdTargetObserverRegistry()); | 35 return adoptPtrWillBeNoop(new IdTargetObserverRegistry()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void IdTargetObserverRegistry::trace(Visitor* visitor) | 38 void IdTargetObserverRegistry::trace(Visitor* visitor) |
| 39 { | 39 { |
| 40 #if ENABLE(OILPAN) | |
| 41 visitor->trace(m_registry); | 40 visitor->trace(m_registry); |
| 42 visitor->trace(m_notifyingObserversInSet); | 41 visitor->trace(m_notifyingObserversInSet); |
| 43 #endif | |
| 44 } | 42 } |
| 45 | 43 |
| 46 void IdTargetObserverRegistry::addObserver(const AtomicString& id, IdTargetObser
ver* observer) | 44 void IdTargetObserverRegistry::addObserver(const AtomicString& id, IdTargetObser
ver* observer) |
| 47 { | 45 { |
| 48 if (id.isEmpty()) | 46 if (id.isEmpty()) |
| 49 return; | 47 return; |
| 50 | 48 |
| 51 IdToObserverSetMap::AddResult result = m_registry.add(id.impl(), nullptr); | 49 IdToObserverSetMap::AddResult result = m_registry.add(id.impl(), nullptr); |
| 52 if (result.isNewEntry) | 50 if (result.isNewEntry) |
| 53 result.storedValue->value = adoptPtrWillBeNoop(new ObserverSet()); | 51 result.storedValue->value = adoptPtrWillBeNoop(new ObserverSet()); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 90 |
| 93 bool IdTargetObserverRegistry::hasObservers(const AtomicString& id) const | 91 bool IdTargetObserverRegistry::hasObservers(const AtomicString& id) const |
| 94 { | 92 { |
| 95 if (id.isEmpty() || m_registry.isEmpty()) | 93 if (id.isEmpty() || m_registry.isEmpty()) |
| 96 return false; | 94 return false; |
| 97 ObserverSet* set = m_registry.get(id.impl()); | 95 ObserverSet* set = m_registry.get(id.impl()); |
| 98 return set && !set->isEmpty(); | 96 return set && !set->isEmpty(); |
| 99 } | 97 } |
| 100 | 98 |
| 101 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |