Title: [224540] trunk/Source/WebCore
Revision
224540
Author
joep...@webkit.org
Date
2017-11-07 12:01:08 -0800 (Tue, 07 Nov 2017)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (224539 => 224540)


--- trunk/Source/WebCore/ChangeLog	2017-11-07 19:33:22 UTC (rev 224539)
+++ trunk/Source/WebCore/ChangeLog	2017-11-07 20:01:08 UTC (rev 224540)
@@ -1,3 +1,24 @@
+2017-11-07  Joseph Pecoraro  <pecor...@apple.com>
+
+        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.
+
 2017-10-31  Filip Pizlo  <fpi...@apple.com>
 
         bmalloc should support strictly type-segregated isolated heaps

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (224539 => 224540)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2017-11-07 19:33:22 UTC (rev 224539)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2017-11-07 20:01:08 UTC (rev 224540)
@@ -168,8 +168,8 @@
     static InspectorInstrumentationCookie willRecalculateStyle(Document&);
     static void didRecalculateStyle(const InspectorInstrumentationCookie&);
     static void didScheduleStyleRecalculation(Document&);
+    static void applyEmulatedMedia(Frame&, String&);
 
-    static void applyEmulatedMedia(Frame&, String&);
     static void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
     static void didLoadResourceFromMemoryCache(Page&, DocumentLoader*, CachedResource*);
     static void didReceiveResourceResponse(Frame&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
@@ -346,8 +346,8 @@
     static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents&, Document&);
     static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
     static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&);
+    static void applyEmulatedMediaImpl(InstrumentingAgents&, String&);
 
-    static void applyEmulatedMediaImpl(InstrumentingAgents&, String&);
     static void willSendRequestImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
     static void willSendRequestOfTypeImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, LoadType);
     static void markResourceAsCachedImpl(InstrumentingAgents&, unsigned long identifier);
@@ -902,6 +902,7 @@
 
 inline void InspectorInstrumentation::willSendRequest(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         willSendRequestImpl(*instrumentingAgents, identifier, loader, request, redirectResponse);
 }
@@ -908,6 +909,7 @@
 
 inline void InspectorInstrumentation::willSendRequestOfType(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, LoadType loadType)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         willSendRequestOfTypeImpl(*instrumentingAgents, identifier, loader, request, loadType);
 }
@@ -914,6 +916,7 @@
 
 inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page& page, DocumentLoader* loader, CachedResource* resource)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     didLoadResourceFromMemoryCacheImpl(instrumentingAgentsForPage(page), loader, resource);
 }
 
@@ -925,6 +928,7 @@
 
 inline void InspectorInstrumentation::didReceiveThreadableLoaderResponse(DocumentThreadableLoader& documentThreadableLoader, unsigned long identifier)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(documentThreadableLoader.document()))
         didReceiveThreadableLoaderResponseImpl(*instrumentingAgents, documentThreadableLoader, identifier);
 }
@@ -931,6 +935,7 @@
     
 inline void InspectorInstrumentation::didReceiveData(Frame* frame, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         didReceiveDataImpl(*instrumentingAgents, identifier, data, dataLength, encodedDataLength);
 }
@@ -970,6 +975,7 @@
 
 inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, unsigned long identifier, std::optional<String> decodedText)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didFinishXHRLoadingImpl(*instrumentingAgents, identifier, decodedText);
 }
@@ -976,6 +982,7 @@
 
 inline void InspectorInstrumentation::willLoadXHRSynchronously(ScriptExecutionContext* context)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         willLoadXHRSynchronouslyImpl(*instrumentingAgents);
 }
@@ -982,6 +989,7 @@
 
 inline void InspectorInstrumentation::didLoadXHRSynchronously(ScriptExecutionContext* context)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didLoadXHRSynchronouslyImpl(*instrumentingAgents);
 }
@@ -988,6 +996,7 @@
 
 inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext& context, unsigned long identifier, const String& sourceString)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         scriptImportedImpl(*instrumentingAgents, identifier, sourceString);
 }
@@ -1000,6 +1009,7 @@
 
 inline void InspectorInstrumentation::didReceiveScriptResponse(ScriptExecutionContext* context, unsigned long identifier)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didReceiveScriptResponseImpl(*instrumentingAgents, identifier);
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to