[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
eric at webkit.org
eric at webkit.org
Thu Dec 3 13:26:35 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit d7ce59756514f97fdb4b2b101bfe24df98b60d5b
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 4 08:33:46 2009 +0000
2009-11-04 Jaime Yap <jaimeyap at google.com>
Reviewed by Timothy Hatcher.
This patch adds API to the console object for annotating the
inspector timeline. This allows developers to mark logical
checkpoints in their apps and have them overlaid in the event
record tree.
tests updated: LayoutTests/fast/dom/Window/window-properties.html
https://bugs.webkit.org/show_bug.cgi?id=31082
* inspector/InspectorController.cpp:
(WebCore::InspectorController::markTimeline):
* inspector/InspectorController.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didMarkTimeline):
* inspector/InspectorTimelineAgent.h:
(WebCore::):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createMarkTimelineRecord):
* inspector/TimelineRecordFactory.h:
* inspector/front-end/TimelineAgent.js:
* page/Console.cpp:
(WebCore::Console::markTimeline):
* page/Console.h:
* page/Console.idl:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50501 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/dom/Window/window-properties-expected.txt b/LayoutTests/fast/dom/Window/window-properties-expected.txt
index 6d4222a..c6963c9 100644
--- a/LayoutTests/fast/dom/Window/window-properties-expected.txt
+++ b/LayoutTests/fast/dom/Window/window-properties-expected.txt
@@ -1707,6 +1707,7 @@ window.console.group [function]
window.console.groupEnd [function]
window.console.info [function]
window.console.log [function]
+window.console.markTimeline [function]
window.console.profile [function]
window.console.profileEnd [function]
window.console.profiles [object Array]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d5e2e8c..c4b0906 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2009-11-04 Jaime Yap <jaimeyap at google.com>
+
+ Reviewed by Timothy Hatcher.
+
+ This patch adds API to the console object for annotating the
+ inspector timeline. This allows developers to mark logical
+ checkpoints in their apps and have them overlaid in the event
+ record tree.
+
+ tests updated: LayoutTests/fast/dom/Window/window-properties.html
+ https://bugs.webkit.org/show_bug.cgi?id=31082
+
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::markTimeline):
+ * inspector/InspectorController.h:
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::didMarkTimeline):
+ * inspector/InspectorTimelineAgent.h:
+ (WebCore::):
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createMarkTimelineRecord):
+ * inspector/TimelineRecordFactory.h:
+ * inspector/front-end/TimelineAgent.js:
+ * page/Console.cpp:
+ (WebCore::Console::markTimeline):
+ * page/Console.h:
+ * page/Console.idl:
+
2009-11-03 Simon Hausmann <hausmann at webkit.org>
Unreviewed build fix for WebInspector with Qt build.
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index c2c3e4c..e442960 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -417,6 +417,12 @@ void InspectorController::endGroup(MessageSource source, unsigned lineNumber, co
addConsoleMessage(0, new ConsoleMessage(source, EndGroupMessageType, LogMessageLevel, String(), lineNumber, sourceURL, m_groupLevel));
}
+void InspectorController::markTimeline(const String& message)
+{
+ if (timelineAgent())
+ timelineAgent()->didMarkTimeline(message);
+}
+
static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight)
{
return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio)));
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 822fbf2..c6212ef 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -261,6 +261,8 @@ public:
void startGroup(MessageSource source, ScriptCallStack* callFrame);
void endGroup(MessageSource source, unsigned lineNumber, const String& sourceURL);
+ void markTimeline(const String& message);
+
#if ENABLE(JAVASCRIPT_DEBUGGER)
void addProfile(PassRefPtr<JSC::Profile>, unsigned lineNumber, const JSC::UString& sourceURL);
void addProfileFinishedMessageToConsole(PassRefPtr<JSC::Profile>, unsigned lineNumber, const JSC::UString& sourceURL);
diff --git a/WebCore/inspector/InspectorTimelineAgent.cpp b/WebCore/inspector/InspectorTimelineAgent.cpp
index 447d646..84222c8 100644
--- a/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -156,6 +156,11 @@ void InspectorTimelineAgent::didEvaluateScript()
didCompleteCurrentRecord(EvaluateScriptTimelineRecordType);
}
+void InspectorTimelineAgent::didMarkTimeline(const String& message)
+{
+ addRecordToTimeline(TimelineRecordFactory::createMarkTimelineRecord(m_frontend, currentTimeInMilliseconds(), message), MarkTimelineRecordType);
+}
+
void InspectorTimelineAgent::reset()
{
m_recordStack.clear();
diff --git a/WebCore/inspector/InspectorTimelineAgent.h b/WebCore/inspector/InspectorTimelineAgent.h
index 5cfa9af..e2fcace 100644
--- a/WebCore/inspector/InspectorTimelineAgent.h
+++ b/WebCore/inspector/InspectorTimelineAgent.h
@@ -54,6 +54,7 @@ namespace WebCore {
XHRReadyStateChangeRecordType = 8,
XHRLoadRecordType = 9,
EvaluateScriptTimelineRecordType = 10,
+ MarkTimelineRecordType = 11,
};
class InspectorTimelineAgent {
@@ -93,6 +94,8 @@ namespace WebCore {
void willEvaluateScript(const String&, int);
void didEvaluateScript();
+ void didMarkTimeline(const String&);
+
static InspectorTimelineAgent* retrieve(ScriptExecutionContext*);
private:
struct TimelineRecordEntry {
diff --git a/WebCore/inspector/TimelineRecordFactory.cpp b/WebCore/inspector/TimelineRecordFactory.cpp
index 278e7fb..ea6b4d0 100644
--- a/WebCore/inspector/TimelineRecordFactory.cpp
+++ b/WebCore/inspector/TimelineRecordFactory.cpp
@@ -104,6 +104,15 @@ ScriptObject TimelineRecordFactory::createEvaluateScriptTimelineRecord(Inspector
return item;
}
+ScriptObject TimelineRecordFactory::createMarkTimelineRecord(InspectorFrontend* frontend, double startTime, const String& message)
+{
+ ScriptObject item = createGenericRecord(frontend, startTime);
+ ScriptObject data = frontend->newScriptObject();
+ data.set("message", message);
+ item.set("data", data);
+ return item;
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/TimelineRecordFactory.h b/WebCore/inspector/TimelineRecordFactory.h
index 2d2b882..d5c6e1b 100644
--- a/WebCore/inspector/TimelineRecordFactory.h
+++ b/WebCore/inspector/TimelineRecordFactory.h
@@ -54,6 +54,8 @@ namespace WebCore {
static ScriptObject createEvaluateScriptTimelineRecord(InspectorFrontend*, double startTime, const String&, double lineNumber);
+ static ScriptObject createMarkTimelineRecord(InspectorFrontend*, double startTime, const String&);
+
private:
TimelineRecordFactory() { }
};
diff --git a/WebCore/inspector/front-end/TimelineAgent.js b/WebCore/inspector/front-end/TimelineAgent.js
index 3ed1d7d..3734b71 100644
--- a/WebCore/inspector/front-end/TimelineAgent.js
+++ b/WebCore/inspector/front-end/TimelineAgent.js
@@ -44,7 +44,8 @@ WebInspector.TimelineAgent.RecordType = {
TimerFire : 7,
XHRReadyStateChange : 8,
XHRLoad : 9,
- EvaluateScript : 10
+ EvaluateScript : 10,
+ MarkTimeline : 11
};
WebInspector.addRecordToTimeline = function(record) {
diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp
index 7d0f697..0c66724 100644
--- a/WebCore/page/Console.cpp
+++ b/WebCore/page/Console.cpp
@@ -270,6 +270,23 @@ void Console::count(ScriptCallStack* callStack)
#endif
}
+void Console::markTimeline(ScriptCallStack* callStack)
+{
+#if ENABLE(INSPECTOR)
+ Page* page = this->page();
+ if (!page)
+ return;
+
+ const ScriptCallFrame& lastCaller = callStack->at(0);
+ String message;
+ getFirstArgumentAsString(callStack->state(), lastCaller, message);
+
+ page->inspectorController()->markTimeline(message);
+#else
+ UNUSED_PARAM(callStack);
+#endif
+}
+
#if ENABLE(WML)
String Console::lastWMLErrorMessage() const
{
diff --git a/WebCore/page/Console.h b/WebCore/page/Console.h
index 1b93a4a..ea3a161 100644
--- a/WebCore/page/Console.h
+++ b/WebCore/page/Console.h
@@ -95,6 +95,7 @@ namespace WebCore {
void trace(ScriptCallStack*);
void assertCondition(bool condition, ScriptCallStack*);
void count(ScriptCallStack*);
+ void markTimeline(ScriptCallStack*);
#if ENABLE(WML)
String lastWMLErrorMessage() const;
#endif
diff --git a/WebCore/page/Console.idl b/WebCore/page/Console.idl
index 0e9f3dc..31500e6 100644
--- a/WebCore/page/Console.idl
+++ b/WebCore/page/Console.idl
@@ -44,6 +44,7 @@ module window {
[CustomArgumentHandling] void trace();
[CustomArgumentHandling, ImplementationFunction=assertCondition] void assert(in boolean condition);
[CustomArgumentHandling] void count();
+ [CustomArgumentHandling] void markTimeline();
#if defined(ENABLE_WML) && ENABLE_WML
[DontEnum] DOMString lastWMLErrorMessage();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list