A bunch of domains have only a few methods. The hash lookup does not make sense. Turn: void InspectorInspectorBackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message) { Ref<InspectorInspectorBackendDispatcher> protect(*this); typedef void (InspectorInspectorBackendDispatcher::*CallHandler)(long callId, const InspectorObject& message); typedef HashMap<String, CallHandler> DispatchMap; DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, ()); if (dispatchMap.isEmpty()) { static const struct MethodTable { const char* name; CallHandler handler; } commands[] = { { "enable", &InspectorInspectorBackendDispatcher::enable }, { "disable", &InspectorInspectorBackendDispatcher::disable }, }; size_t length = WTF_ARRAY_LENGTH(commands); for (size_t i = 0; i < length; ++i) dispatchMap.add(commands[i].name, commands[i].handler); } HashMap<String, CallHandler>::iterator it = dispatchMap.find(method); if (it == dispatchMap.end()) { m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, String("'") + "Inspector" + '.' + method + "' was not found"); return; } ((*this).*it->value)(callId, *message.get()); } into: void InspectorInspectorBackendDispatcher::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message) { Ref<InspectorInspectorBackendDispatcher> protect(*this); if (method == "enable") enable(callId, *message.get()); else if (method == "disable") disable(callId, *message.get()); else m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, String("'") + "Inspector" + '.' + method + "' was not found"); }
<rdar://problem/15472278>
Created attachment 216967 [details] [PATCH] Proposed Fix
Comment on attachment 216967 [details] [PATCH] Proposed Fix Clearing flags on attachment: 216967 Committed r159308: <http://trac.webkit.org/changeset/159308>
All reviewed patches have been landed. Closing bug.