summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorsgjesse@chromium.org <sgjesse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-28 10:18:09 +0000
committersgjesse@chromium.org <sgjesse@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-28 10:18:09 +0000
commitbf3c52c9dce8f232f1b7039eeca89fec4fba403d (patch)
tree5a8623fffc7b6f80ba1067951f4fa50db595550a /webkit
parent2f96c5ff7a04db608626d93bb38ac0e8a87cc3d8 (diff)
downloadchromium_src-bf3c52c9dce8f232f1b7039eeca89fec4fba403d.zip
chromium_src-bf3c52c9dce8f232f1b7039eeca89fec4fba403d.tar.gz
chromium_src-bf3c52c9dce8f232f1b7039eeca89fec4fba403d.tar.bz2
Get back the messages in the inspector console.
The unforking of the inspector JS files caused the message text not showing in the inspector console due to changes in the API between the inspector controller and the inspector. Manually added the missing changes from WebKit changeset 36817 (http://trac.webkit.org/changeset/36817) to InspectorController.cpp and fixed the parameters to the WebInspector.ConsoleMessage constructor. Review URL: http://codereview.chromium.org/10997 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6110 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/port/page/inspector/InspectorController.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/webkit/port/page/inspector/InspectorController.cpp b/webkit/port/page/inspector/InspectorController.cpp
index 8c8db35..68ce6e1 100644
--- a/webkit/port/page/inspector/InspectorController.cpp
+++ b/webkit/port/page/inspector/InspectorController.cpp
@@ -131,6 +131,7 @@ struct ConsoleMessage {
, line(li)
, url(u)
, groupLevel(g)
+ , repeatCount(1)
{
}
@@ -143,6 +144,7 @@ struct ConsoleMessage {
, line(context->lineNumber())
, url(context->sourceURL())
, groupLevel(g)
+ , repeatCount(1)
{
#if USE(JSC)
JSLock lock(false);
@@ -160,6 +162,21 @@ struct ConsoleMessage {
#endif
}
+ bool operator==(ConsoleMessage msg) const
+ {
+ return msg.source == this->source
+ && msg.level == this->level
+ && msg.message == this->message
+#if USE(JSC)
+ && msg.wrappedArguments == this->wrappedArguments
+#elif USE(V8)
+ && msg.message == this->message
+#endif
+ && msg.line == this->line
+ && msg.url == this->url
+ && msg.groupLevel == this->groupLevel;
+ }
+
MessageSource source;
MessageLevel level;
String message;
@@ -169,6 +186,7 @@ struct ConsoleMessage {
unsigned line;
String url;
unsigned groupLevel;
+ unsigned repeatCount;
};
struct XMLHttpRequestResource {
@@ -826,16 +844,21 @@ void InspectorController::addConsoleMessage(ScriptCallContext* context, ConsoleM
m_consoleMessages.remove(0);
delete msg;
}
- m_consoleMessages.append(consoleMessage);
-
+ if (m_previousMessage && *m_previousMessage == *consoleMessage) {
+ ++m_previousMessage->repeatCount;
+ } else {
+ m_previousMessage = consoleMessage;
+ m_consoleMessages.append(consoleMessage);
+ }
if (windowVisible())
- addScriptConsoleMessage(consoleMessage);
+ addScriptConsoleMessage(m_previousMessage);
}
void InspectorController::clearConsoleMessages()
{
deleteAllValues(m_consoleMessages);
m_consoleMessages.clear();
+ m_previousMessage = 0;
}
void InspectorController::startGroup(MessageSource source, ScriptCallContext* context)
@@ -1328,12 +1351,13 @@ void InspectorController::addScriptConsoleMessage(const ConsoleMessage* message)
v8::Number::New(message->level),
v8::Number::New(message->line),
v8StringOrNull(message->url),
- v8StringOrNull(message->message),
v8::Number::New(message->groupLevel),
+ v8::Number::New(message->repeatCount),
+ v8StringOrNull(message->message),
};
v8::Handle<v8::Object> consoleMessage =
- SafeAllocation::NewInstance(consoleMessageConstructor, 5, args);
+ SafeAllocation::NewInstance(consoleMessageConstructor, 7, args);
if (consoleMessage.IsEmpty())
return;