| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 String dumpRefCountedInstanceCounts() | 89 String dumpRefCountedInstanceCounts() |
| 90 { | 90 { |
| 91 return InstanceCounter::instance()->dump(); | 91 return InstanceCounter::instance()->dump(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void InstanceCounter::incrementInstanceCount(const String& instanceName, void* p
tr) | 94 void InstanceCounter::incrementInstanceCount(const String& instanceName, void* p
tr) |
| 95 { | 95 { |
| 96 MutexLocker locker(m_mutex); | 96 MutexLocker locker(m_mutex); |
| 97 HashMap<String, int>::AddResult result = m_counterMap.add(instanceName, 1); | 97 HashMap<String, int>::AddResult result = m_counterMap.add(instanceName, 1); |
| 98 if (!result.isNewEntry) | 98 if (!result.isNewEntry) |
| 99 ++(result.iterator->value); | 99 ++(result.storedValue->value); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void InstanceCounter::decrementInstanceCount(const String& instanceName, void* p
tr) | 102 void InstanceCounter::decrementInstanceCount(const String& instanceName, void* p
tr) |
| 103 { | 103 { |
| 104 MutexLocker locker(m_mutex); | 104 MutexLocker locker(m_mutex); |
| 105 HashMap<String, int>::iterator it = m_counterMap.find(instanceName); | 105 HashMap<String, int>::iterator it = m_counterMap.find(instanceName); |
| 106 ASSERT(it != m_counterMap.end()); | 106 ASSERT(it != m_counterMap.end()); |
| 107 | 107 |
| 108 --(it->value); | 108 --(it->value); |
| 109 if (!it->value) | 109 if (!it->value) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 135 #else | 135 #else |
| 136 | 136 |
| 137 String dumpRefCountedInstanceCounts() | 137 String dumpRefCountedInstanceCounts() |
| 138 { | 138 { |
| 139 return String("{}"); | 139 return String("{}"); |
| 140 } | 140 } |
| 141 | 141 |
| 142 #endif // ENABLE_INSTANCE_COUNTER | 142 #endif // ENABLE_INSTANCE_COUNTER |
| 143 | 143 |
| 144 } // namespace WTF | 144 } // namespace WTF |
| OLD | NEW |