Changeset 224540 in webkit


Ignore:
Timestamp:
Nov 7, 2017 12:01:08 PM (6 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Add some fast returns in cases where we only call through to a NetworkAgent
https://bugs.webkit.org/show_bug.cgi?id=179359

Reviewed by Devin Rousso.

  • inspector/InspectorInstrumentation.h:

(WebCore::InspectorInstrumentation::willSendRequest):
(WebCore::InspectorInstrumentation::willSendRequestOfType):
(WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
(WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponse):
(WebCore::InspectorInstrumentation::didReceiveData):
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
(WebCore::InspectorInstrumentation::willLoadXHRSynchronously):
(WebCore::InspectorInstrumentation::didLoadXHRSynchronously):
(WebCore::InspectorInstrumentation::scriptImported):
(WebCore::InspectorInstrumentation::didReceiveScriptResponse):
Fast return if no frontend in cases that only call into NetworkAgent
because the NetworkAgent is only available if there is a frontend.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224537 r224540  
     12017-11-07  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Add some fast returns in cases where we only call through to a NetworkAgent
     4        https://bugs.webkit.org/show_bug.cgi?id=179359
     5
     6        Reviewed by Devin Rousso.
     7
     8        * inspector/InspectorInstrumentation.h:
     9        (WebCore::InspectorInstrumentation::willSendRequest):
     10        (WebCore::InspectorInstrumentation::willSendRequestOfType):
     11        (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
     12        (WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponse):
     13        (WebCore::InspectorInstrumentation::didReceiveData):
     14        (WebCore::InspectorInstrumentation::didFinishXHRLoading):
     15        (WebCore::InspectorInstrumentation::willLoadXHRSynchronously):
     16        (WebCore::InspectorInstrumentation::didLoadXHRSynchronously):
     17        (WebCore::InspectorInstrumentation::scriptImported):
     18        (WebCore::InspectorInstrumentation::didReceiveScriptResponse):
     19        Fast return if no frontend in cases that only call into NetworkAgent
     20        because the NetworkAgent is only available if there is a frontend.
     21
    1222017-10-31  Filip Pizlo  <fpizlo@apple.com>
    223
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r224370 r224540  
    169169    static void didRecalculateStyle(const InspectorInstrumentationCookie&);
    170170    static void didScheduleStyleRecalculation(Document&);
    171 
    172171    static void applyEmulatedMedia(Frame&, String&);
     172
    173173    static void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
    174174    static void didLoadResourceFromMemoryCache(Page&, DocumentLoader*, CachedResource*);
     
    347347    static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
    348348    static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&);
    349 
    350349    static void applyEmulatedMediaImpl(InstrumentingAgents&, String&);
     350
    351351    static void willSendRequestImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
    352352    static void willSendRequestOfTypeImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, LoadType);
     
    903903inline void InspectorInstrumentation::willSendRequest(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
    904904{
     905    FAST_RETURN_IF_NO_FRONTENDS(void());
    905906    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
    906907        willSendRequestImpl(*instrumentingAgents, identifier, loader, request, redirectResponse);
     
    909910inline void InspectorInstrumentation::willSendRequestOfType(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, LoadType loadType)
    910911{
     912    FAST_RETURN_IF_NO_FRONTENDS(void());
    911913    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
    912914        willSendRequestOfTypeImpl(*instrumentingAgents, identifier, loader, request, loadType);
     
    915917inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page& page, DocumentLoader* loader, CachedResource* resource)
    916918{
     919    FAST_RETURN_IF_NO_FRONTENDS(void());
    917920    didLoadResourceFromMemoryCacheImpl(instrumentingAgentsForPage(page), loader, resource);
    918921}
     
    926929inline void InspectorInstrumentation::didReceiveThreadableLoaderResponse(DocumentThreadableLoader& documentThreadableLoader, unsigned long identifier)
    927930{
     931    FAST_RETURN_IF_NO_FRONTENDS(void());
    928932    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(documentThreadableLoader.document()))
    929933        didReceiveThreadableLoaderResponseImpl(*instrumentingAgents, documentThreadableLoader, identifier);
     
    932936inline void InspectorInstrumentation::didReceiveData(Frame* frame, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
    933937{
     938    FAST_RETURN_IF_NO_FRONTENDS(void());
    934939    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
    935940        didReceiveDataImpl(*instrumentingAgents, identifier, data, dataLength, encodedDataLength);
     
    971976inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, unsigned long identifier, std::optional<String> decodedText)
    972977{
     978    FAST_RETURN_IF_NO_FRONTENDS(void());
    973979    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
    974980        didFinishXHRLoadingImpl(*instrumentingAgents, identifier, decodedText);
     
    977983inline void InspectorInstrumentation::willLoadXHRSynchronously(ScriptExecutionContext* context)
    978984{
     985    FAST_RETURN_IF_NO_FRONTENDS(void());
    979986    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
    980987        willLoadXHRSynchronouslyImpl(*instrumentingAgents);
     
    983990inline void InspectorInstrumentation::didLoadXHRSynchronously(ScriptExecutionContext* context)
    984991{
     992    FAST_RETURN_IF_NO_FRONTENDS(void());
    985993    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
    986994        didLoadXHRSynchronouslyImpl(*instrumentingAgents);
     
    989997inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext& context, unsigned long identifier, const String& sourceString)
    990998{
     999    FAST_RETURN_IF_NO_FRONTENDS(void());
    9911000    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
    9921001        scriptImportedImpl(*instrumentingAgents, identifier, sourceString);
     
    10011010inline void InspectorInstrumentation::didReceiveScriptResponse(ScriptExecutionContext* context, unsigned long identifier)
    10021011{
     1012    FAST_RETURN_IF_NO_FRONTENDS(void());
    10031013    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
    10041014        didReceiveScriptResponseImpl(*instrumentingAgents, identifier);
Note: See TracChangeset for help on using the changeset viewer.