| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Google Inc. All rights reserved. | 2 * Copyright (C) 2007 Google Inc. All rights reserved. |
| 3 * Authors: Collin Jackson, Adam Barth | 3 * Authors: Collin Jackson, Adam Barth |
| 4 * | 4 * |
| 5 * This is the V8 version of the KJS InspectorController, which is located in | 5 * This is the V8 version of the KJS InspectorController, which is located in |
| 6 * webkit/pending. | 6 * webkit/pending. |
| 7 * Copyright (C) 2007 Apple Inc. All rights reserved. | 7 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
| 10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 // oldest messages so that the most recent errors are preserved. | 838 // oldest messages so that the most recent errors are preserved. |
| 839 // TODO(erikkay): this is not very efficient since Vector has to do a copy | 839 // TODO(erikkay): this is not very efficient since Vector has to do a copy |
| 840 // when you remove from anywhere other than the end. Unfortunately, WTF | 840 // when you remove from anywhere other than the end. Unfortunately, WTF |
| 841 // doesn't appear to have a double-ended list we could use instead. The | 841 // doesn't appear to have a double-ended list we could use instead. The |
| 842 // extra CPU cost is definitely better than the memory cost. | 842 // extra CPU cost is definitely better than the memory cost. |
| 843 if (m_consoleMessages.size() >= MAX_CONSOLE_MESSAGES) { | 843 if (m_consoleMessages.size() >= MAX_CONSOLE_MESSAGES) { |
| 844 ConsoleMessage* msg = m_consoleMessages[0]; | 844 ConsoleMessage* msg = m_consoleMessages[0]; |
| 845 m_consoleMessages.remove(0); | 845 m_consoleMessages.remove(0); |
| 846 delete msg; | 846 delete msg; |
| 847 } | 847 } |
| 848 if (m_previousMessage && *m_previousMessage == *consoleMessage) { | 848 m_previousMessage = consoleMessage; |
| 849 ++m_previousMessage->repeatCount; | 849 m_consoleMessages.append(consoleMessage); |
| 850 } else { | |
| 851 m_previousMessage = consoleMessage; | |
| 852 m_consoleMessages.append(consoleMessage); | |
| 853 } | |
| 854 if (windowVisible()) | 850 if (windowVisible()) |
| 855 addScriptConsoleMessage(m_previousMessage); | 851 addScriptConsoleMessage(m_previousMessage); |
| 856 } | 852 } |
| 857 | 853 |
| 858 void InspectorController::clearConsoleMessages() | 854 void InspectorController::clearConsoleMessages() |
| 859 { | 855 { |
| 860 deleteAllValues(m_consoleMessages); | 856 deleteAllValues(m_consoleMessages); |
| 861 m_consoleMessages.clear(); | 857 m_consoleMessages.clear(); |
| 862 m_previousMessage = 0; | 858 m_previousMessage = 0; |
| 863 } | 859 } |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 } | 1815 } |
| 1820 | 1816 |
| 1821 bool InspectorController::stopTiming(const String& title, double& elapsed) | 1817 bool InspectorController::stopTiming(const String& title, double& elapsed) |
| 1822 { | 1818 { |
| 1823 elapsed = 0; | 1819 elapsed = 0; |
| 1824 notImplemented(); | 1820 notImplemented(); |
| 1825 return false; | 1821 return false; |
| 1826 } | 1822 } |
| 1827 | 1823 |
| 1828 } // namespace WebCore | 1824 } // namespace WebCore |
| OLD | NEW |