summaryrefslogtreecommitdiffstats
path: root/WebCore/page/Console.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-07-22 15:37:06 +0100
committerBen Murdoch <benm@google.com>2010-07-27 10:20:25 +0100
commit967717af5423377c967781471ee106e2bb4e11c8 (patch)
tree1e701dc0a12f7f07cce1df4a7681717de77a211b /WebCore/page/Console.cpp
parentdcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff)
downloadexternal_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip
external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz
external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'WebCore/page/Console.cpp')
-rw-r--r--WebCore/page/Console.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp
index 1d6c095..3d8a7de 100644
--- a/WebCore/page/Console.cpp
+++ b/WebCore/page/Console.cpp
@@ -36,6 +36,7 @@
#include "FrameLoader.h"
#include "FrameTree.h"
#include "InspectorController.h"
+#include "MemoryInfo.h"
#include "Page.h"
#include "PageGroup.h"
#include "PlatformString.h"
@@ -61,6 +62,8 @@ Frame* Console::frame() const
void Console::disconnectFrame()
{
+ if (m_memory)
+ m_memory = 0;
m_frame = 0;
}
@@ -141,7 +144,7 @@ static void printMessageSourceAndLevelPrefix(MessageSource source, MessageLevel
printf("%s %s:", sourceString, levelString);
}
-void Console::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
+void Console::addMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL, ScriptCallStack* callStack)
{
Page* page = this->page();
if (!page)
@@ -151,7 +154,10 @@ void Console::addMessage(MessageSource source, MessageType type, MessageLevel le
page->chrome()->client()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
#if ENABLE(INSPECTOR)
- page->inspectorController()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
+ if (callStack)
+ page->inspectorController()->addMessageToConsole(source, type, level, callStack, message);
+ else
+ page->inspectorController()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
#endif
if (!Console::shouldPrintExceptions())
@@ -294,15 +300,15 @@ String Console::lastWMLErrorMessage() const
if (!page)
return String();
- const Vector<ConsoleMessage*>& consoleMessages = page->inspectorController()->consoleMessages();
+ const Vector<OwnPtr<ConsoleMessage> >& consoleMessages = page->inspectorController()->consoleMessages();
if (consoleMessages.isEmpty())
return String();
- Vector<ConsoleMessage*>::const_iterator it = consoleMessages.begin();
- const Vector<ConsoleMessage*>::const_iterator end = consoleMessages.end();
+ Vector<OwnPtr<ConsoleMessage> >::const_iterator it = consoleMessages.begin();
+ const Vector<OwnPtr<ConsoleMessage> >::const_iterator end = consoleMessages.end();
for (; it != end; ++it) {
- ConsoleMessage* message = *it;
+ ConsoleMessage* message = it->get();
if (message->source() != WMLMessageSource)
continue;
@@ -456,6 +462,12 @@ void Console::warn(ScriptCallStack* callStack)
addMessage(LogMessageType, WarningMessageLevel, callStack);
}
+MemoryInfo* Console::memory() const
+{
+ m_memory = MemoryInfo::create(m_frame);
+ return m_memory.get();
+}
+
static bool printExceptions = false;
bool Console::shouldPrintExceptions()