[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
eric at webkit.org
eric at webkit.org
Wed Apr 7 23:21:08 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 821637bbb171d59b6b1fd9f6028e3ad7b70826ff
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 4 00:00:17 2009 +0000
2009-11-03 Eric Z. Ayers <zundel at google.com>
Reviewed by Timothy Hatcher.
Adds a test for turning on the timeline profiler. This caused
a crash because profiling was enabled in the middle of processing
an event.
https://bugs.webkit.org/show_bug.cgi?id=31080
* inspector/timeline-trivial-expected.txt: Added.
* inspector/timeline-trivial.html: Added.
2009-11-03 Eric Z. Ayers <zundel at google.com>
Reviewed by Timothy Hatcher.
Fixes a problem where the timeline instrumentation crashes if
timeline profiling is enabled or disabled in the middle of an
event dispatch.
https://bugs.webkit.org/show_bug.cgi?id=31080
Test: inspector/timeline-trivial.html
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::processingUserGestureEvent):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1a3c827..c035389 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-03 Eric Z. Ayers <zundel at google.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Adds a test for turning on the timeline profiler. This caused
+ a crash because profiling was enabled in the middle of processing
+ an event.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31080
+
+ * inspector/timeline-trivial-expected.txt: Added.
+ * inspector/timeline-trivial.html: Added.
+
2009-11-03 Bradley Green <brg at chromium.org>
Reviewed by Dmitry Titov.
diff --git a/LayoutTests/inspector/timeline-trivial-expected.txt b/LayoutTests/inspector/timeline-trivial-expected.txt
new file mode 100644
index 0000000..443f7db
--- /dev/null
+++ b/LayoutTests/inspector/timeline-trivial-expected.txt
@@ -0,0 +1,4 @@
+Trivial use of inspector frontend tests
+
+Timeline started
+
diff --git a/LayoutTests/inspector/timeline-trivial.html b/LayoutTests/inspector/timeline-trivial.html
new file mode 100644
index 0000000..93e8a0d
--- /dev/null
+++ b/LayoutTests/inspector/timeline-trivial.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<script src="evaluate-in-frontend.js"></script>
+<script>
+
+function doit()
+{
+ function callback(result) {
+ output("Timeline started");
+ notifyDone();
+ }
+ evaluateInWebInspector("startTimeline()", callback);
+}
+
+</script>
+</head>
+
+<body onload="onload()">
+<p>
+Trivial use of inspector frontend tests
+</p>
+
+<div id="frontend-script" style="display:none">
+
+function startTimeline() {
+ /* This test seems silly, but originally it tickled bug 31080 */
+ InspectorController.startTimelineProfiler();
+ return true;
+}
+
+</div>
+
+<div id="output">
+</div>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 223774d..7acd28f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2009-11-03 Eric Z. Ayers <zundel at google.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Fixes a problem where the timeline instrumentation crashes if
+ timeline profiling is enabled or disabled in the middle of an
+ event dispatch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31080
+
+ Test: inspector/timeline-trivial.html
+
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::evaluateInWorld):
+ (WebCore::ScriptController::processingUserGestureEvent):
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
+ * page/DOMTimer.cpp:
+ (WebCore::DOMTimer::fired):
+
2009-11-03 Dan Bernstein <mitz at apple.com>
Reviewed by Dave Hyatt.
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 691dbea..d549585 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -120,8 +120,7 @@ ScriptValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode
RefPtr<Frame> protect = m_frame;
#if ENABLE(INSPECTOR)
- InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
- if (timelineAgent)
+ if (InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0)
timelineAgent->willEvaluateScript(sourceURL, sourceCode.startLine());
#endif
@@ -130,7 +129,7 @@ ScriptValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode
exec->globalData().timeoutChecker.stop();
#if ENABLE(INSPECTOR)
- if (timelineAgent)
+ if (InspectorTimelineAgent* timelineAgent = m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0)
timelineAgent->didEvaluateScript();
#endif
@@ -277,15 +276,15 @@ bool ScriptController::processingUserGestureEvent() const
const AtomicString& type = event->type();
if ( // mouse events
- type == eventNames().clickEvent || type == eventNames().mousedownEvent ||
- type == eventNames().mouseupEvent || type == eventNames().dblclickEvent ||
+ type == eventNames().clickEvent || type == eventNames().mousedownEvent
+ || type == eventNames().mouseupEvent || type == eventNames().dblclickEvent
// keyboard events
- type == eventNames().keydownEvent || type == eventNames().keypressEvent ||
- type == eventNames().keyupEvent ||
+ || type == eventNames().keydownEvent || type == eventNames().keypressEvent
+ || type == eventNames().keyupEvent
// other accepted events
- type == eventNames().selectEvent || type == eventNames().changeEvent ||
- type == eventNames().focusEvent || type == eventNames().blurEvent ||
- type == eventNames().submitEvent)
+ || type == eventNames().selectEvent || type == eventNames().changeEvent
+ || type == eventNames().focusEvent || type == eventNames().blurEvent
+ || type == eventNames().submitEvent)
return true;
}
diff --git a/WebCore/inspector/InspectorTimelineAgent.cpp b/WebCore/inspector/InspectorTimelineAgent.cpp
index 8b1fcb8..447d646 100644
--- a/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -181,13 +181,16 @@ void InspectorTimelineAgent::addRecordToTimeline(ScriptObject record, TimelineRe
void InspectorTimelineAgent::didCompleteCurrentRecord(TimelineRecordType type)
{
- ASSERT(!m_recordStack.isEmpty());
- TimelineRecordEntry entry = m_recordStack.last();
- m_recordStack.removeLast();
- ASSERT(entry.type == type);
- entry.record.set("children", entry.children);
- entry.record.set("endTime", currentTimeInMilliseconds());
- addRecordToTimeline(entry.record, type);
+ // An empty stack could merely mean that the timeline agent was turned on in the middle of
+ // an event. Don't treat as an error.
+ if (!m_recordStack.isEmpty()) {
+ TimelineRecordEntry entry = m_recordStack.last();
+ m_recordStack.removeLast();
+ ASSERT(entry.type == type);
+ entry.record.set("children", entry.children);
+ entry.record.set("endTime", currentTimeInMilliseconds());
+ addRecordToTimeline(entry.record, type);
+ }
}
double InspectorTimelineAgent::currentTimeInMilliseconds()
diff --git a/WebCore/page/DOMTimer.cpp b/WebCore/page/DOMTimer.cpp
index 83bcb02..8971bb7 100644
--- a/WebCore/page/DOMTimer.cpp
+++ b/WebCore/page/DOMTimer.cpp
@@ -119,8 +119,7 @@ void DOMTimer::fired()
timerNestingLevel = m_nestingLevel;
#if ENABLE(INSPECTOR)
- InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context);
- if (timelineAgent)
+ if (InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context))
timelineAgent->willFireTimer(m_timeoutId);
#endif
@@ -135,7 +134,7 @@ void DOMTimer::fired()
// No access to member variables after this point, it can delete the timer.
m_action->execute(context);
#if ENABLE(INSPECTOR)
- if (timelineAgent)
+ if (InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context))
timelineAgent->didFireTimer();
#endif
return;
@@ -149,7 +148,7 @@ void DOMTimer::fired()
action->execute(context);
#if ENABLE(INSPECTOR)
- if (timelineAgent)
+ if (InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(context))
timelineAgent->didFireTimer();
#endif
delete action;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list