Changeset 69406 in webkit


Ignore:
Timestamp:
Oct 8, 2010 9:39:57 AM (14 years ago)
Author:
podivilov@chromium.org
Message:

2010-10-08 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: save InspectorController in instrumentation cookie
https://bugs.webkit.org/show_bug.cgi?id=47406

  • bindings/v8/V8Proxy.cpp: (WebCore::V8Proxy::evaluate): (WebCore::V8Proxy::callFunction):
  • dom/Document.cpp: (WebCore::Document::recalcStyle):
  • dom/Node.cpp: (WebCore::Node::dispatchGenericEvent):
  • html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::pumpTokenizer):
  • inspector/InspectorInstrumentation.cpp:
  • inspector/InspectorInstrumentation.h:
  • loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didReceiveResponse): (WebCore::ResourceLoader::didReceiveData):
  • page/DOMTimer.cpp: (WebCore::DOMTimer::fired):
  • page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchEvent):
  • page/FrameView.cpp: (WebCore::FrameView::layout): (WebCore::FrameView::paintContents):
  • rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintContents):
  • xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::callReadyStateChangeListener):
Location:
trunk/WebCore
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r69404 r69406  
     12010-10-08  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: save InspectorController in instrumentation cookie
     6        https://bugs.webkit.org/show_bug.cgi?id=47406
     7
     8        * bindings/v8/V8Proxy.cpp:
     9        (WebCore::V8Proxy::evaluate):
     10        (WebCore::V8Proxy::callFunction):
     11        * dom/Document.cpp:
     12        (WebCore::Document::recalcStyle):
     13        * dom/Node.cpp:
     14        (WebCore::Node::dispatchGenericEvent):
     15        * html/parser/HTMLDocumentParser.cpp:
     16        (WebCore::HTMLDocumentParser::pumpTokenizer):
     17        * inspector/InspectorInstrumentation.cpp:
     18        * inspector/InspectorInstrumentation.h:
     19        * loader/ResourceLoader.cpp:
     20        (WebCore::ResourceLoader::didReceiveResponse):
     21        (WebCore::ResourceLoader::didReceiveData):
     22        * page/DOMTimer.cpp:
     23        (WebCore::DOMTimer::fired):
     24        * page/DOMWindow.cpp:
     25        (WebCore::DOMWindow::dispatchEvent):
     26        * page/FrameView.cpp:
     27        (WebCore::FrameView::layout):
     28        (WebCore::FrameView::paintContents):
     29        * rendering/RenderLayerBacking.cpp:
     30        (WebCore::RenderLayerBacking::paintContents):
     31        * xml/XMLHttpRequest.cpp:
     32        (WebCore::XMLHttpRequest::callReadyStateChangeListener):
     33
    1342010-10-08  Adam Roben  <aroben@apple.com>
    235
  • trunk/WebCore/bindings/js/ScriptController.cpp

    r69283 r69406  
    149149    exec->globalData().timeoutChecker.stop();
    150150
    151     InspectorInstrumentation::didEvaluateScript(m_frame, cookie);
     151    InspectorInstrumentation::didEvaluateScript(cookie);
    152152
    153153    // Evaluating the JavaScript could cause the frame to be deallocated
  • trunk/WebCore/bindings/v8/V8Proxy.cpp

    r69283 r69406  
    412412#endif
    413413
    414     InspectorInstrumentation::didEvaluateScript(m_frame, cookie);
     414    InspectorInstrumentation::didEvaluateScript(cookie);
    415415
    416416    return result;
     
    500500        m_frame->keepAlive();
    501501
    502         InspectorInstrumentationCookie cookie = 0;
     502        InspectorInstrumentationCookie cookie;
    503503        if (InspectorInstrumentation::hasFrontends()) {
    504504            v8::ScriptOrigin origin = function->GetScriptOrigin();
     
    516516        m_recursion--;
    517517
    518         InspectorInstrumentation::didCallFunction(m_frame, cookie);
     518        InspectorInstrumentation::didCallFunction(cookie);
    519519    }
    520520
  • trunk/WebCore/dom/Document.cpp

    r69286 r69406  
    15161516    }
    15171517
    1518     InspectorInstrumentation::didRecalculateStyle(this, cookie);
     1518    InspectorInstrumentation::didRecalculateStyle(cookie);
    15191519}
    15201520
  • trunk/WebCore/dom/Node.cpp

    r69283 r69406  
    26862686doneWithDefault:
    26872687
    2688     InspectorInstrumentation::didDispatchEvent(document(), cookie);
     2688    InspectorInstrumentation::didDispatchEvent(cookie);
    26892689
    26902690    return !event->defaultPrevented();
  • trunk/WebCore/html/parser/HTMLDocumentParser.cpp

    r69283 r69406  
    257257    }
    258258
    259     InspectorInstrumentation::didWriteHTML(document(), m_tokenizer->lineNumber(), cookie);
     259    InspectorInstrumentation::didWriteHTML(cookie, m_tokenizer->lineNumber());
    260260}
    261261
  • trunk/WebCore/inspector/InspectorInstrumentation.cpp

    r69300 r69406  
    173173InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InspectorController* inspectorController, const String& scriptName, int scriptLine)
    174174{
    175     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     175    int timelineAgentId = 0;
     176    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     177    if (timelineAgent) {
    176178        timelineAgent->willCallFunction(scriptName, scriptLine);
    177         return timelineAgent->id();
    178     }
    179     return 0;
    180 }
    181 
    182 void InspectorInstrumentation::didCallFunctionImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    183 {
    184     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     179        timelineAgentId = timelineAgent->id();
     180    }
     181    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     182}
     183
     184void InspectorInstrumentation::didCallFunctionImpl(const InspectorInstrumentationCookie& cookie)
     185{
     186    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    185187        timelineAgent->didCallFunction();
    186188}
     
    188190InspectorInstrumentationCookie InspectorInstrumentation::willChangeXHRReadyStateImpl(InspectorController* inspectorController, XMLHttpRequest* request)
    189191{
     192    int timelineAgentId = 0;
    190193    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
    191194    if (timelineAgent && request->hasEventListeners(eventNames().readystatechangeEvent)) {
    192195        timelineAgent->willChangeXHRReadyState(request->url().string(), request->readyState());
    193         return timelineAgent->id();
    194     }
    195     return 0;
    196 }
    197 
    198 void InspectorInstrumentation::didChangeXHRReadyStateImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    199 {
    200     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     196        timelineAgentId = timelineAgent->id();
     197    }
     198    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     199}
     200
     201void InspectorInstrumentation::didChangeXHRReadyStateImpl(const InspectorInstrumentationCookie& cookie)
     202{
     203    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    201204        timelineAgent->didChangeXHRReadyState();
    202205}
     
    217220#endif
    218221
     222    int timelineAgentId = 0;
    219223    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
    220224    if (timelineAgent && eventHasListeners(event.type(), window, node, ancestors)) {
    221225        timelineAgent->willDispatchEvent(event);
    222         return timelineAgent->id();
    223     }
    224     return 0;
    225 }
    226 
    227 void InspectorInstrumentation::didDispatchEventImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    228 {
    229 #if ENABLE(JAVASCRIPT_DEBUGGER)
    230     if (InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get())
     226        timelineAgentId = timelineAgent->id();
     227    }
     228    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     229}
     230
     231void InspectorInstrumentation::didDispatchEventImpl(const InspectorInstrumentationCookie& cookie)
     232{
     233#if ENABLE(JAVASCRIPT_DEBUGGER)
     234    if (InspectorDebuggerAgent* debuggerAgent = cookie.first->m_debuggerAgent.get())
    231235        debuggerAgent->cancelPauseOnNextStatement();
    232236#endif
    233237
    234     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     238    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    235239        timelineAgent->didDispatchEvent();
    236240}
     
    238242InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWindowImpl(InspectorController* inspectorController, const Event& event, DOMWindow* window)
    239243{
     244    int timelineAgentId = 0;
    240245    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
    241246    if (timelineAgent && window->hasEventListeners(event.type())) {
    242247        timelineAgent->willDispatchEvent(event);
    243         return timelineAgent->id();
    244     }
    245     return 0;
    246 }
    247 
    248 void InspectorInstrumentation::didDispatchEventOnWindowImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    249 {
    250     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     248        timelineAgentId = timelineAgent->id();
     249    }
     250    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     251}
     252
     253void InspectorInstrumentation::didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie& cookie)
     254{
     255    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    251256        timelineAgent->didDispatchEvent();
    252257}
     
    254259InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InspectorController* inspectorController, const String& url, int lineNumber)
    255260{
    256     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     261    int timelineAgentId = 0;
     262    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     263    if (timelineAgent) {
    257264        timelineAgent->willEvaluateScript(url, lineNumber);
    258         return timelineAgent->id();
    259     }
    260     return 0;
    261 }
    262 
    263 void InspectorInstrumentation::didEvaluateScriptImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    264 {
    265     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     265        timelineAgentId = timelineAgent->id();
     266    }
     267    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     268}
     269
     270void InspectorInstrumentation::didEvaluateScriptImpl(const InspectorInstrumentationCookie& cookie)
     271{
     272    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    266273        timelineAgent->didEvaluateScript();
    267274}
     
    269276InspectorInstrumentationCookie InspectorInstrumentation::willFireTimerImpl(InspectorController* inspectorController, int timerId)
    270277{
    271     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     278    int timelineAgentId = 0;
     279    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     280    if (timelineAgent) {
    272281        timelineAgent->willFireTimer(timerId);
    273         return timelineAgent->id();
    274     }
    275     return 0;
    276 }
    277 
    278 void InspectorInstrumentation::didFireTimerImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    279 {
    280     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     282        timelineAgentId = timelineAgent->id();
     283    }
     284    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     285}
     286
     287void InspectorInstrumentation::didFireTimerImpl(const InspectorInstrumentationCookie& cookie)
     288{
     289    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    281290        timelineAgent->didFireTimer();
    282291}
     
    284293InspectorInstrumentationCookie InspectorInstrumentation::willLayoutImpl(InspectorController* inspectorController)
    285294{
    286     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     295    int timelineAgentId = 0;
     296    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     297    if (timelineAgent) {
    287298        timelineAgent->willLayout();
    288         return timelineAgent->id();
    289     }
    290     return 0;
    291 }
    292 
    293 void InspectorInstrumentation::didLayoutImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    294 {
    295     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     299        timelineAgentId = timelineAgent->id();
     300    }
     301    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     302}
     303
     304void InspectorInstrumentation::didLayoutImpl(const InspectorInstrumentationCookie& cookie)
     305{
     306    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    296307        timelineAgent->didLayout();
    297308}
     
    299310InspectorInstrumentationCookie InspectorInstrumentation::willLoadXHRImpl(InspectorController* inspectorController, XMLHttpRequest* request)
    300311{
     312    int timelineAgentId = 0;
    301313    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
    302314    if (timelineAgent && request->hasEventListeners(eventNames().loadEvent)) {
    303         timelineAgent->willLoadXHR(request->url().string());
    304         return timelineAgent->id();
    305     }
    306     return 0;
    307 }
    308 
    309 void InspectorInstrumentation::didLoadXHRImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    310 {
    311     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     315        timelineAgent->willLoadXHR(request->url());
     316        timelineAgentId = timelineAgent->id();
     317    }
     318    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     319}
     320
     321void InspectorInstrumentation::didLoadXHRImpl(const InspectorInstrumentationCookie& cookie)
     322{
     323    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    312324        timelineAgent->didLoadXHR();
    313325}
     
    315327InspectorInstrumentationCookie InspectorInstrumentation::willPaintImpl(InspectorController* inspectorController, const IntRect& rect)
    316328{
    317     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     329    int timelineAgentId = 0;
     330    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     331    if (timelineAgent) {
    318332        timelineAgent->willPaint(rect);
    319         return timelineAgent->id();
    320     }
    321     return 0;
    322 }
    323 
    324 void InspectorInstrumentation::didPaintImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    325 {
    326     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     333        timelineAgentId = timelineAgent->id();
     334    }
     335    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     336}
     337
     338void InspectorInstrumentation::didPaintImpl(const InspectorInstrumentationCookie& cookie)
     339{
     340    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    327341        timelineAgent->didPaint();
    328342}
     
    330344InspectorInstrumentationCookie InspectorInstrumentation::willRecalculateStyleImpl(InspectorController* inspectorController)
    331345{
    332     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     346    int timelineAgentId = 0;
     347    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     348    if (timelineAgent) {
    333349        timelineAgent->willRecalculateStyle();
    334         return timelineAgent->id();
    335     }
    336     return 0;
    337 }
    338 
    339 void InspectorInstrumentation::didRecalculateStyleImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    340 {
    341     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     350        timelineAgentId = timelineAgent->id();
     351    }
     352    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     353}
     354
     355void InspectorInstrumentation::didRecalculateStyleImpl(const InspectorInstrumentationCookie& cookie)
     356{
     357    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    342358        timelineAgent->didRecalculateStyle();
    343359}
     
    345361InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceDataImpl(InspectorController* inspectorController, unsigned long identifier)
    346362{
    347     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     363    int timelineAgentId = 0;
     364    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     365    if (timelineAgent) {
    348366        timelineAgent->willReceiveResourceData(identifier);
    349         return timelineAgent->id();
    350     }
    351     return 0;
    352 }
    353 
    354 void InspectorInstrumentation::didReceiveResourceDataImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    355 {
    356     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     367        timelineAgentId = timelineAgent->id();
     368    }
     369    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     370}
     371
     372void InspectorInstrumentation::didReceiveResourceDataImpl(const InspectorInstrumentationCookie& cookie)
     373{
     374    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    357375        timelineAgent->didReceiveResourceData();
    358376}
     
    360378InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponseImpl(InspectorController* inspectorController, unsigned long identifier, const ResourceResponse& response)
    361379{
    362     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     380    int timelineAgentId = 0;
     381    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     382    if (timelineAgent) {
    363383        timelineAgent->willReceiveResourceResponse(identifier, response);
    364         return timelineAgent->id();
    365     }
    366     return 0;
    367 }
    368 
    369 void InspectorInstrumentation::didReceiveResourceResponseImpl(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    370 {
    371     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     384        timelineAgentId = timelineAgent->id();
     385    }
     386    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     387}
     388
     389void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorInstrumentationCookie& cookie)
     390{
     391    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    372392        timelineAgent->didReceiveResourceResponse();
    373393}
     
    375395InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTMLImpl(InspectorController* inspectorController, unsigned int length, unsigned int startLine)
    376396{
    377     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
     397    int timelineAgentId = 0;
     398    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     399    if (timelineAgent) {
    378400        timelineAgent->willWriteHTML(length, startLine);
    379         return timelineAgent->id();
    380     }
    381     return 0;
    382 }
    383 
    384 void InspectorInstrumentation::didWriteHTMLImpl(InspectorController* inspectorController, unsigned int endLine, InspectorInstrumentationCookie cookie)
    385 {
    386     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController, cookie))
     401        timelineAgentId = timelineAgent->id();
     402    }
     403    return InspectorInstrumentationCookie(inspectorController, timelineAgentId);
     404}
     405
     406void InspectorInstrumentation::didWriteHTMLImpl(const InspectorInstrumentationCookie& cookie, unsigned int endLine)
     407{
     408    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
    387409        timelineAgent->didWriteHTML(endLine);
    388410}
    389411
    390 
    391412bool InspectorInstrumentation::hasFrontend(InspectorController* inspectorController)
    392413{
     
    399420}
    400421
    401 InspectorTimelineAgent* InspectorInstrumentation::retrieveTimelineAgent(InspectorController* inspectorController, InspectorInstrumentationCookie cookie)
    402 {
    403     InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
    404     if (timelineAgent && timelineAgent->id() == cookie)
     422InspectorTimelineAgent* InspectorInstrumentation::retrieveTimelineAgent(const InspectorInstrumentationCookie& cookie)
     423{
     424    InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie.first);
     425    if (timelineAgent && timelineAgent->id() == cookie.second)
    405426        return timelineAgent;
    406427    return 0;
  • trunk/WebCore/inspector/InspectorInstrumentation.h

    r69283 r69406  
    4848class XMLHttpRequest;
    4949
    50 typedef int InspectorInstrumentationCookie;
     50typedef pair<InspectorController*, int> InspectorInstrumentationCookie;
    5151
    5252class InspectorInstrumentation {
     
    6565
    6666    static InspectorInstrumentationCookie willCallFunction(Frame*, const String& scriptName, int scriptLine);
    67     static void didCallFunction(Frame*, InspectorInstrumentationCookie cookie);
     67    static void didCallFunction(const InspectorInstrumentationCookie&);
    6868    static InspectorInstrumentationCookie willChangeXHRReadyState(ScriptExecutionContext*, XMLHttpRequest* request);
    69     static void didChangeXHRReadyState(ScriptExecutionContext*, InspectorInstrumentationCookie cookie);
     69    static void didChangeXHRReadyState(const InspectorInstrumentationCookie&);
    7070    static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event& event, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors);
    71     static void didDispatchEvent(Document*, InspectorInstrumentationCookie cookie);
     71    static void didDispatchEvent(const InspectorInstrumentationCookie&);
    7272    static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event& event, DOMWindow* window);
    73     static void didDispatchEventOnWindow(Frame*, InspectorInstrumentationCookie cookie);
     73    static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&);
    7474    static InspectorInstrumentationCookie willEvaluateScript(Frame*, const String& url, int lineNumber);
    75     static void didEvaluateScript(Frame*, InspectorInstrumentationCookie cookie);
     75    static void didEvaluateScript(const InspectorInstrumentationCookie&);
    7676    static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext*, int timerId);
    77     static void didFireTimer(ScriptExecutionContext*, InspectorInstrumentationCookie cookie);
     77    static void didFireTimer(const InspectorInstrumentationCookie&);
    7878    static InspectorInstrumentationCookie willLayout(Frame*);
    79     static void didLayout(Frame*, InspectorInstrumentationCookie cookie);
    80     static InspectorInstrumentationCookie willLoadXHR(ScriptExecutionContext*, XMLHttpRequest* request);
    81     static void didLoadXHR(ScriptExecutionContext*, InspectorInstrumentationCookie cookie);
     79    static void didLayout(const InspectorInstrumentationCookie&);
     80    static InspectorInstrumentationCookie willLoadXHR(ScriptExecutionContext*, XMLHttpRequest*);
     81    static void didLoadXHR(const InspectorInstrumentationCookie&);
    8282    static InspectorInstrumentationCookie willPaint(Frame*, const IntRect& rect);
    83     static void didPaint(Frame*, InspectorInstrumentationCookie cookie);
     83    static void didPaint(const InspectorInstrumentationCookie&);
    8484    static InspectorInstrumentationCookie willRecalculateStyle(Document*);
    85     static void didRecalculateStyle(Document*, InspectorInstrumentationCookie cookie);
     85    static void didRecalculateStyle(const InspectorInstrumentationCookie&);
    8686    static InspectorInstrumentationCookie willReceiveResourceData(Frame*, unsigned long identifier);
    87     static void didReceiveResourceData(Frame*, InspectorInstrumentationCookie cookie);
     87    static void didReceiveResourceData(const InspectorInstrumentationCookie&);
    8888    static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*, unsigned long identifier, const ResourceResponse& response);
    89     static void didReceiveResourceResponse(Frame*, InspectorInstrumentationCookie cookie);
     89    static void didReceiveResourceResponse(const InspectorInstrumentationCookie&);
    9090    static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned int length, unsigned int startLine);
    91     static void didWriteHTML(Document*, unsigned int endLine, InspectorInstrumentationCookie cookie);
     91    static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned int endLine);
    9292
    9393#if ENABLE(INSPECTOR)
     
    115115
    116116    static InspectorInstrumentationCookie willCallFunctionImpl(InspectorController*, const String& scriptName, int scriptLine);
    117     static void didCallFunctionImpl(InspectorController*, InspectorInstrumentationCookie);
     117    static void didCallFunctionImpl(const InspectorInstrumentationCookie&);
    118118    static InspectorInstrumentationCookie willChangeXHRReadyStateImpl(InspectorController*, XMLHttpRequest* request);
    119     static void didChangeXHRReadyStateImpl(InspectorController*, InspectorInstrumentationCookie);
     119    static void didChangeXHRReadyStateImpl(const InspectorInstrumentationCookie&);
    120120    static InspectorInstrumentationCookie willDispatchEventImpl(InspectorController*, const Event& event, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors);
    121     static void didDispatchEventImpl(InspectorController*, InspectorInstrumentationCookie);
     121    static void didDispatchEventImpl(const InspectorInstrumentationCookie&);
    122122    static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InspectorController*, const Event& event, DOMWindow* window);
    123     static void didDispatchEventOnWindowImpl(InspectorController*, InspectorInstrumentationCookie);
     123    static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&);
    124124    static InspectorInstrumentationCookie willEvaluateScriptImpl(InspectorController*, const String& url, int lineNumber);
    125     static void didEvaluateScriptImpl(InspectorController*, InspectorInstrumentationCookie);
     125    static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&);
    126126    static InspectorInstrumentationCookie willFireTimerImpl(InspectorController*, int timerId);
    127     static void didFireTimerImpl(InspectorController*, InspectorInstrumentationCookie);
     127    static void didFireTimerImpl(const InspectorInstrumentationCookie&);
    128128    static InspectorInstrumentationCookie willLayoutImpl(InspectorController*);
    129     static void didLayoutImpl(InspectorController*, InspectorInstrumentationCookie);
     129    static void didLayoutImpl(const InspectorInstrumentationCookie&);
    130130    static InspectorInstrumentationCookie willLoadXHRImpl(InspectorController*, XMLHttpRequest* request);
    131     static void didLoadXHRImpl(InspectorController*, InspectorInstrumentationCookie);
     131    static void didLoadXHRImpl(const InspectorInstrumentationCookie&);
    132132    static InspectorInstrumentationCookie willPaintImpl(InspectorController*, const IntRect& rect);
    133     static void didPaintImpl(InspectorController*, InspectorInstrumentationCookie);
     133    static void didPaintImpl(const InspectorInstrumentationCookie&);
    134134    static InspectorInstrumentationCookie willRecalculateStyleImpl(InspectorController*);
    135     static void didRecalculateStyleImpl(InspectorController*, InspectorInstrumentationCookie);
     135    static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
    136136    static InspectorInstrumentationCookie willReceiveResourceDataImpl(InspectorController*, unsigned long identifier);
    137     static void didReceiveResourceDataImpl(InspectorController*, InspectorInstrumentationCookie);
     137    static void didReceiveResourceDataImpl(const InspectorInstrumentationCookie&);
    138138    static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InspectorController*, unsigned long identifier, const ResourceResponse& response);
    139     static void didReceiveResourceResponseImpl(InspectorController*, InspectorInstrumentationCookie);
     139    static void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&);
    140140    static InspectorInstrumentationCookie willWriteHTMLImpl(InspectorController*, unsigned int length, unsigned int startLine);
    141     static void didWriteHTMLImpl(InspectorController*, unsigned int endLine, InspectorInstrumentationCookie);
     141    static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned int endLine);
    142142
    143143    static InspectorController* inspectorControllerForContext(ScriptExecutionContext*);
     
    148148    static bool hasFrontend(InspectorController*);
    149149    static InspectorTimelineAgent* retrieveTimelineAgent(InspectorController*);
    150     static InspectorTimelineAgent* retrieveTimelineAgent(InspectorController*, InspectorInstrumentationCookie);
     150    static InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCookie&);
    151151
    152152    static int s_frontendCounter;
     
    244244        return willCallFunctionImpl(inspectorController, scriptName, scriptLine);
    245245#endif
    246     return 0;
    247 }
    248 
    249 inline void InspectorInstrumentation::didCallFunction(Frame* frame, InspectorInstrumentationCookie cookie)
    250 {
    251 #if ENABLE(INSPECTOR)
    252     if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
    253         didCallFunctionImpl(inspectorController, cookie);
     246    return InspectorInstrumentationCookie();
     247}
     248
     249inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumentationCookie& cookie)
     250{
     251#if ENABLE(INSPECTOR)
     252    if (hasFrontends() && cookie.first)
     253        didCallFunctionImpl(cookie);
    254254#endif
    255255}
     
    261261        return willChangeXHRReadyStateImpl(inspectorController, request);
    262262#endif
    263     return 0;
    264 }
    265 
    266 inline void InspectorInstrumentation::didChangeXHRReadyState(ScriptExecutionContext* context, InspectorInstrumentationCookie cookie)
    267 {
    268 #if ENABLE(INSPECTOR)
    269     if (InspectorController* inspectorController = inspectorControllerForContext(context))
    270         didChangeXHRReadyStateImpl(inspectorController, cookie);
     263    return InspectorInstrumentationCookie();
     264}
     265
     266inline void InspectorInstrumentation::didChangeXHRReadyState(const InspectorInstrumentationCookie& cookie)
     267{
     268#if ENABLE(INSPECTOR)
     269    if (hasFrontends() && cookie.first)
     270        didChangeXHRReadyStateImpl(cookie);
    271271#endif
    272272}
     
    278278        return willDispatchEventImpl(inspectorController, event, window, node, ancestors);
    279279#endif
    280     return 0;
    281 }
    282 
    283 inline void InspectorInstrumentation::didDispatchEvent(Document* document, InspectorInstrumentationCookie cookie)
    284 {
    285 #if ENABLE(INSPECTOR)
    286     if (InspectorController* inspectorController = inspectorControllerForDocument(document))
    287         didDispatchEventImpl(inspectorController, cookie);
     280    return InspectorInstrumentationCookie();
     281}
     282
     283inline void InspectorInstrumentation::didDispatchEvent(const InspectorInstrumentationCookie& cookie)
     284{
     285#if ENABLE(INSPECTOR)
     286    if (hasFrontends() && cookie.first)
     287        didDispatchEventImpl(cookie);
    288288#endif
    289289}
     
    295295        return willDispatchEventOnWindowImpl(inspectorController, event, window);
    296296#endif
    297     return 0;
    298 }
    299 
    300 inline void InspectorInstrumentation::didDispatchEventOnWindow(Frame* frame, InspectorInstrumentationCookie cookie)
    301 {
    302 #if ENABLE(INSPECTOR)
    303     if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
    304         didDispatchEventOnWindowImpl(inspectorController, cookie);
     297    return InspectorInstrumentationCookie();
     298}
     299
     300inline void InspectorInstrumentation::didDispatchEventOnWindow(const InspectorInstrumentationCookie& cookie)
     301{
     302#if ENABLE(INSPECTOR)
     303    if (hasFrontends() && cookie.first)
     304        didDispatchEventOnWindowImpl(cookie);
    305305#endif
    306306}
     
    312312        return willEvaluateScriptImpl(inspectorController, url, lineNumber);
    313313#endif
    314     return 0;
    315 }
    316 
    317 inline void InspectorInstrumentation::didEvaluateScript(Frame* frame, InspectorInstrumentationCookie cookie)
    318 {
    319 #if ENABLE(INSPECTOR)
    320     if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
    321         didEvaluateScriptImpl(inspectorController, cookie);
     314    return InspectorInstrumentationCookie();
     315}
     316
     317inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumentationCookie& cookie)
     318{
     319#if ENABLE(INSPECTOR)
     320    if (hasFrontends() && cookie.first)
     321        didEvaluateScriptImpl(cookie);
    322322#endif
    323323}
     
    329329        return willFireTimerImpl(inspectorController, timerId);
    330330#endif
    331     return 0;
    332 }
    333 
    334 inline void InspectorInstrumentation::didFireTimer(ScriptExecutionContext* context, InspectorInstrumentationCookie cookie)
    335 {
    336 #if ENABLE(INSPECTOR)
    337     if (InspectorController* inspectorController = inspectorControllerForContext(context))
    338         didFireTimerImpl(inspectorController, cookie);
     331    return InspectorInstrumentationCookie();
     332}
     333
     334inline void InspectorInstrumentation::didFireTimer(const InspectorInstrumentationCookie& cookie)
     335{
     336#if ENABLE(INSPECTOR)
     337    if (hasFrontends() && cookie.first)
     338        didFireTimerImpl(cookie);
    339339#endif
    340340}
     
    346346        return willLayoutImpl(inspectorController);
    347347#endif
    348     return 0;
    349 }
    350 
    351 inline void InspectorInstrumentation::didLayout(Frame* frame, InspectorInstrumentationCookie cookie)
    352 {
    353 #if ENABLE(INSPECTOR)
    354     if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
    355         didLayoutImpl(inspectorController, cookie);
     348    return InspectorInstrumentationCookie();
     349}
     350
     351inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCookie& cookie)
     352{
     353#if ENABLE(INSPECTOR)
     354    if (hasFrontends() && cookie.first)
     355        didLayoutImpl(cookie);
    356356#endif
    357357}
     
    363363        return willLoadXHRImpl(inspectorController, request);
    364364#endif
    365     return 0;
    366 }
    367 
    368 inline void InspectorInstrumentation::didLoadXHR(ScriptExecutionContext* context, InspectorInstrumentationCookie cookie)
    369 {
    370 #if ENABLE(INSPECTOR)
    371     if (InspectorController* inspectorController = inspectorControllerForContext(context))
    372         didLoadXHRImpl(inspectorController, cookie);
     365    return InspectorInstrumentationCookie();
     366}
     367
     368inline void InspectorInstrumentation::didLoadXHR(const InspectorInstrumentationCookie& cookie)
     369{
     370#if ENABLE(INSPECTOR)
     371    if (hasFrontends() && cookie.first)
     372        didLoadXHRImpl(cookie);
    373373#endif
    374374}
     
    380380        return willPaintImpl(inspectorController, rect);
    381381#endif
    382     return 0;
    383 }
    384 
    385 inline void InspectorInstrumentation::didPaint(Frame* frame, InspectorInstrumentationCookie cookie)
    386 {
    387 #if ENABLE(INSPECTOR)
    388     if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
    389         didPaintImpl(inspectorController, cookie);
     382    return InspectorInstrumentationCookie();
     383}
     384
     385inline void InspectorInstrumentation::didPaint(const InspectorInstrumentationCookie& cookie)
     386{
     387#if ENABLE(INSPECTOR)
     388    if (hasFrontends() && cookie.first)
     389        didPaintImpl(cookie);
    390390#endif
    391391}
     
    397397        return willRecalculateStyleImpl(inspectorController);
    398398#endif
    399     return 0;
    400 }
    401 
    402 inline void InspectorInstrumentation::didRecalculateStyle(Document* document, InspectorInstrumentationCookie cookie)
    403 {
    404 #if ENABLE(INSPECTOR)
    405     if (InspectorController* inspectorController = inspectorControllerForDocument(document))
    406         didRecalculateStyleImpl(inspectorController, cookie);
     399    return InspectorInstrumentationCookie();
     400}
     401
     402inline void InspectorInstrumentation::didRecalculateStyle(const InspectorInstrumentationCookie& cookie)
     403{
     404#if ENABLE(INSPECTOR)
     405    if (hasFrontends() && cookie.first)
     406        didRecalculateStyleImpl(cookie);
    407407#endif
    408408}
     
    414414        return willReceiveResourceDataImpl(inspectorController, identifier);
    415415#endif
    416     return 0;
    417 }
    418 
    419 inline void InspectorInstrumentation::didReceiveResourceData(Frame* frame, InspectorInstrumentationCookie cookie)
    420 {
    421 #if ENABLE(INSPECTOR)
    422     if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
    423         didReceiveResourceDataImpl(inspectorController, cookie);
     416    return InspectorInstrumentationCookie();
     417}
     418
     419inline void InspectorInstrumentation::didReceiveResourceData(const InspectorInstrumentationCookie& cookie)
     420{
     421#if ENABLE(INSPECTOR)
     422    if (hasFrontends() && cookie.first)
     423        didReceiveResourceDataImpl(cookie);
    424424#endif
    425425}
     
    431431        return willReceiveResourceResponseImpl(inspectorController, identifier, response);
    432432#endif
    433     return 0;
    434 }
    435 
    436 inline void InspectorInstrumentation::didReceiveResourceResponse(Frame* frame, InspectorInstrumentationCookie cookie)
    437 {
    438 #if ENABLE(INSPECTOR)
    439     if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
    440         didReceiveResourceResponseImpl(inspectorController, cookie);
     433    return InspectorInstrumentationCookie();
     434}
     435
     436inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie)
     437{
     438#if ENABLE(INSPECTOR)
     439    if (hasFrontends() && cookie.first)
     440        didReceiveResourceResponseImpl(cookie);
    441441#endif
    442442}
     
    448448        return willWriteHTMLImpl(inspectorController, length, startLine);
    449449#endif
    450     return 0;
    451 }
    452 
    453 inline void InspectorInstrumentation::didWriteHTML(Document* document, unsigned int endLine, InspectorInstrumentationCookie cookie)
    454 {
    455 #if ENABLE(INSPECTOR)
    456     if (InspectorController* inspectorController = inspectorControllerForDocument(document))
    457         didWriteHTMLImpl(inspectorController, endLine, cookie);
     450    return InspectorInstrumentationCookie();
     451}
     452
     453inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentationCookie& cookie, unsigned int endLine)
     454{
     455#if ENABLE(INSPECTOR)
     456    if (hasFrontends() && cookie.first)
     457        didWriteHTMLImpl(cookie, endLine);
    458458#endif
    459459}
  • trunk/WebCore/loader/ResourceLoader.cpp

    r69283 r69406  
    401401void ResourceLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse& response)
    402402{
    403     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame.get(), identifier(), response);
    404403#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    405404    if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForResponse(this, response))
    406405        return;
    407406#endif
     407    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame.get(), identifier(), response);
    408408    didReceiveResponse(response);
    409     InspectorInstrumentation::didReceiveResourceResponse(m_frame.get(), cookie);
     409    InspectorInstrumentation::didReceiveResourceResponse(cookie);
    410410}
    411411
     
    414414    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceData(m_frame.get(), identifier());
    415415    didReceiveData(data, length, lengthReceived, false);
    416     InspectorInstrumentation::didReceiveResourceData(m_frame.get(), cookie);
     416    InspectorInstrumentation::didReceiveResourceData(cookie);
    417417}
    418418
  • trunk/WebCore/page/DOMTimer.cpp

    r69283 r69406  
    118118        m_action->execute(context);
    119119
    120         InspectorInstrumentation::didFireTimer(context, cookie);
     120        InspectorInstrumentation::didFireTimer(cookie);
    121121
    122122        return;
     
    131131    action->execute(context);
    132132
    133     InspectorInstrumentation::didFireTimer(context, cookie);
     133    InspectorInstrumentation::didFireTimer(cookie);
    134134
    135135    timerNestingLevel = 0;
  • trunk/WebCore/page/DOMWindow.cpp

    r69283 r69406  
    15361536    bool result = fireEventListeners(event.get());
    15371537
    1538     InspectorInstrumentation::didDispatchEventOnWindow(frame(), cookie);
     1538    InspectorInstrumentation::didDispatchEventOnWindow(cookie);
    15391539
    15401540    return result;
  • trunk/WebCore/page/FrameView.cpp

    r69283 r69406  
    838838    }
    839839
    840     InspectorInstrumentation::didLayout(m_frame.get(), cookie);
     840    InspectorInstrumentation::didLayout(cookie);
    841841
    842842    m_nestedLayoutCount--;
     
    20012001        sCurrentPaintTimeStamp = 0;
    20022002
    2003     InspectorInstrumentation::didPaint(m_frame.get(), cookie);
     2003    InspectorInstrumentation::didPaint(cookie);
    20042004}
    20052005
  • trunk/WebCore/rendering/RenderLayerBacking.cpp

    r69283 r69406  
    10831083    paintIntoLayer(m_owningLayer, &context, dirtyRect, PaintBehaviorNormal, paintingPhase, renderer());
    10841084
    1085     InspectorInstrumentation::didPaint(m_owningLayer->renderer()->frame(), cookie);
     1085    InspectorInstrumentation::didPaint(cookie);
    10861086}
    10871087
  • trunk/WebCore/xml/XMLHttpRequest.cpp

    r69283 r69406  
    309309        m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent), m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent);
    310310
    311     InspectorInstrumentation::didChangeXHRReadyState(scriptExecutionContext(), cookie);
     311    InspectorInstrumentation::didChangeXHRReadyState(cookie);
    312312
    313313    if (m_state == DONE && !m_error) {
    314314        InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLoadXHR(scriptExecutionContext(), this);
    315315        m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
    316         InspectorInstrumentation::didLoadXHR(scriptExecutionContext(), cookie);
     316        InspectorInstrumentation::didLoadXHR(cookie);
    317317    }
    318318}
Note: See TracChangeset for help on using the changeset viewer.