[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
pfeldman at chromium.org
pfeldman at chromium.org
Tue Jan 5 23:56:23 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 950f148c86218bc72c286ac6d4d85e29430d971e
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Dec 20 12:41:02 2009 +0000
2009-12-20 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Darin Adler.
Web Inspector: Constrain the number of messages the inspector shows.
https://bugs.webkit.org/show_bug.cgi?id=20919
* English.lproj/localizedStrings.js:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::addConsoleMessage):
(WebCore::InspectorController::clearConsoleMessages):
(WebCore::InspectorController::populateScriptObjects):
* inspector/InspectorController.h:
* inspector/InspectorFrontend.cpp:
(WebCore::InspectorFrontend::updateConsoleMessageExpiredCount):
* inspector/InspectorFrontend.h:
* inspector/front-end/inspector.js:
(WebInspector.updateConsoleMessageExpiredCount):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e04f638..dd71faf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2009-12-20 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Web Inspector: Constrain the number of messages the inspector shows.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20919
+
+ * English.lproj/localizedStrings.js:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::addConsoleMessage):
+ (WebCore::InspectorController::clearConsoleMessages):
+ (WebCore::InspectorController::populateScriptObjects):
+ * inspector/InspectorController.h:
+ * inspector/InspectorFrontend.cpp:
+ (WebCore::InspectorFrontend::updateConsoleMessageExpiredCount):
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/inspector.js:
+ (WebInspector.updateConsoleMessageExpiredCount):
+
2009-12-20 Andrei Popescu <andreip at google.com>
Reviewed by Adam Barth.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index a372b18..dea8b05 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 841bbf4..4449472 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -121,6 +121,8 @@ static const char* const lastActivePanelSettingName = "lastActivePanel";
static const unsigned defaultAttachedHeight = 300;
static const float minimumAttachedHeight = 250.0f;
static const float maximumAttachedHeightRatio = 0.75f;
+static const unsigned maximumConsoleMessages = 1000;
+static const unsigned expireConsoleMessagesStep = 100;
static unsigned s_inspectorControllerCount;
@@ -128,6 +130,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
: m_inspectedPage(page)
, m_client(client)
, m_page(0)
+ , m_expiredConsoleMessageCount(0)
, m_scriptState(0)
, m_windowVisible(false)
, m_showAfterVisible(CurrentPanel)
@@ -355,12 +358,20 @@ void InspectorController::addConsoleMessage(ScriptState* scriptState, ConsoleMes
if (windowVisible())
m_previousMessage->addToConsole(m_frontend.get());
}
+
+ if (!windowVisible() && m_consoleMessages.size() >= maximumConsoleMessages) {
+ m_expiredConsoleMessageCount += expireConsoleMessagesStep;
+ for (size_t i = 0; i < expireConsoleMessagesStep; ++i)
+ delete m_consoleMessages[i];
+ m_consoleMessages.remove(0, expireConsoleMessagesStep);
+ }
}
void InspectorController::clearConsoleMessages(bool clearUI)
{
deleteAllValues(m_consoleMessages);
m_consoleMessages.clear();
+ m_expiredConsoleMessageCount = 0;
m_previousMessage = 0;
m_groupLevel = 0;
releaseWrapperObjectGroup("console");
@@ -652,6 +663,8 @@ void InspectorController::populateScriptObjects()
for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
it->second->updateScriptObject(m_frontend.get());
+ if (m_expiredConsoleMessageCount)
+ m_frontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount);
unsigned messageCount = m_consoleMessages.size();
for (unsigned i = 0; i < messageCount; ++i)
m_consoleMessages[i]->addToConsole(m_frontend.get());
@@ -1041,7 +1054,7 @@ void InspectorController::scriptImported(unsigned long identifier, const String&
// FIXME: imported script and XHR response are currently viewed as the same
// thing by the Inspector. They should be made into distinct types.
resource->setXMLHttpResponseText(ScriptString(sourceString));
-
+
if (windowVisible())
resource->updateScriptObject(m_frontend.get());
}
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 949cb38..cf2415a 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -323,6 +323,7 @@ private:
HashSet<String> m_knownResources;
FrameResourcesMap m_frameResources;
Vector<ConsoleMessage*> m_consoleMessages;
+ unsigned m_expiredConsoleMessageCount;
HashMap<String, double> m_times;
HashMap<String, unsigned> m_counts;
#if ENABLE(DATABASE)
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index 35f6ab2..6a2c629 100644
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -77,6 +77,14 @@ void InspectorFrontend::didCommitLoad()
callSimpleFunction("didCommitLoad");
}
+void InspectorFrontend::updateConsoleMessageExpiredCount(unsigned count)
+{
+ ScriptFunctionCall function(m_scriptState, m_webInspector, "dispatch");
+ function.appendArgument("updateConsoleMessageExpiredCount");
+ function.appendArgument(count);
+ function.call();
+}
+
void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, const Vector<ScriptValue> wrappedArguments, const String& message)
{
ScriptFunctionCall function(m_scriptState, m_webInspector, "dispatch");
@@ -93,7 +101,7 @@ void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj, const
function.call();
}
-void InspectorFrontend::updateConsoleMessageRepeatCount(const int count)
+void InspectorFrontend::updateConsoleMessageRepeatCount(unsigned count)
{
ScriptFunctionCall function(m_scriptState, m_webInspector, "dispatch");
function.appendArgument("updateConsoleMessageRepeatCount");
diff --git a/WebCore/inspector/InspectorFrontend.h b/WebCore/inspector/InspectorFrontend.h
index ace7077..7160f50 100644
--- a/WebCore/inspector/InspectorFrontend.h
+++ b/WebCore/inspector/InspectorFrontend.h
@@ -63,8 +63,10 @@ namespace WebCore {
ScriptObject newScriptObject();
void didCommitLoad();
+
+ void updateConsoleMessageExpiredCount(unsigned count);
void addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, const Vector<ScriptValue> wrappedArguments, const String& message);
- void updateConsoleMessageRepeatCount(const int count);
+ void updateConsoleMessageRepeatCount(unsigned count);
void clearConsoleMessages();
bool updateResource(unsigned long identifier, const ScriptObject& resourceObj);
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 947c7c2..b0f4b48 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1237,6 +1237,12 @@ WebInspector.didCommitLoad = function()
WebInspector.setDocument(null);
}
+WebInspector.updateConsoleMessageExpiredCount = function(count)
+{
+ var message = String.sprintf(WebInspector.UIString("%d console messages are not shown."), count);
+ WebInspector.console.addMessage(new WebInspector.ConsoleTextMessage(message, WebInspector.ConsoleMessage.MessageLevel.Warning));
+}
+
WebInspector.addConsoleMessage = function(payload)
{
var consoleMessage = new WebInspector.ConsoleMessage(
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list