[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:09:25 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 67efbfbe1054b26df9e0f474e6e26d4251303037
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 27 19:30:57 2009 +0000
2009-10-27 Kelly Norton <knorton at google.com>
Reviewed by Timothy Hatcher.
Adds XMLHttpRequest support to InspectorTimelineAgent.
https://bugs.webkit.org/show_bug.cgi?id=30578
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willChangeXHRReadyState):
(WebCore::InspectorTimelineAgent::didChangeXHRReadyState):
(WebCore::InspectorTimelineAgent::willLoadXHR):
(WebCore::InspectorTimelineAgent::didLoadXHR):
* inspector/InspectorTimelineAgent.h:
(WebCore::):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createXHRReadyStateChangeTimelineRecord):
(WebCore::TimelineRecordFactory::createXHRLoadTimelineRecord):
* inspector/TimelineRecordFactory.h:
* inspector/front-end/TimelineAgent.js:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::callReadyStateChangeListener):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3254aa6..d376eeb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-27 Kelly Norton <knorton at google.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Adds XMLHttpRequest support to InspectorTimelineAgent.
+ https://bugs.webkit.org/show_bug.cgi?id=30578
+
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::willChangeXHRReadyState):
+ (WebCore::InspectorTimelineAgent::didChangeXHRReadyState):
+ (WebCore::InspectorTimelineAgent::willLoadXHR):
+ (WebCore::InspectorTimelineAgent::didLoadXHR):
+ * inspector/InspectorTimelineAgent.h:
+ (WebCore::):
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createXHRReadyStateChangeTimelineRecord):
+ (WebCore::TimelineRecordFactory::createXHRLoadTimelineRecord):
+ * inspector/TimelineRecordFactory.h:
+ * inspector/front-end/TimelineAgent.js:
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::callReadyStateChangeListener):
+
2009-10-27 Enrica Casucci <enrica at apple.com>
Reviewed by Adele Peterson.
diff --git a/WebCore/inspector/InspectorTimelineAgent.cpp b/WebCore/inspector/InspectorTimelineAgent.cpp
index 9220824..202cbba 100644
--- a/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -124,6 +124,26 @@ void InspectorTimelineAgent::didFireTimer()
didCompleteCurrentRecord(TimerFireTimelineRecordType);
}
+void InspectorTimelineAgent::willChangeXHRReadyState(const String& url, int readyState)
+{
+ pushCurrentRecord(TimelineRecordFactory::createXHRReadyStateChangeTimelineRecord(m_frontend, currentTimeInMilliseconds(), url, readyState),
+ XHRReadyStateChangeRecordType);
+}
+
+void InspectorTimelineAgent::didChangeXHRReadyState()
+{
+ didCompleteCurrentRecord(XHRReadyStateChangeRecordType);
+}
+
+void InspectorTimelineAgent::willLoadXHR(const String& url) {
+ pushCurrentRecord(TimelineRecordFactory::createXHRLoadTimelineRecord(m_frontend, currentTimeInMilliseconds(), url), XHRLoadRecordType);
+}
+
+void InspectorTimelineAgent::didLoadXHR()
+{
+ didCompleteCurrentRecord(XHRLoadRecordType);
+}
+
void InspectorTimelineAgent::reset()
{
m_recordStack.clear();
diff --git a/WebCore/inspector/InspectorTimelineAgent.h b/WebCore/inspector/InspectorTimelineAgent.h
index a5f8511..e2e1e82 100644
--- a/WebCore/inspector/InspectorTimelineAgent.h
+++ b/WebCore/inspector/InspectorTimelineAgent.h
@@ -51,6 +51,8 @@ namespace WebCore {
TimerInstallTimelineRecordType = 5,
TimerRemoveTimelineRecordType = 6,
TimerFireTimelineRecordType = 7,
+ XHRReadyStateChangeRecordType = 8,
+ XHRLoadRecordType = 9,
};
class InspectorTimelineAgent {
@@ -81,6 +83,11 @@ namespace WebCore {
void willFireTimer(int timerId);
void didFireTimer();
+ void willChangeXHRReadyState(const String&, int);
+ void didChangeXHRReadyState();
+ void willLoadXHR(const String&);
+ void didLoadXHR();
+
static InspectorTimelineAgent* retrieve(ScriptExecutionContext*);
private:
struct TimelineRecordEntry {
diff --git a/WebCore/inspector/TimelineRecordFactory.cpp b/WebCore/inspector/TimelineRecordFactory.cpp
index 64f7559..3ccdaac 100644
--- a/WebCore/inspector/TimelineRecordFactory.cpp
+++ b/WebCore/inspector/TimelineRecordFactory.cpp
@@ -79,6 +79,27 @@ ScriptObject TimelineRecordFactory::createTimerInstallRecord(InspectorFrontend*
return record;
}
+// static
+ScriptObject TimelineRecordFactory::createXHRReadyStateChangeTimelineRecord(InspectorFrontend* frontend, double startTime, const String& url, int readyState)
+{
+ ScriptObject record = createGenericRecord(frontend, startTime);
+ ScriptObject data = frontend->newScriptObject();
+ data.set("url", url);
+ data.set("readyState", readyState);
+ record.set("data", data);
+ return record;
+}
+
+// static
+ScriptObject TimelineRecordFactory::createXHRLoadTimelineRecord(InspectorFrontend* frontend, double startTime, const String& url)
+{
+ ScriptObject record = createGenericRecord(frontend, startTime);
+ ScriptObject data = frontend->newScriptObject();
+ data.set("url", url);
+ record.set("data", data);
+ return record;
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/TimelineRecordFactory.h b/WebCore/inspector/TimelineRecordFactory.h
index cad4172..f1a5fa5 100644
--- a/WebCore/inspector/TimelineRecordFactory.h
+++ b/WebCore/inspector/TimelineRecordFactory.h
@@ -31,6 +31,8 @@
#ifndef TimelineRecordFactory_h
#define TimelineRecordFactory_h
+#include "PlatformString.h"
+
namespace WebCore {
class Event;
@@ -46,6 +48,10 @@ namespace WebCore {
static ScriptObject createGenericTimerRecord(InspectorFrontend*, double startTime, int timerId);
static ScriptObject createTimerInstallRecord(InspectorFrontend*, double startTime, int timerId, int timeout, bool singleShot);
+
+ static ScriptObject createXHRReadyStateChangeTimelineRecord(InspectorFrontend*, double startTime, const String& url, int readyState);
+
+ static ScriptObject createXHRLoadTimelineRecord(InspectorFrontend*, double startTime, const String& url);
private:
TimelineRecordFactory() { }
diff --git a/WebCore/inspector/front-end/TimelineAgent.js b/WebCore/inspector/front-end/TimelineAgent.js
index fcaad5d..2886e90 100644
--- a/WebCore/inspector/front-end/TimelineAgent.js
+++ b/WebCore/inspector/front-end/TimelineAgent.js
@@ -34,14 +34,16 @@ WebInspector.TimelineAgent = function() {
// Must be kept in sync with TimelineItem.h
WebInspector.TimelineAgent.RecordType = {
- DOMDispatch : 0,
- Layout : 1,
- RecalculateStyles : 2,
- Paint : 3,
- ParseHTML : 4,
- TimerInstall : 5,
- TimerRemove : 6,
- TimerFire : 7,
+ DOMDispatch : 0,
+ Layout : 1,
+ RecalculateStyles : 2,
+ Paint : 3,
+ ParseHTML : 4,
+ TimerInstall : 5,
+ TimerRemove : 6,
+ TimerFire : 7,
+ XHRReadyStateChange : 8,
+ XHRLoad : 9,
};
WebInspector.addRecordToTimeline = function(record) {
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 3c34baf..87a6540 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -33,6 +33,7 @@
#include "EventNames.h"
#include "File.h"
#include "HTTPParsers.h"
+#include "InspectorTimelineAgent.h"
#include "ResourceError.h"
#include "ResourceRequest.h"
#include "SecurityOrigin.h"
@@ -250,10 +251,32 @@ void XMLHttpRequest::callReadyStateChangeListener()
if (!scriptExecutionContext())
return;
+#if ENABLE(INSPECTOR)
+ InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext());
+ if (timelineAgent)
+ timelineAgent->willChangeXHRReadyState(m_url.string(), m_state);
+#endif
+
dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent));
- if (m_state == DONE && !m_error)
+#if ENABLE(INSPECTOR)
+ if (timelineAgent)
+ timelineAgent->didChangeXHRReadyState();
+#endif
+
+ if (m_state == DONE && !m_error) {
+#if ENABLE(INSPECTOR)
+ if (timelineAgent)
+ timelineAgent->willLoadXHR(m_url.string());
+#endif
+
dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
+
+#if ENABLE(INSPECTOR)
+ if (timelineAgent)
+ timelineAgent->didLoadXHR();
+#endif
+ }
}
void XMLHttpRequest::setWithCredentials(bool value, ExceptionCode& ec)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list