| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 const ScriptCallFrame& lastCaller = callStack->at(0); | 180 const ScriptCallFrame& lastCaller = callStack->at(0); |
| 181 addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, messag
e, lastCaller.lineNumber(), lastCaller.sourceURL()); | 181 addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, messag
e, lastCaller.lineNumber(), lastCaller.sourceURL()); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void InspectorConsoleAgent::count(PassRefPtr<ScriptArguments> arguments, PassRef
Ptr<ScriptCallStack> callStack) | 184 void InspectorConsoleAgent::count(PassRefPtr<ScriptArguments> arguments, PassRef
Ptr<ScriptCallStack> callStack) |
| 185 { | 185 { |
| 186 const ScriptCallFrame& lastCaller = callStack->at(0); | 186 const ScriptCallFrame& lastCaller = callStack->at(0); |
| 187 // Follow Firebug's behavior of counting with null and undefined title in | 187 // Follow Firebug's behavior of counting with null and undefined title in |
| 188 // the same bucket as no argument | 188 // the same bucket as no argument |
| 189 String title; | 189 String title; |
| 190 arguments->getFirstArgumentAsString(title); | 190 arguments->argumentToString(0, title); |
| 191 String identifier = title + '@' + lastCaller.sourceURL() + ':' + String::num
ber(lastCaller.lineNumber()); | 191 String identifier = title + '@' + lastCaller.sourceURL() + ':' + String::num
ber(lastCaller.lineNumber()); |
| 192 | 192 |
| 193 HashMap<String, unsigned>::iterator it = m_counts.find(identifier); | 193 HashMap<String, unsigned>::iterator it = m_counts.find(identifier); |
| 194 int count; | 194 int count; |
| 195 if (it == m_counts.end()) | 195 if (it == m_counts.end()) |
| 196 count = 1; | 196 count = 1; |
| 197 else { | 197 else { |
| 198 count = it->second + 1; | 198 count = it->second + 1; |
| 199 m_counts.remove(it); | 199 m_counts.remove(it); |
| 200 } | 200 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 if (!m_frontend && m_consoleMessages.size() >= maximumConsoleMessages) { | 290 if (!m_frontend && m_consoleMessages.size() >= maximumConsoleMessages) { |
| 291 m_expiredConsoleMessageCount += expireConsoleMessagesStep; | 291 m_expiredConsoleMessageCount += expireConsoleMessagesStep; |
| 292 m_consoleMessages.remove(0, expireConsoleMessagesStep); | 292 m_consoleMessages.remove(0, expireConsoleMessagesStep); |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace WebCore | 296 } // namespace WebCore |
| 297 | 297 |
| 298 #endif // ENABLE(INSPECTOR) | 298 #endif // ENABLE(INSPECTOR) |
| OLD | NEW |