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