WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-105527-20130218205127.patch (text/plain), 26.94 KB, created by
pdeng6
on 2013-02-18 04:48:11 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
pdeng6
Created:
2013-02-18 04:48:11 PST
Size:
26.94 KB
patch
obsolete
>Subversion Revision: 143159 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c9951082f5a132a5072bb93b620996db67ec1fac..1e96e3385c04c8588bbc778e96a3ee17e9a912f6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,55 @@ >+2013-02-18 Pan Deng <pan.deng@intel.com> >+ >+ [Web Inspector]Add WebSocket networking events in Timeline panel. >+ https://bugs.webkit.org/show_bug.cgi?id=105527. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch add four WebSocket networking events in Timeline panel. The Events >+ are CreateWebSocket, SendWebSocketHandshakeRequest, ReceiveWebSocketHandShakeResponse >+ and DestoryWebSocket. Thanks to Kitamura san's previous work. >+ >+ No new tests. >+ >+ * Modules/websockets/WebSocketChannel.cpp: Add protocol information >+ (WebCore::WebSocketChannel::connect): >+ * inspector/InspectorInstrumentation.cpp: >+ (WebCore): >+ (WebCore::InspectorInstrumentation::didCreateWebSocketImpl): Add Timeline agent instrumentation for websocket >+ (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl): Ditto >+ (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl): Ditto >+ (WebCore::InspectorInstrumentation::didCloseWebSocketImpl): Ditto >+ * inspector/InspectorInstrumentation.h: >+ (InspectorInstrumentation): >+ (WebCore::InspectorInstrumentation::didCreateWebSocket): >+ (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest): >+ (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse): >+ (WebCore::InspectorInstrumentation::didCloseWebSocket): >+ * inspector/InspectorTimelineAgent.cpp: >+ (TimelineRecordType): >+ (WebCore): >+ (WebCore::InspectorTimelineAgent::didCreateWebSocket): Add Timeline record for websocket create >+ (WebCore::InspectorTimelineAgent::addWebSocketRecord): Add general websocket record. >+ (WebCore::InspectorTimelineAgent::willSendWebSocketHandshakeRequest): Add Timeline record for websocket handshake request send >+ (WebCore::InspectorTimelineAgent::didReceiveWebSocketHandshakeResponse): Add Timeline record for websocket handshake response receive >+ (WebCore::InspectorTimelineAgent::didDestroyWebSocket): Add Timeline record for websocket destroy >+ * inspector/InspectorTimelineAgent.h: >+ (WebCore): >+ (InspectorTimelineAgent): >+ * inspector/TimelineRecordFactory.cpp: >+ (WebCore): >+ (WebCore::TimelineRecordFactory::createWebSocketCreateData): >+ (WebCore::TimelineRecordFactory::createGenericWebSocketData): >+ * inspector/TimelineRecordFactory.h: >+ (WebCore): >+ (TimelineRecordFactory): >+ * inspector/front-end/TimelineModel.js: Add Timeline record type for websocket >+ * inspector/front-end/TimelinePresentationModel.js: >+ (WebInspector.TimelinePresentationModel._initRecordStyles): >+ (WebInspector.TimelinePresentationModel.prototype._findParentRecord): Add find parent record logic. >+ (WebInspector.TimelinePresentationModel.Record): >+ (WebInspector.TimelinePresentationModel.Record.prototype._generatePopupContentWithImagePreview): Add PopupContent for websocket record >+ > 2013-02-15 Eugene Klyuchnikov <eustas@chromium.org> > > Web Inspector: Introduce ProfilesPanelDescriptor. >diff --git a/Source/WebCore/Modules/websockets/WebSocketChannel.cpp b/Source/WebCore/Modules/websockets/WebSocketChannel.cpp >index dcb5b153a9dcf8641af5f239eb1821cfe5f5a9d4..ccd60e79b3b10aa33eb91d4c96d5432703fb71fd 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketChannel.cpp >+++ b/Source/WebCore/Modules/websockets/WebSocketChannel.cpp >@@ -108,7 +108,7 @@ void WebSocketChannel::connect(const KURL& url, const String& protocol) > if (m_deflateFramer.canDeflate()) > m_handshake->addExtensionProcessor(m_deflateFramer.createExtensionProcessor()); > if (m_identifier) >- InspectorInstrumentation::didCreateWebSocket(m_document, m_identifier, url, m_document->url()); >+ InspectorInstrumentation::didCreateWebSocket(m_document, m_identifier, url, m_document->url(), protocol); > ref(); > m_handle = SocketStreamHandle::create(m_handshake->url(), this); > } >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp >index 7a4463236d753342005526b7bfcf36419ae6d48c..1c70850e0eaa53d82af8c761cfb404a104b5d638 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp >+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp >@@ -1157,32 +1157,41 @@ void InspectorInstrumentation::workerContextTerminatedImpl(InstrumentingAgents* > #endif > > #if ENABLE(WEB_SOCKETS) >-void InspectorInstrumentation::didCreateWebSocketImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const KURL& requestURL, const KURL&) >+void InspectorInstrumentation::didCreateWebSocketImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const KURL& requestURL, const KURL&, const String& protocol, Document* document) > { > InspectorAgent* inspectorAgent = instrumentingAgents->inspectorAgent(); > if (!inspectorAgent || !inspectorAgent->developerExtrasEnabled()) > return; > if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) > resourceAgent->didCreateWebSocket(identifier, requestURL); >+ if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) >+ timelineAgent->didCreateWebSocket(identifier, requestURL, protocol, document->frame()); > } > >-void InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const WebSocketHandshakeRequest& request) >+void InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const WebSocketHandshakeRequest& request, Document* document) > { > if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) > resourceAgent->willSendWebSocketHandshakeRequest(identifier, request); >+ if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) >+ timelineAgent->willSendWebSocketHandshakeRequest(identifier, document->frame()); > } > >-void InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const WebSocketHandshakeResponse& response) >+void InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const WebSocketHandshakeResponse& response, Document* document) > { > if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) > resourceAgent->didReceiveWebSocketHandshakeResponse(identifier, response); >+ if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) >+ timelineAgent->didReceiveWebSocketHandshakeResponse(identifier, document->frame()); > } > >-void InspectorInstrumentation::didCloseWebSocketImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier) >+void InspectorInstrumentation::didCloseWebSocketImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, Document* document) > { > if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) > resourceAgent->didCloseWebSocket(identifier); >+ if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) >+ timelineAgent->didDestroyWebSocket(identifier, document->frame()); > } >+ > void InspectorInstrumentation::didReceiveWebSocketFrameImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const WebSocketFrame& frame) > { > if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h >index e6c7128ce59b7ba3d4ff37f3a365d00dabf35476..647470e586fee7d033c855a720aaf34c4b2fc65f 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.h >+++ b/Source/WebCore/inspector/InspectorInstrumentation.h >@@ -266,7 +266,7 @@ public: > #endif > > #if ENABLE(WEB_SOCKETS) >- static void didCreateWebSocket(Document*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL); >+ static void didCreateWebSocket(Document*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL, const String& protocol); > static void willSendWebSocketHandshakeRequest(Document*, unsigned long identifier, const WebSocketHandshakeRequest&); > static void didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifier, const WebSocketHandshakeResponse&); > static void didCloseWebSocket(Document*, unsigned long identifier); >@@ -465,10 +465,10 @@ private: > #endif > > #if ENABLE(WEB_SOCKETS) >- static void didCreateWebSocketImpl(InstrumentingAgents*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL); >- static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeRequest&); >- static void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeResponse&); >- static void didCloseWebSocketImpl(InstrumentingAgents*, unsigned long identifier); >+ static void didCreateWebSocketImpl(InstrumentingAgents*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL, const String& protocol, Document*); >+ static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeRequest&, Document*); >+ static void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeResponse&, Document*); >+ static void didCloseWebSocketImpl(InstrumentingAgents*, unsigned long identifier, Document*); > static void didReceiveWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&); > static void didSendWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&); > static void didReceiveWebSocketFrameErrorImpl(InstrumentingAgents*, unsigned long identifier, const String&); >@@ -1836,16 +1836,17 @@ inline void InspectorInstrumentation::workerContextTerminated(ScriptExecutionCon > > > #if ENABLE(WEB_SOCKETS) >-inline void InspectorInstrumentation::didCreateWebSocket(Document* document, unsigned long identifier, const KURL& requestURL, const KURL& documentURL) >+inline void InspectorInstrumentation::didCreateWebSocket(Document* document, unsigned long identifier, const KURL& requestURL, const KURL& documentURL, const String& protocol) > { > #if ENABLE(INSPECTOR) > if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) >- didCreateWebSocketImpl(instrumentingAgents, identifier, requestURL, documentURL); >+ didCreateWebSocketImpl(instrumentingAgents, identifier, requestURL, documentURL, protocol, document); > #else > UNUSED_PARAM(document); > UNUSED_PARAM(identifier); > UNUSED_PARAM(requestURL); > UNUSED_PARAM(documentURL); >+ UNUSED_PARAM(protocol); > #endif > } > >@@ -1853,7 +1854,7 @@ inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(Document > { > #if ENABLE(INSPECTOR) > if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) >- willSendWebSocketHandshakeRequestImpl(instrumentingAgents, identifier, request); >+ willSendWebSocketHandshakeRequestImpl(instrumentingAgents, identifier, request, document); > #else > UNUSED_PARAM(document); > UNUSED_PARAM(identifier); >@@ -1865,7 +1866,7 @@ inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(Docum > { > #if ENABLE(INSPECTOR) > if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) >- didReceiveWebSocketHandshakeResponseImpl(instrumentingAgents, identifier, response); >+ didReceiveWebSocketHandshakeResponseImpl(instrumentingAgents, identifier, response, document); > #else > UNUSED_PARAM(document); > UNUSED_PARAM(identifier); >@@ -1877,7 +1878,7 @@ inline void InspectorInstrumentation::didCloseWebSocket(Document* document, unsi > { > #if ENABLE(INSPECTOR) > if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) >- didCloseWebSocketImpl(instrumentingAgents, identifier); >+ didCloseWebSocketImpl(instrumentingAgents, identifier, document); > #else > UNUSED_PARAM(document); > UNUSED_PARAM(identifier); >diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/InspectorTimelineAgent.cpp >index 97e14697f3176815d099a62186034c74bc2ceba9..116056e9665d8f76bbe7a4e8a32b5e2c8d9530ac 100644 >--- a/Source/WebCore/inspector/InspectorTimelineAgent.cpp >+++ b/Source/WebCore/inspector/InspectorTimelineAgent.cpp >@@ -111,6 +111,11 @@ static const char GCEvent[] = "GCEvent"; > static const char RequestAnimationFrame[] = "RequestAnimationFrame"; > static const char CancelAnimationFrame[] = "CancelAnimationFrame"; > static const char FireAnimationFrame[] = "FireAnimationFrame"; >+ >+static const char WebSocketCreate[] = "WebSocketCreate"; >+static const char WebSocketSendHandshakeRequest[] = "WebSocketSendHandshakeRequest"; >+static const char WebSocketReceiveHandshakeResponse[] = "WebSocketReceiveHandshakeResponse"; >+static const char WebSocketDestroy[] = "WebSocketDestroy"; > } > > void InspectorTimelineAgent::pushGCEventRecords() >@@ -491,6 +496,45 @@ void InspectorTimelineAgent::didProcessTask() > didCompleteCurrentRecord(TimelineRecordType::Program); > } > >+#if ENABLE(WEB_SOCKETS) >+void InspectorTimelineAgent::didCreateWebSocket(unsigned long identifier, const KURL& url, const String& protocol, Frame* frame) >+{ >+ pushGCEventRecords(); >+ RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), m_maxCallStackDepth); >+ record->setObject("data", TimelineRecordFactory::createWebSocketCreateData(identifier, url, protocol)); >+ String frameId; >+ if (frame && m_pageAgent) >+ frameId = m_pageAgent->frameId(frame); >+ addRecordToTimeline(record.release(), TimelineRecordType::WebSocketCreate, frameId); >+} >+ >+void InspectorTimelineAgent::addWebSocketRecord(unsigned long identifier, Frame* frame, const String& type) >+{ >+ pushGCEventRecords(); >+ RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), m_maxCallStackDepth); >+ record->setObject("data", TimelineRecordFactory::createGenericWebSocketData(identifier)); >+ String frameId; >+ if (frame && m_pageAgent) >+ frameId = m_pageAgent->frameId(frame); >+ addRecordToTimeline(record.release(), type, frameId); >+} >+ >+void InspectorTimelineAgent::willSendWebSocketHandshakeRequest(unsigned long identifier, Frame* frame) >+{ >+ addWebSocketRecord(identifier, frame, TimelineRecordType::WebSocketSendHandshakeRequest); >+} >+ >+void InspectorTimelineAgent::didReceiveWebSocketHandshakeResponse(unsigned long identifier, Frame* frame) >+{ >+ addWebSocketRecord(identifier, frame, TimelineRecordType::WebSocketReceiveHandshakeResponse); >+} >+ >+void InspectorTimelineAgent::didDestroyWebSocket(unsigned long identifier, Frame* frame) >+{ >+ addWebSocketRecord(identifier, frame, TimelineRecordType::WebSocketDestroy); >+} >+#endif // ENABLE(WEB_SOCKETS) >+ > void InspectorTimelineAgent::addRecordToTimeline(PassRefPtr<InspectorObject> record, const String& type, const String& frameId) > { > commitFrameRecord(); >diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.h b/Source/WebCore/inspector/InspectorTimelineAgent.h >index 4c5a0d3575e9c4c258aa4af4f55015ff1846c09c..bc13b302a6cf5397e1c9683544453697b49cc76d 100644 >--- a/Source/WebCore/inspector/InspectorTimelineAgent.h >+++ b/Source/WebCore/inspector/InspectorTimelineAgent.h >@@ -53,6 +53,7 @@ class InspectorPageAgent; > class InspectorState; > class InstrumentingAgents; > class IntRect; >+class KURL; > class RenderObject; > class ResourceRequest; > class ResourceResponse; >@@ -158,6 +159,13 @@ public: > void willProcessTask(); > void didProcessTask(); > >+#if ENABLE(WEB_SOCKETS) >+ void didCreateWebSocket(unsigned long identifier, const KURL&, const String& protocol, Frame*); >+ void willSendWebSocketHandshakeRequest(unsigned long identifier, Frame*); >+ void didReceiveWebSocketHandshakeResponse(unsigned long identifier, Frame*); >+ void didDestroyWebSocket(unsigned long identifier, Frame*); >+#endif >+ > // ScriptGCEventListener methods. > virtual void didGC(double, double, size_t); > >@@ -196,6 +204,10 @@ private: > void pushGCEventRecords(); > void clearRecordStack(); > >+#if ENABLE(WEB_SOCKETS) >+ void addWebSocketRecord(unsigned long, Frame*, const String&); >+#endif >+ > double timestamp(); > double timestampFromMicroseconds(double microseconds); > >diff --git a/Source/WebCore/inspector/TimelineRecordFactory.cpp b/Source/WebCore/inspector/TimelineRecordFactory.cpp >index 8dee5300df754ac06120f29b605d81c38c9081bd..631bf0481768df5ce5ceddaaf5aa9e2193ad2ce9 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.cpp >+++ b/Source/WebCore/inspector/TimelineRecordFactory.cpp >@@ -207,6 +207,25 @@ void TimelineRecordFactory::addRectData(InspectorObject* data, const LayoutRect& > data->setNumber("height", rect.height()); > } > >+#if ENABLE(WEB_SOCKETS) >+PassRefPtr<InspectorObject> TimelineRecordFactory::createWebSocketCreateData(unsigned long identifier, const KURL& url, const String& protocol) >+{ >+ RefPtr<InspectorObject> data = InspectorObject::create(); >+ data->setNumber("identifier", identifier); >+ data->setString("url", url.string()); >+ if (!protocol.isNull()) >+ data->setString("webSocketProtocol", protocol); >+ return data.release(); >+} >+ >+PassRefPtr<InspectorObject> TimelineRecordFactory::createGenericWebSocketData(unsigned long identifier) >+{ >+ RefPtr<InspectorObject> data = InspectorObject::create(); >+ data->setNumber("identifier", identifier); >+ return data.release(); >+} >+#endif // ENABLE(WEB_SOCKETS) >+ > } // namespace WebCore > > #endif // ENABLE(INSPECTOR) >diff --git a/Source/WebCore/inspector/TimelineRecordFactory.h b/Source/WebCore/inspector/TimelineRecordFactory.h >index eeee67203325335b7845347083e8424bdfb9c3d7..7778ce473c7c30643f70c75f7b91b7acc44cf9e1 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.h >+++ b/Source/WebCore/inspector/TimelineRecordFactory.h >@@ -33,6 +33,7 @@ > > #include "LayoutRect.h" > #include <wtf/Forward.h> >+#include <wtf/text/WTFString.h> > > namespace WebCore { > >@@ -40,6 +41,7 @@ namespace WebCore { > class InspectorFrontend; > class InspectorObject; > class IntRect; >+ class KURL; > class ResourceRequest; > class ResourceResponse; > >@@ -85,6 +87,12 @@ namespace WebCore { > > static PassRefPtr<InspectorObject> createAnimationFrameData(int callbackId); > >+#if ENABLE(WEB_SOCKETS) >+ static PassRefPtr<InspectorObject> createWebSocketCreateData(unsigned long identifier, const KURL&, const String& protocol); >+ >+ static PassRefPtr<InspectorObject> createGenericWebSocketData(unsigned long identifier); >+#endif >+ > private: > TimelineRecordFactory() { } > }; >diff --git a/Source/WebCore/inspector/front-end/TimelineModel.js b/Source/WebCore/inspector/front-end/TimelineModel.js >index d729c5cece5830ada8afed16b2ed1b17b0adbafd..6dad21dcc6cf0a90518caf71b37b61198b6a7973 100644 >--- a/Source/WebCore/inspector/front-end/TimelineModel.js >+++ b/Source/WebCore/inspector/front-end/TimelineModel.js >@@ -89,7 +89,12 @@ WebInspector.TimelineModel.RecordType = { > > RequestAnimationFrame: "RequestAnimationFrame", > CancelAnimationFrame: "CancelAnimationFrame", >- FireAnimationFrame: "FireAnimationFrame" >+ FireAnimationFrame: "FireAnimationFrame", >+ >+ WebSocketCreate : "WebSocketCreate", >+ WebSocketSendHandshakeRequest : "WebSocketSendHandshakeRequest", >+ WebSocketReceiveHandshakeResponse : "WebSocketReceiveHandshakeResponse", >+ WebSocketDestroy : "WebSocketDestroy", > } > > WebInspector.TimelineModel.Events = { >diff --git a/Source/WebCore/inspector/front-end/TimelinePresentationModel.js b/Source/WebCore/inspector/front-end/TimelinePresentationModel.js >index 90bcfb653725298aeafdda52e1d8714730dd6dc8..c48a55dd99f4a20d96029336cdef534890c607e7 100644 >--- a/Source/WebCore/inspector/front-end/TimelinePresentationModel.js >+++ b/Source/WebCore/inspector/front-end/TimelinePresentationModel.js >@@ -102,6 +102,10 @@ WebInspector.TimelinePresentationModel._initRecordStyles = function() > recordStyles[recordTypes.RequestAnimationFrame] = { title: WebInspector.UIString("Request Animation Frame"), category: categories["scripting"] }; > recordStyles[recordTypes.CancelAnimationFrame] = { title: WebInspector.UIString("Cancel Animation Frame"), category: categories["scripting"] }; > recordStyles[recordTypes.FireAnimationFrame] = { title: WebInspector.UIString("Animation Frame Fired"), category: categories["scripting"] }; >+ recordStyles[recordTypes.WebSocketCreate] = { title: WebInspector.UIString("Create WebSocket"), category: categories["scripting"] }; >+ recordStyles[recordTypes.WebSocketSendHandshakeRequest] = { title: WebInspector.UIString("Send WebSocket Handshake"), category: categories["scripting"] }; >+ recordStyles[recordTypes.WebSocketReceiveHandshakeResponse] = { title: WebInspector.UIString("Receive WebSocket Handshake"), category: categories["scripting"] }; >+ recordStyles[recordTypes.WebSocketDestroy] = { title: WebInspector.UIString("Destroy WebSocket"), category: categories["scripting"] }; > > WebInspector.TimelinePresentationModel._recordStylesMap = recordStyles; > return recordStyles; >@@ -367,6 +371,9 @@ WebInspector.TimelinePresentationModel.prototype = { > case recordTypes.ResourceFinish: > case recordTypes.ResourceReceivedData: > return this._sendRequestRecords[record.data["requestId"]]; >+ case recordTypes.WebSocketSendHandshakeRequest: >+ case recordTypes.WebSocketDestroy: >+ return this._sendRequestRecords[record.data["identifier"]]; > > case recordTypes.ResourceSendRequest: > return this._rootRecord; >@@ -385,6 +392,10 @@ WebInspector.TimelinePresentationModel.prototype = { > > case recordTypes.TimeEnd: > return this._timeRecords[record.data["message"]]; >+ >+ case recordTypes.WebSocketReceiveHandshakeResponse: >+ var webSocketCreateRecord = this._sendRequestRecords[record.data["identifier"]]; >+ return webSocketCreateRecord ? webSocketCreateRecord.handshakeRequestRecord : null; > } > }, > >@@ -658,6 +669,29 @@ WebInspector.TimelinePresentationModel.Record = function(presentationModel, reco > this.setHasWarning(); > presentationModel._layoutInvalidateStack[this.frameId] = null; > break; >+ >+ case recordTypes.WebSocketCreate: >+ this.webSocketURL = record.data["url"]; >+ if (typeof record.data["webSocketProtocol"] !== "undefined") >+ this.webSocketProtocol = record.data["webSocketProtocol"]; >+ presentationModel._sendRequestRecords[record.data["identifier"]] = this; >+ break; >+ >+ case recordTypes.WebSocketSendHandshakeRequest: >+ case recordTypes.WebSocketReceiveHandshakeResponse: >+ case recordTypes.WebSocketDestroy: >+ var webSocketCreateRecord = presentationModel._sendRequestRecords[record.data["identifier"]]; >+ if (webSocketCreateRecord) { // False if we started instrumentation in the middle of request. >+ this.webSocketURL = webSocketCreateRecord.webSocketURL; >+ if (typeof webSocketCreateRecord.webSocketProtocol !== "undefined") >+ this.webSocketProtocol = webSocketCreateRecord.webSocketProtocol; >+ >+ // Save WebSocketSendHandshakeRequest record so that we can add >+ // WebSocketReceiveHandshakeResponse record under it later. >+ if (record.type === recordTypes.WebSocketSendHandshakeRequest) >+ webSocketCreateRecord.handshakeRequestRecord = this; >+ } >+ break; > } > } > >@@ -910,6 +944,17 @@ WebInspector.TimelinePresentationModel.Record.prototype = { > if (typeof this.intervalDuration === "number") > contentHelper._appendTextRow(WebInspector.UIString("Interval Duration"), Number.secondsToString(this.intervalDuration, true)); > break; >+ case recordTypes.WebSocketCreate: >+ case recordTypes.WebSocketSendHandshakeRequest: >+ case recordTypes.WebSocketReceiveHandshakeResponse: >+ case recordTypes.WebSocketDestroy: >+ if (typeof this.webSocketURL !== "undefined") >+ contentHelper._appendTextRow(WebInspector.UIString("URL"), this.webSocketURL); >+ if (typeof this.webSocketProtocol !== "undefined") >+ contentHelper._appendTextRow(WebInspector.UIString("WebSocket Protocol"), this.webSocketProtocol); >+ if (typeof this.data["message"] !== "undefined") >+ contentHelper._appendTextRow(WebInspector.UIString("Message"), this.data["message"]) >+ break; > default: > if (this.detailsNode()) > contentHelper._appendElementRow(WebInspector.UIString("Details"), this.detailsNode().childNodes[1].cloneNode()); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 35b54b957e2db810034887224d9defcf667a3e8c..0e1b1e7f368aee675b377ed0ef85bb6bb6093694 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2013-02-18 Pan Deng <pan.deng@intel.com> >+ >+ [Web Inspector]Add WebSocket networking events in WebInspector Timeline panel. >+ https://bugs.webkit.org/show_bug.cgi?id=105527. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change add the record event type to test expections. The Events are CreateWebSocket, >+ SendWebSocketHandshakeRequest, ReceiveWebSocketHandShakeResponse and DestoryWebSocket. >+ >+ * inspector/timeline/timeline-enum-stability-expected.txt: >+ > 2013-02-15 Eugene Klyuchnikov <eustas@chromium.org> > > Web Inspector: Introduce ProfilesPanelDescriptor. >diff --git a/LayoutTests/inspector/timeline/timeline-enum-stability-expected.txt b/LayoutTests/inspector/timeline/timeline-enum-stability-expected.txt >index 10e03f7712da9a966d341e8bc4c2aa7d0f64de73..d57b5261f0710b852a4f360115e9739f76591985 100644 >--- a/LayoutTests/inspector/timeline/timeline-enum-stability-expected.txt >+++ b/LayoutTests/inspector/timeline/timeline-enum-stability-expected.txt >@@ -36,6 +36,10 @@ Applications outside of WebKit depend on the stability of the mapping of these t > TimerFire : "TimerFire" > TimerInstall : "TimerInstall" > TimerRemove : "TimerRemove" >+ WebSocketCreate : "WebSocketCreate" >+ WebSocketDestroy : "WebSocketDestroy" >+ WebSocketReceiveHandshakeResponse : "WebSocketReceiveHandshakeResponse" >+ WebSocketSendHandshakeRequest : "WebSocketSendHandshakeRequest" > XHRLoad : "XHRLoad" > XHRReadyStateChange : "XHRReadyStateChange" > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 105527
:
180338
|
180340
|
180487
|
188853
|
189005
|
189006
|
189037
|
189063
|
189223