| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 void TraceEventDispatcher::innerAddListener(const char* name, char phase, TraceE
ventTargetBase* instance, TraceEventHandlerMethod method, InspectorClient* clien
t) | 101 void TraceEventDispatcher::innerAddListener(const char* name, char phase, TraceE
ventTargetBase* instance, TraceEventHandlerMethod method, InspectorClient* clien
t) |
| 102 { | 102 { |
| 103 ASSERT(isMainThread()); | 103 ASSERT(isMainThread()); |
| 104 MutexLocker locker(m_mutex); | 104 MutexLocker locker(m_mutex); |
| 105 if (m_handlers.isEmpty()) | 105 if (m_handlers.isEmpty()) |
| 106 client->setTraceEventCallback(dispatchEventOnAnyThread); | 106 client->setTraceEventCallback(dispatchEventOnAnyThread); |
| 107 HandlersMap::iterator it = m_handlers.find(std::make_pair(name, phase)); | 107 HandlersMap::iterator it = m_handlers.find(std::make_pair(name, phase)); |
| 108 if (it == m_handlers.end()) | 108 if (it == m_handlers.end()) |
| 109 it = m_handlers.add(std::make_pair(name, phase), Vector<BoundTraceEventH
andler>()).iterator; | 109 m_handlers.add(std::make_pair(name, phase), Vector<BoundTraceEventHandle
r>()).iterator->value.append(BoundTraceEventHandler(instance, method)); |
| 110 it->value.append(BoundTraceEventHandler(instance, method)); | 110 else |
| 111 it->value.append(BoundTraceEventHandler(instance, method)); |
| 111 } | 112 } |
| 112 | 113 |
| 113 void TraceEventDispatcher::removeAllListeners(TraceEventTargetBase* instance, In
spectorClient* client) | 114 void TraceEventDispatcher::removeAllListeners(TraceEventTargetBase* instance, In
spectorClient* client) |
| 114 { | 115 { |
| 115 ASSERT(isMainThread()); | 116 ASSERT(isMainThread()); |
| 116 processBackgroundEvents(); | 117 processBackgroundEvents(); |
| 117 { | 118 { |
| 118 MutexLocker locker(m_mutex); | 119 MutexLocker locker(m_mutex); |
| 119 | 120 |
| 120 HandlersMap remainingHandlers; | 121 HandlersMap remainingHandlers; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 150 size_t index = findParameter(name); | 151 size_t index = findParameter(name); |
| 151 if (index == kNotFound || m_argumentTypes[index] != expectedType) { | 152 if (index == kNotFound || m_argumentTypes[index] != expectedType) { |
| 152 ASSERT_NOT_REACHED(); | 153 ASSERT_NOT_REACHED(); |
| 153 return missingValue; | 154 return missingValue; |
| 154 } | 155 } |
| 155 return *reinterpret_cast<const WebCore::TraceEvent::TraceValueUnion*>(m_argu
mentValues + index); | 156 return *reinterpret_cast<const WebCore::TraceEvent::TraceValueUnion*>(m_argu
mentValues + index); |
| 156 } | 157 } |
| 157 | 158 |
| 158 } // namespace WebCore | 159 } // namespace WebCore |
| 159 | 160 |
| OLD | NEW |