+ RefPtrWillBeRawPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(1));
+ const ScriptCallFrame& lastCaller = callStack->at(0);
+ // Follow Firebug's behavior of counting with null and undefined title in
+ // the same bucket as no argument
+ String title;
+ arguments->getFirstArgumentAsString(title);
+ String identifier = title.isEmpty() ? String(lastCaller.sourceURL() + ':' + String::number(lastCaller.lineNumber()))
+ : String(title + '@');
+
+ HashCountedSet<String>::AddResult result = m_counts.add(identifier);
+ String message = title + ": " + String::number(result.storedValue->value);
+
+ RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(ConsoleAPIMessageSource, DebugMessageLevel, message);
+ consoleMessage->setType(CountMessageType);
+ consoleMessage->setScriptState(scriptState);
+ consoleMessage->setCallStack(callStack.release());
+ reportMessageToConsole(consoleMessage.release());