Web Inspector: Handle or Remove ParseHTML Timeline Event Records
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 20:27:35 +0000 (20:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 20:27:35 +0000 (20:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150689

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-11-03
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Timeline.json:

Source/WebCore:

Remove ParseHTML nesting recordings. We were not using them
and for most pages their self-time is very small in comparison
to other events. We may consider adding it back later for
UI purposes but for now the frontend doesn't use the records
so lets remove it.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::pumpTokenizer): Deleted.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willWriteHTMLImpl): Deleted.
(WebCore::InspectorInstrumentation::didWriteHTMLImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willWriteHTML): Deleted.
(WebCore::InspectorInstrumentation::didWriteHTML): Deleted.
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willWriteHTML): Deleted.
(WebCore::InspectorTimelineAgent::didWriteHTML): Deleted.
(WebCore::toProtocol): Deleted.
* inspector/InspectorTimelineAgent.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createParseHTMLData): Deleted.
* inspector/TimelineRecordFactory.h:

Source/WebInspectorUI:

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype._processRecord):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191967 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Timeline.json
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLDocumentParser.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/inspector/TimelineRecordFactory.cpp
Source/WebCore/inspector/TimelineRecordFactory.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js

index b42dad695942c5ccd3ced69fa9fc03bb785559e8..8da24150f481e1f996925969241f698886c28103 100644 (file)
@@ -1,3 +1,12 @@
+2015-11-03  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Handle or Remove ParseHTML Timeline Event Records
+        https://bugs.webkit.org/show_bug.cgi?id=150689
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/protocol/Timeline.json:
+
 2015-11-03  Michael Saboff  <msaboff@apple.com>
 
         Rename InlineCallFrame:: getCallerSkippingDeadFrames to something more descriptive
index f1a1a7b95bc530522e12b1c4fcc14e11de39f7cb..3a550cb786f72f54beac804d9b2991daf260b414 100644 (file)
@@ -15,7 +15,6 @@
                 "Paint",
                 "Composite",
                 "RenderingFrame",
-                "ParseHTML",
                 "TimerInstall",
                 "TimerRemove",
                 "TimerFire",
index 2ce4d323ff66d379bb4b86d67757b99b45e6e4f4..93892e9802065d3842e5e041d86e9a208b8c2021 100644 (file)
@@ -1,3 +1,33 @@
+2015-11-03  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Handle or Remove ParseHTML Timeline Event Records
+        https://bugs.webkit.org/show_bug.cgi?id=150689
+
+        Reviewed by Timothy Hatcher.
+
+        Remove ParseHTML nesting recordings. We were not using them
+        and for most pages their self-time is very small in comparison
+        to other events. We may consider adding it back later for
+        UI purposes but for now the frontend doesn't use the records
+        so lets remove it.
+
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::pumpTokenizer): Deleted.
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::willWriteHTMLImpl): Deleted.
+        (WebCore::InspectorInstrumentation::didWriteHTMLImpl): Deleted.
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::willWriteHTML): Deleted.
+        (WebCore::InspectorInstrumentation::didWriteHTML): Deleted.
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::willWriteHTML): Deleted.
+        (WebCore::InspectorTimelineAgent::didWriteHTML): Deleted.
+        (WebCore::toProtocol): Deleted.
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createParseHTMLData): Deleted.
+        * inspector/TimelineRecordFactory.h:
+
 2015-11-03  Keith Rollin  <krollin@apple.com>
 
         HTMLOptionElement.text should never return the value of label
index 63b3b407a47edf1c98d0c3552bccf2c030938456..f6faebd8c721425aa02cb73c2076d503a97653c7 100644 (file)
 #include "HTMLDocumentParser.h"
 
 #include "DocumentFragment.h"
+#include "Frame.h"
+#include "HTMLDocument.h"
 #include "HTMLParserScheduler.h"
 #include "HTMLPreloadScanner.h"
 #include "HTMLScriptRunner.h"
 #include "HTMLTreeBuilder.h"
-#include "HTMLDocument.h"
-#include "InspectorInstrumentation.h"
 
 namespace WebCore {
 
@@ -247,13 +247,6 @@ void HTMLDocumentParser::pumpTokenizer(SynchronousMode mode)
 
     PumpSession session(m_pumpSessionNestingLevel, contextForParsingSession());
 
-    // We tell the InspectorInstrumentation about every pump, even if we
-    // end up pumping nothing.  It can filter out empty pumps itself.
-    // FIXME: m_input.current().length() is only accurate if we
-    // end up parsing the whole buffer in this pump.  We should pass how
-    // much we parsed as part of didWriteHTML instead of willWriteHTML.
-    auto cookie = InspectorInstrumentation::willWriteHTML(document(), m_input.current().currentLine().zeroBasedInt());
-
     m_xssAuditor.init(document(), &m_xssAuditorDelegate);
 
     while (canTakeNextToken(mode, session) && !session.needsYield) {
@@ -294,8 +287,6 @@ void HTMLDocumentParser::pumpTokenizer(SynchronousMode mode)
         }
         m_preloadScanner->scan(*m_preloader, *document());
     }
-
-    InspectorInstrumentation::didWriteHTML(cookie, m_input.current().currentLine().zeroBasedInt());
 }
 
 void HTMLDocumentParser::constructTreeFromHTMLToken(HTMLTokenizer::TokenPtr& rawToken)
index 448fc6deca4c6add8a28e49feca2ea56b9b3c26e..e527daa5f48706a412c22464f52ae13c46e5c151 100644 (file)
@@ -832,22 +832,6 @@ void InspectorInstrumentation::willDestroyCachedResourceImpl(CachedResource& cac
     }
 }
 
-InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTMLImpl(InstrumentingAgents& instrumentingAgents, unsigned startLine, Frame* frame)
-{
-    int timelineAgentId = 0;
-    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) {
-        timelineAgent->willWriteHTML(startLine, frame);
-        timelineAgentId = timelineAgent->id();
-    }
-    return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
-}
-
-void InspectorInstrumentation::didWriteHTMLImpl(const InspectorInstrumentationCookie& cookie, unsigned endLine)
-{
-    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
-        timelineAgent->didWriteHTML(endLine);
-}
-
 // JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes.
 static bool isConsoleAssertMessage(MessageSource source, MessageType type)
 {
index f48a4b127212d15773222d349a9c9b59befea4bc..696d824e3e43e28f83cd58d7cb41e0745e1898b2 100644 (file)
@@ -203,9 +203,6 @@ public:
     static void didRunJavaScriptDialog(const InspectorInstrumentationCookie&);
     static void willDestroyCachedResource(CachedResource&);
 
-    static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned startLine);
-    static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned endLine);
-
     static void addMessageToConsole(Page&, std::unique_ptr<Inspector::ConsoleMessage>);
 
     // FIXME: Convert to ScriptArguments to match non-worker context.
@@ -383,9 +380,6 @@ private:
     static void didRunJavaScriptDialogImpl(const InspectorInstrumentationCookie&);
     static void willDestroyCachedResourceImpl(CachedResource&);
 
-    static InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents&, unsigned startLine, Frame*);
-    static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned endLine);
-
     static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr<Inspector::ConsoleMessage>);
 
     static void consoleCountImpl(InstrumentingAgents&, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
@@ -1057,21 +1051,6 @@ inline void InspectorInstrumentation::willDestroyCachedResource(CachedResource&
     willDestroyCachedResourceImpl(cachedResource);
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTML(Document* document, unsigned startLine)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        return willWriteHTMLImpl(*instrumentingAgents, startLine, document->frame());
-    return InspectorInstrumentationCookie();
-}
-
-inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentationCookie& cookie, unsigned endLine)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.isValid())
-        didWriteHTMLImpl(cookie, endLine);
-}
-
 inline void InspectorInstrumentation::didOpenDatabase(ScriptExecutionContext* context, RefPtr<Database>&& database, const String& domain, const String& name, const String& version)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
index 1239e28ae72e9e7ab0e43a6382990c00271c61b2..e2f473e7e94b03ce70a6cbe1e591c2cd6c44382b 100644 (file)
@@ -395,20 +395,6 @@ void InspectorTimelineAgent::didPaint(RenderObject* renderer, const LayoutRect&
     didCompleteCurrentRecord(TimelineRecordType::Paint);
 }
 
-void InspectorTimelineAgent::willWriteHTML(unsigned startLine, Frame* frame)
-{
-    pushCurrentRecord(TimelineRecordFactory::createParseHTMLData(startLine), TimelineRecordType::ParseHTML, true, frame);
-}
-
-void InspectorTimelineAgent::didWriteHTML(unsigned endLine)
-{
-    if (!m_recordStack.isEmpty()) {
-        const TimelineRecordEntry& entry = m_recordStack.last();
-        entry.data->setInteger("endLine", endLine);
-        didCompleteCurrentRecord(TimelineRecordType::ParseHTML);
-    }
-}
-
 void InspectorTimelineAgent::didInstallTimer(int timerId, int timeout, bool singleShot, Frame* frame)
 {
     appendRecord(TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot), TimelineRecordType::TimerInstall, true, frame);
@@ -531,9 +517,6 @@ static Inspector::Protocol::Timeline::EventType toProtocol(TimelineRecordType ty
     case TimelineRecordType::RenderingFrame:
         return Inspector::Protocol::Timeline::EventType::RenderingFrame;
 
-    case TimelineRecordType::ParseHTML:
-        return Inspector::Protocol::Timeline::EventType::ParseHTML;
-
     case TimelineRecordType::TimerInstall:
         return Inspector::Protocol::Timeline::EventType::TimerInstall;
     case TimelineRecordType::TimerRemove:
index d3e47244f8e3e982922742814c413d5f57f23385..01dcc1faaecec02e1857821288aace7796626b30 100644 (file)
@@ -67,8 +67,6 @@ enum class TimelineRecordType {
     Composite,
     RenderingFrame,
 
-    ParseHTML,
-
     TimerInstall,
     TimerRemove,
     TimerFire,
@@ -137,8 +135,6 @@ public:
     void willRecalculateStyle(Frame*);
     void didRecalculateStyle();
     void didScheduleStyleRecalculation(Frame*);
-    void willWriteHTML(unsigned startLine, Frame*);
-    void didWriteHTML(unsigned endLine);
     void didTimeStamp(Frame&, const String&);
     void didRequestAnimationFrame(int callbackId, Frame*);
     void didCancelAnimationFrame(int callbackId, Frame*);
index e883b2860075e70c7a6c672fbe9720dc1095f7a5..09deeec93009555ec36eb9c4d50125a831f2c40e 100644 (file)
@@ -119,13 +119,6 @@ Ref<InspectorObject> TimelineRecordFactory::createTimeStampData(const String& me
     return WTF::move(data);
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createParseHTMLData(unsigned startLine)
-{
-    Ref<InspectorObject> data = InspectorObject::create();
-    data->setInteger(ASCIILiteral("startLine"), startLine);
-    return WTF::move(data);
-}
-
 Ref<InspectorObject> TimelineRecordFactory::createAnimationFrameData(int callbackId)
 {
     Ref<InspectorObject> data = InspectorObject::create();
index 9acae7e36e3773ef68eba1826b3a69e54fde3b00..97e9527ccb228d65ce0e9e5abde59ad2cca66b12 100644 (file)
@@ -61,7 +61,6 @@ public:
     static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, int timeout, bool singleShot);
     static Ref<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber);
     static Ref<Inspector::InspectorObject> createTimeStampData(const String&);
-    static Ref<Inspector::InspectorObject> createParseHTMLData(unsigned startLine);
     static Ref<Inspector::InspectorObject> createAnimationFrameData(int callbackId);
     static Ref<Inspector::InspectorObject> createPaintData(const FloatQuad&);
 
index 7e10157d3ef0ffea884da4fadaeabb6edbc6fe4a..60d61a7b4614030fdc48031af3bd82221f9c227e 100644 (file)
@@ -1,3 +1,13 @@
+2015-11-03  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Handle or Remove ParseHTML Timeline Event Records
+        https://bugs.webkit.org/show_bug.cgi?id=150689
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Controllers/TimelineManager.js:
+        (WebInspector.TimelineManager.prototype._processRecord):
+
 2015-11-02  Andy Estes  <aestes@apple.com>
 
         [Cocoa] Add tvOS and watchOS to SUPPORTED_PLATFORMS
index 582ac68de7980b840814feb9bfd9649c50560d73..938e2eb4a1e4b30143e2ae311e7a16e2bae6ac49 100644 (file)
@@ -313,10 +313,6 @@ WebInspector.TimelineManager = class TimelineManager extends WebInspector.Object
 
             return new WebInspector.RenderingFrameTimelineRecord(startTime, endTime);
 
-        case TimelineAgent.EventType.ParseHTML:
-            // FIXME: <https://webkit.org/b/150689> Web Inspector: Handle or Remove ParseHTML Timeline Event Records
-            return null;
-
         case TimelineAgent.EventType.EvaluateScript:
             if (!sourceCodeLocation) {
                 var mainFrame = WebInspector.frameResourceManager.mainFrame;