Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp |
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp |
index 4682c6d8066a059b8ef8207d1b81bce646086a02..d34a24d5d65e635b30797fb93a39c42eae1b2f3d 100644 |
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp |
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp |
@@ -31,8 +31,11 @@ |
#include "core/loader/FrameFetchContext.h" |
#include "bindings/core/v8/ScriptController.h" |
+#include "bindings/core/v8/V8DOMActivityLogger.h" |
#include "core/dom/Document.h" |
#include "core/fetch/ClientHintsPreferences.h" |
+#include "core/fetch/FetchInitiatorTypeNames.h" |
+#include "core/fetch/Resource.h" |
#include "core/fetch/ResourceLoadingLog.h" |
#include "core/fetch/UniqueIdentifier.h" |
#include "core/frame/FrameConsole.h" |
@@ -76,6 +79,7 @@ |
#include "public/platform/WebDocumentSubresourceFilter.h" |
#include "public/platform/WebInsecureRequestPolicy.h" |
#include "public/platform/WebViewScheduler.h" |
+#include "wtf/Vector.h" |
#include <algorithm> |
#include <memory> |
@@ -528,9 +532,12 @@ loadResourceTraceData(unsigned long identifier, const KURL& url, int priority) { |
return value; |
} |
-void FrameFetchContext::willStartLoadingResource(unsigned long identifier, |
- ResourceRequest& request, |
- Resource::Type type) { |
+void FrameFetchContext::willStartLoadingResource( |
+ unsigned long identifier, |
+ ResourceRequest& request, |
+ Resource::Type type, |
+ const AtomicString& fetchInitiatorName, |
+ bool forPreload) { |
TRACE_EVENT_ASYNC_BEGIN1( |
"blink.net", "Resource", identifier, "data", |
loadResourceTraceData(identifier, request.url(), request.priority())); |
@@ -545,6 +552,23 @@ void FrameFetchContext::willStartLoadingResource(unsigned long identifier, |
} else { |
m_documentLoader->applicationCacheHost()->willStartLoadingResource(request); |
} |
+ if (!forPreload) { |
+ V8DOMActivityLogger* activityLogger = nullptr; |
+ if (fetchInitiatorName == FetchInitiatorTypeNames::xmlhttprequest) { |
+ activityLogger = V8DOMActivityLogger::currentActivityLogger(); |
+ } else { |
+ activityLogger = |
+ V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld(); |
+ } |
+ |
+ if (activityLogger) { |
+ Vector<String> argv; |
+ argv.append(Resource::resourceTypeToString(type, fetchInitiatorName)); |
+ argv.append(request.url()); |
+ activityLogger->logEvent("blinkRequestResource", argv.size(), |
+ argv.data()); |
+ } |
+ } |
} |
void FrameFetchContext::didLoadResource(Resource* resource) { |