Changeset 95404 in webkit


Ignore:
Timestamp:
Sep 19, 2011 12:36:12 AM (13 years ago)
Author:
loislo@chromium.org
Message:

2011-09-18 Ilya Tikhonovsky <loislo@chromium.org>

Web Inspector: requestAnimationFrame callbacks don't show up in the timeline panel.
https://bugs.webkit.org/show_bug.cgi?id=67986

Reviewed by Pavel Feldman.

Test: inspector/timeline/timeline-animation-frame.html

WebCore:

  • English.lproj/localizedStrings.js:
  • bindings/v8/V8Proxy.cpp: (WebCore::V8Proxy::callFunction): (WebCore::V8Proxy::callFunctionWithoutFrame): (WebCore::V8Proxy::instrumentedCallFunction):
  • bindings/v8/V8Proxy.h:
  • bindings/v8/custom/V8CustomVoidCallback.cpp: (WebCore::invokeCallback):
  • dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::registerCallback): (WebCore::ScriptedAnimationController::cancelCallback): (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
  • inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didRegisterAnimationFrameCallbackImpl): (WebCore::InspectorInstrumentation::didCancelAnimationFrameCallbackImpl): (WebCore::InspectorInstrumentation::willFireAnimationFrameEventImpl): (WebCore::InspectorInstrumentation::didFireAnimationFrameEventImpl):
  • inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::willCallFunction): (WebCore::InspectorInstrumentation::didRegisterAnimationFrameCallback): (WebCore::InspectorInstrumentation::didCancelAnimationFrameCallback): (WebCore::InspectorInstrumentation::willFireAnimationFrameEvent): (WebCore::InspectorInstrumentation::didFireAnimationFrameEvent):
  • inspector/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::didRegisterAnimationFrameCallback): (WebCore::InspectorTimelineAgent::didCancelAnimationFrameCallback): (WebCore::InspectorTimelineAgent::willFireAnimationFrameEvent): (WebCore::InspectorTimelineAgent::didFireAnimationFrameEvent):
  • inspector/InspectorTimelineAgent.h:
  • inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createAnimationFrameCallbackData):
  • inspector/TimelineRecordFactory.h:
  • inspector/front-end/TimelineAgent.js:
  • inspector/front-end/TimelinePanel.js: (WebInspector.TimelinePanel): (WebInspector.TimelinePanel.prototype.get _recordStyles): (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline): (WebInspector.TimelinePanel.prototype._clearPanel): (WebInspector.TimelinePanel.FormattedRecord): (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent): (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):

LayoutTests:

  • inspector/timeline/timeline-animation-frame-expected.txt: Added.
  • inspector/timeline/timeline-animation-frame.html: Added.
  • inspector/timeline/timeline-enum-stability-expected.txt:
  • platform/chromium/inspector/timeline/timeline-enum-stability-expected.txt:
  • platform/qt/Skipped: inspector/timeline/timeline-animation-frame.html was added to the skip list.
  • inspector/timeline/timeline-test.js:
Location:
trunk
Files:
3 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95402 r95404  
     12011-09-18  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: requestAnimationFrame callbacks don't show up in the timeline panel.
     4        https://bugs.webkit.org/show_bug.cgi?id=67986
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/timeline/timeline-animation-frame-expected.txt: Added.
     9        * inspector/timeline/timeline-animation-frame.html: Added.
     10        * inspector/timeline/timeline-enum-stability-expected.txt:
     11        * platform/chromium/inspector/timeline/timeline-enum-stability-expected.txt:
     12        * platform/qt/Skipped: inspector/timeline/timeline-animation-frame.html was added to the skip list.
     13        * inspector/timeline/timeline-test.js:
     14
    1152011-09-18  James Kozianski  <koz@chromium.org>
    216
  • trunk/LayoutTests/inspector/timeline/timeline-enum-stability-expected.txt

    r95302 r95404  
    2525    FunctionCall : "FunctionCall"
    2626    GCEvent : "GCEvent"
     27    RegisterAnimationFrameCallback : "RegisterAnimationFrameCallback"
     28    CancelAnimationFrameCallback : "CancelAnimationFrameCallback"
     29    FireAnimationFrameEvent : "FireAnimationFrameEvent"
    2730}
    2831
  • trunk/LayoutTests/inspector/timeline/timeline-test.js

    r95302 r95404  
    33// Scrub values when printing out these properties in the record or data field.
    44InspectorTest.timelineNonDeterministicProps = {
    5     children : 1,
    6     endTime : 1,
    7     height : 1,
    8     requestId : 1,
    9     startTime : 1,
    10     width : 1,
     5    children: 1,
     6    endTime: 1,
     7    height: 1,
     8    requestId: 1,
     9    startTime: 1,
     10    width: 1,
    1111    stackTrace: 1,
    12     url : 1,
     12    url: 1,
    1313    usedHeapSize: 1,
    1414    totalHeapSize: 1,
    15     mimeType : 1
     15    mimeType: 1,
     16    id: 1
    1617};
    1718
  • trunk/LayoutTests/platform/qt/Skipped

    r95374 r95404  
    8787# ENABLE(REQUEST_ANIMATION_FRAME) is disabled.
    8888fast/animation
     89inspector/timeline/timeline-animation-frame.html
    8990
    9091# ENABLE(ANIMATION_API) is disabled.
  • trunk/Source/WebCore/ChangeLog

    r95403 r95404  
     12011-09-18  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: requestAnimationFrame callbacks don't show up in the timeline panel.
     4        https://bugs.webkit.org/show_bug.cgi?id=67986
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Test: inspector/timeline/timeline-animation-frame.html
     9
     10        * English.lproj/localizedStrings.js:
     11        * bindings/v8/V8Proxy.cpp:
     12        (WebCore::V8Proxy::callFunction):
     13        (WebCore::V8Proxy::callFunctionWithoutFrame):
     14        (WebCore::V8Proxy::instrumentedCallFunction):
     15        * bindings/v8/V8Proxy.h:
     16        * bindings/v8/custom/V8CustomVoidCallback.cpp:
     17        (WebCore::invokeCallback):
     18        * dom/ScriptedAnimationController.cpp:
     19        (WebCore::ScriptedAnimationController::registerCallback):
     20        (WebCore::ScriptedAnimationController::cancelCallback):
     21        (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
     22        * inspector/InspectorInstrumentation.cpp:
     23        (WebCore::InspectorInstrumentation::didRegisterAnimationFrameCallbackImpl):
     24        (WebCore::InspectorInstrumentation::didCancelAnimationFrameCallbackImpl):
     25        (WebCore::InspectorInstrumentation::willFireAnimationFrameEventImpl):
     26        (WebCore::InspectorInstrumentation::didFireAnimationFrameEventImpl):
     27        * inspector/InspectorInstrumentation.h:
     28        (WebCore::InspectorInstrumentation::willCallFunction):
     29        (WebCore::InspectorInstrumentation::didRegisterAnimationFrameCallback):
     30        (WebCore::InspectorInstrumentation::didCancelAnimationFrameCallback):
     31        (WebCore::InspectorInstrumentation::willFireAnimationFrameEvent):
     32        (WebCore::InspectorInstrumentation::didFireAnimationFrameEvent):
     33        * inspector/InspectorTimelineAgent.cpp:
     34        (WebCore::InspectorTimelineAgent::didRegisterAnimationFrameCallback):
     35        (WebCore::InspectorTimelineAgent::didCancelAnimationFrameCallback):
     36        (WebCore::InspectorTimelineAgent::willFireAnimationFrameEvent):
     37        (WebCore::InspectorTimelineAgent::didFireAnimationFrameEvent):
     38        * inspector/InspectorTimelineAgent.h:
     39        * inspector/TimelineRecordFactory.cpp:
     40        (WebCore::TimelineRecordFactory::createAnimationFrameCallbackData):
     41        * inspector/TimelineRecordFactory.h:
     42        * inspector/front-end/TimelineAgent.js:
     43        * inspector/front-end/TimelinePanel.js:
     44        (WebInspector.TimelinePanel):
     45        (WebInspector.TimelinePanel.prototype.get _recordStyles):
     46        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
     47        (WebInspector.TimelinePanel.prototype._clearPanel):
     48        (WebInspector.TimelinePanel.FormattedRecord):
     49        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
     50        (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
     51
    1522011-09-19  Carlos Garcia Campos  <cgarcia@igalia.com>
    253
  • trunk/Source/WebCore/bindings/v8/V8Proxy.cpp

    r95302 r95404  
    478478        }
    479479
    480         InspectorInstrumentationCookie cookie;
    481         if (InspectorInstrumentation::hasFrontends()) {
    482             v8::ScriptOrigin origin = function->GetScriptOrigin();
    483             String resourceName("undefined");
    484             int lineNumber = 1;
    485             if (!origin.ResourceName().IsEmpty()) {
    486                 resourceName = toWebCoreString(origin.ResourceName());
    487                 lineNumber = function->GetScriptLineNumber() + 1;
    488             }
    489             cookie = InspectorInstrumentation::willCallFunction(m_frame, resourceName, lineNumber);
    490         }
    491 
    492480        m_recursion++;
    493         result = function->Call(receiver, argc, args);
     481        result = V8Proxy::instrumentedCallFunction(m_frame->page(), function, receiver, argc, args);
    494482        m_recursion--;
    495 
    496         InspectorInstrumentation::didCallFunction(cookie);
    497483    }
    498484
     
    514500        handleFatalErrorInV8();
    515501
     502    return result;
     503}
     504
     505v8::Local<v8::Value> V8Proxy::instrumentedCallFunction(Page* page, v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[])
     506{
     507    InspectorInstrumentationCookie cookie;
     508    if (InspectorInstrumentation::hasFrontends()) {
     509        String resourceName("undefined");
     510        int lineNumber = 1;
     511        v8::ScriptOrigin origin = function->GetScriptOrigin();
     512        if (!origin.ResourceName().IsEmpty()) {
     513            resourceName = toWebCoreString(origin.ResourceName());
     514            lineNumber = function->GetScriptLineNumber() + 1;
     515        }
     516        cookie = InspectorInstrumentation::willCallFunction(page, resourceName, lineNumber);
     517    }
     518    v8::Local<v8::Value> result = function->Call(receiver, argc, args);
     519    InspectorInstrumentation::didCallFunction(cookie);
    516520    return result;
    517521}
  • trunk/Source/WebCore/bindings/v8/V8Proxy.h

    r95302 r95404  
    5858    class Frame;
    5959    class Node;
     60    class Page;
    6061    class ScriptExecutionContext;
    6162    class ScriptSourceCode;
     
    174175        static v8::Local<v8::Value> callFunctionWithoutFrame(v8::Handle<v8::Function>, v8::Handle<v8::Object>, int argc, v8::Handle<v8::Value> argv[]);
    175176
     177        // call the function with the given receiver and arguments and report times to DevTools.
     178        static v8::Local<v8::Value> instrumentedCallFunction(Page*, v8::Handle<v8::Function>, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[]);
     179
    176180        // Call the function as constructor with the given arguments.
    177181        v8::Local<v8::Value> newInstance(v8::Handle<v8::Function>, int argc, v8::Handle<v8::Value> argv[]);
  • trunk/Source/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp

    r95302 r95404  
    8484    v8::Handle<v8::Object> thisObject = v8::Context::GetCurrent()->Global();
    8585
    86     v8::Handle<v8::Value> result = callbackFunction->Call(thisObject, argc, argv);
     86    Page* page = scriptExecutionContext && scriptExecutionContext->isDocument() ? static_cast<Document*>(scriptExecutionContext)->page() : 0;
     87    v8::Handle<v8::Value> result = V8Proxy::instrumentedCallFunction(page, callbackFunction, thisObject, argc, argv);
     88
    8789    callbackReturnValue = !result.IsEmpty() && result->BooleanValue();
    8890    return exceptionCatcher.HasCaught();
  • trunk/Source/WebCore/dom/ScriptedAnimationController.cpp

    r95302 r95404  
    3232#include "Element.h"
    3333#include "FrameView.h"
     34#include "InspectorInstrumentation.h"
    3435#include "RequestAnimationFrameCallback.h"
    3536
     
    7677    callback->m_element = animationElement;
    7778    m_callbacks.append(callback);
     79
     80    InspectorInstrumentation::didRegisterAnimationFrameCallback(m_document, id);
     81
    7882    if (!m_suspendCount)
    7983        scheduleAnimation();
     
    8690        if (m_callbacks[i]->m_id == id) {
    8791            m_callbacks[i]->m_firedOrCancelled = true;
     92            InspectorInstrumentation::didCancelAnimationFrameCallback(m_document, id);
    8893            m_callbacks.remove(i);
    8994            return;
     
    120125            if (!callback->m_firedOrCancelled && (!callback->m_element || callback->m_element->renderer())) {
    121126                callback->m_firedOrCancelled = true;
     127                InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrameEvent(m_document, callback->m_id);
    122128                callback->handleEvent(time);
     129                InspectorInstrumentation::didFireAnimationFrameEvent(cookie);
    123130                firedCallback = true;
    124131                callbacks.remove(i);
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r95302 r95404  
    866866}
    867867
     868void InspectorInstrumentation::didRegisterAnimationFrameCallbackImpl(InstrumentingAgents* instrumentingAgents, int callbackId)
     869{
     870    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent())
     871        timelineAgent->didRegisterAnimationFrameCallback(callbackId);
     872}
     873
     874void InspectorInstrumentation::didCancelAnimationFrameCallbackImpl(InstrumentingAgents* instrumentingAgents, int callbackId)
     875{
     876    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent())
     877        timelineAgent->didCancelAnimationFrameCallback(callbackId);
     878}
     879
     880InspectorInstrumentationCookie InspectorInstrumentation::willFireAnimationFrameEventImpl(InstrumentingAgents* instrumentingAgents, int callbackId)
     881{
     882    int timelineAgentId = 0;
     883    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) {
     884        timelineAgent->willFireAnimationFrameEvent(callbackId);
     885        timelineAgentId = timelineAgent->id();
     886    }
     887    return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
     888}
     889
     890void InspectorInstrumentation::didFireAnimationFrameEventImpl(const InspectorInstrumentationCookie& cookie)
     891{
     892    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
     893        timelineAgent->didFireAnimationFrameEvent();
     894}
     895
    868896InspectorTimelineAgent* InspectorInstrumentation::retrieveTimelineAgent(const InspectorInstrumentationCookie& cookie)
    869897{
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r95302 r95404  
    9696    static void didRemoveTimer(ScriptExecutionContext*, int timerId);
    9797
    98     static InspectorInstrumentationCookie willCallFunction(Frame*, const String& scriptName, int scriptLine);
     98    static InspectorInstrumentationCookie willCallFunction(Page*, const String& scriptName, int scriptLine);
    9999    static void didCallFunction(const InspectorInstrumentationCookie&);
    100100    static InspectorInstrumentationCookie willChangeXHRReadyState(ScriptExecutionContext*, XMLHttpRequest* request);
     
    154154    static void stopConsoleTiming(Page*, const String& title, PassRefPtr<ScriptCallStack>);
    155155    static void consoleTimeStamp(Page*, PassRefPtr<ScriptArguments>);
     156
     157    static void didRegisterAnimationFrameCallback(Document*, int callbackId);
     158    static void didCancelAnimationFrameCallback(Document*, int callbackId);
     159    static InspectorInstrumentationCookie willFireAnimationFrameEvent(Document*, int callbackId);
     160    static void didFireAnimationFrameEvent(const InspectorInstrumentationCookie&);
    156161
    157162#if ENABLE(JAVASCRIPT_DEBUGGER)
     
    284289    static void consoleTimeStampImpl(InstrumentingAgents*, PassRefPtr<ScriptArguments>);
    285290
     291    static void didRegisterAnimationFrameCallbackImpl(InstrumentingAgents*, int callbackId);
     292    static void didCancelAnimationFrameCallbackImpl(InstrumentingAgents*, int callbackId);
     293    static InspectorInstrumentationCookie willFireAnimationFrameEventImpl(InstrumentingAgents*, int callbackId);
     294    static void didFireAnimationFrameEventImpl(const InspectorInstrumentationCookie&);
     295
    286296#if ENABLE(JAVASCRIPT_DEBUGGER)
    287297    static void addStartProfilingMessageToConsoleImpl(InstrumentingAgents*, const String& title, unsigned lineNumber, const String& sourceURL);
     
    486496}
    487497
    488 
    489 inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(Frame* frame, const String& scriptName, int scriptLine)
     498inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(Page* page, const String& scriptName, int scriptLine)
    490499{
    491500#if ENABLE(INSPECTOR)
    492501    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
    493     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
     502    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    494503        return willCallFunctionImpl(instrumentingAgents, scriptName, scriptLine);
    495504#endif
     
    10261035#endif
    10271036
     1037inline void InspectorInstrumentation::didRegisterAnimationFrameCallback(Document* document, int callbackId)
     1038{
     1039#if ENABLE(INSPECTOR)
     1040    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
     1041        didRegisterAnimationFrameCallbackImpl(instrumentingAgents, callbackId);
     1042#endif
     1043}
     1044
     1045inline void InspectorInstrumentation::didCancelAnimationFrameCallback(Document* document, int callbackId)
     1046{
     1047#if ENABLE(INSPECTOR)
     1048    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
     1049        didCancelAnimationFrameCallbackImpl(instrumentingAgents, callbackId);
     1050#endif
     1051}
     1052
     1053inline InspectorInstrumentationCookie InspectorInstrumentation::willFireAnimationFrameEvent(Document* document, int callbackId)
     1054{
     1055#if ENABLE(INSPECTOR)
     1056    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
     1057        return willFireAnimationFrameEventImpl(instrumentingAgents, callbackId);
     1058#endif
     1059    return InspectorInstrumentationCookie();
     1060}
     1061
     1062inline void InspectorInstrumentation::didFireAnimationFrameEvent(const InspectorInstrumentationCookie& cookie)
     1063{
     1064#if ENABLE(INSPECTOR)
     1065    FAST_RETURN_IF_NO_FRONTENDS(void());
     1066    if (cookie.first)
     1067        didFireAnimationFrameEventImpl(cookie);
     1068#endif
     1069}
     1070
    10281071#if ENABLE(INSPECTOR)
    10291072inline bool InspectorInstrumentation::collectingHTMLParseErrors(Page* page)
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r95302 r95404  
    5353}
    5454
     55// Must be kept in sync with TimelineAgent.js
    5556namespace TimelineRecordType {
    5657static const char EventDispatch[] = "EventDispatch";
     
    8283static const char FunctionCall[] = "FunctionCall";
    8384static const char GCEvent[] = "GCEvent";
     85
     86static const char RegisterAnimationFrameCallback[] = "RegisterAnimationFrameCallback";
     87static const char CancelAnimationFrameCallback[] = "CancelAnimationFrameCallback";
     88static const char FireAnimationFrameEvent[] = "FireAnimationFrameEvent";
    8489}
    8590
     
    343348{
    344349    clearRecordStack();
     350}
     351
     352void InspectorTimelineAgent::didRegisterAnimationFrameCallback(int callbackId)
     353{
     354    appendRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::RegisterAnimationFrameCallback);
     355}
     356
     357void InspectorTimelineAgent::didCancelAnimationFrameCallback(int callbackId)
     358{
     359    appendRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::CancelAnimationFrameCallback);
     360}
     361
     362void InspectorTimelineAgent::willFireAnimationFrameEvent(int callbackId)
     363{
     364    pushCurrentRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::FireAnimationFrameEvent);
     365}
     366
     367void InspectorTimelineAgent::didFireAnimationFrameEvent()
     368{
     369    didCompleteCurrentRecord(TimelineRecordType::FireAnimationFrameEvent);
    345370}
    346371
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r95302 r95404  
    120120    void willReceiveResourceData(unsigned long identifier);
    121121    void didReceiveResourceData();
    122        
     122
     123    void didRegisterAnimationFrameCallback(int callbackId);
     124    void didCancelAnimationFrameCallback(int callbackId);
     125    void willFireAnimationFrameEvent(int callbackId);
     126    void didFireAnimationFrameEvent();
     127
    123128    virtual void didGC(double, double, size_t);
    124129
  • trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp

    r95302 r95404  
    183183}
    184184
     185PassRefPtr<InspectorObject> TimelineRecordFactory::createAnimationFrameCallbackData(int callbackId)
     186{
     187    RefPtr<InspectorObject> data = InspectorObject::create();
     188    data->setNumber("id", callbackId);
     189    return data.release();
     190}
     191
    185192} // namespace WebCore
    186193
  • trunk/Source/WebCore/inspector/TimelineRecordFactory.h

    r95302 r95404  
    8080        static PassRefPtr<InspectorObject> createParseHTMLData(unsigned int length, unsigned int startLine);
    8181
     82        static PassRefPtr<InspectorObject> createAnimationFrameCallbackData(int callbackId);
     83
    8284    private:
    8385        TimelineRecordFactory() { }
  • trunk/Source/WebCore/inspector/front-end/TimelineAgent.js

    r95302 r95404  
    6262
    6363    FunctionCall: "FunctionCall",
    64     GCEvent: "GCEvent"
     64    GCEvent: "GCEvent",
     65
     66    RegisterAnimationFrameCallback: "RegisterAnimationFrameCallback",
     67    CancelAnimationFrameCallback: "CancelAnimationFrameCallback",
     68    FireAnimationFrameEvent: "FireAnimationFrameEvent"
    6569};
  • trunk/Source/WebCore/inspector/front-end/TimelinePanel.js

    r95401 r95404  
    8383    this._scheduledResourceRequests = {};
    8484    this._timerRecords = {};
     85    this._registeredAnimationCallbackRecords = {};
    8586
    8687    this._calculator = new WebInspector.TimelineCalculator();
     
    202203            recordStyles[recordTypes.MarkLoad] = { title: WebInspector.UIString("Load event"), category: this.categories.scripting };
    203204            recordStyles[recordTypes.ScheduleResourceRequest] = { title: WebInspector.UIString("Schedule Request"), category: this.categories.loading };
     205            recordStyles[recordTypes.RegisterAnimationFrameCallback] = { title: WebInspector.UIString("Register Animation Callback"), category: this.categories.scripting };
     206            recordStyles[recordTypes.CancelAnimationFrameCallback] = { title: WebInspector.UIString("Cancel Animation Callback"), category: this.categories.scripting };
     207            recordStyles[recordTypes.FireAnimationFrameEvent] = { title: WebInspector.UIString("Animation Frame Event"), category: this.categories.scripting };
    204208            this._recordStylesArray = recordStyles;
    205209        }
     
    405409        var connectedToOldRecord = false;
    406410        var recordTypes = WebInspector.TimelineAgent.RecordType;
     411
     412        if (record.type === recordTypes.RegisterAnimationFrameCallback) {
     413            this._registeredAnimationCallbackRecords[record.data.id] = record;
     414            return;
     415        }
     416
    407417        if (record.type === recordTypes.MarkDOMContent || record.type === recordTypes.MarkLoad)
    408418            parentRecord = null; // No bar entry for load events.
     
    426436            }
    427437        };
    428         if (record.type === recordTypes.TimerFire && children && children.length) {
     438
     439        if ((record.type === recordTypes.TimerFire || record.type === recordTypes.FireAnimationFrameEvent) && children && children.length) {
    429440            var childRecord = children[0];
    430441            if (childRecord.type === recordTypes.FunctionCall) {
     
    509520        this._scheduledResourceRequests = {};
    510521        this._timerRecords = {};
     522        this._registeredAnimationCallbackRecords = {};
    511523        this._rootRecord = this._createRootRecord();
    512524        this._boundariesAreValid = false;
     
    10011013            this.singleShot = timerInstalledRecord.singleShot;
    10021014        }
     1015    } else if (record.type === recordTypes.FireAnimationFrameEvent) {
     1016        var registerCallbackRecord = panel._registeredAnimationCallbackRecords[record.data.id];
     1017        if (registerCallbackRecord)
     1018            this.callSiteStackTrace = registerCallbackRecord.stackTrace;
    10031019    }
    10041020    this._refreshDetails();
     
    10591075                    contentHelper._appendTextRow(WebInspector.UIString("Repeats"), !this.singleShot);
    10601076                }
     1077                break;
     1078            case recordTypes.FireAnimationFrameEvent:
     1079                contentHelper._appendTextRow(WebInspector.UIString("Callback ID"), this.data.id);
    10611080                break;
    10621081            case recordTypes.FunctionCall:
     
    11201139            case WebInspector.TimelineAgent.RecordType.FunctionCall:
    11211140                return this.scriptName ? this._linkifyLocation(this.scriptName, this.scriptLine, 0) : null;
     1141            case WebInspector.TimelineAgent.RecordType.FireAnimationFrameEvent:
     1142                return this.scriptName ? this._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data.id;
    11221143            case WebInspector.TimelineAgent.RecordType.EventDispatch:
    11231144                return this.data ? this.data.type : null;
     
    11271148            case WebInspector.TimelineAgent.RecordType.TimerRemove:
    11281149                return this.stackTrace ? this._linkifyCallFrame(this.stackTrace[0]) : this.data.timerId;
     1150            case WebInspector.TimelineAgent.RecordType.RegisterAnimationFrameCallback:
     1151            case WebInspector.TimelineAgent.RecordType.CancelAnimationFrameCallback:
     1152                return this.stackTrace ? this._linkifyCallFrame(this.stackTrace[0]) : this.data.id;
    11291153            case WebInspector.TimelineAgent.RecordType.ParseHTML:
    11301154            case WebInspector.TimelineAgent.RecordType.RecalculateStyles:
Note: See TracChangeset for help on using the changeset viewer.