Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 1815383003: Attach requestId to resource fetch trace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move trace call to FrameFetchContext Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0251cab87f47afb71e8b07c1ce1ecb832f6fc6fd..db133c4d2eaea7c5bea4cee08b934eb16a279a30 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -43,6 +43,7 @@
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/html/imports/HTMLImportsController.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/inspector/IdentifiersFactory.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorResourceAgent.h"
#include "core/inspector/InspectorTraceEvents.h"
@@ -61,6 +62,7 @@
#include "core/timing/DOMWindowPerformance.h"
#include "core/timing/Performance.h"
#include "platform/Logging.h"
+#include "platform/TracedValue.h"
#include "platform/mhtml/MHTMLArchive.h"
#include "platform/network/ResourceTimingInfo.h"
#include "platform/weborigin/SchemeRegistry.h"
@@ -338,8 +340,21 @@ bool FrameFetchContext::shouldLoadNewResource(Resource::Type type) const
return m_documentLoader == frame()->loader().documentLoader();
}
-void FrameFetchContext::willStartLoadingResource(ResourceRequest& request)
+static PassOwnPtr<TracedValue> loadResourceTraceData(unsigned long identifier, const KURL& url, int priority)
{
+ String requestId = IdentifiersFactory::requestId(identifier);
+
+ OwnPtr<TracedValue> value = TracedValue::create();
+ value->setString("requestId", requestId);
+ value->setString("url", url.getString());
+ value->setInteger("priority", priority);
+ return value.release();
+}
+
+void FrameFetchContext::willStartLoadingResource(Resource* resource, ResourceRequest& request)
+{
+ TRACE_EVENT_ASYNC_BEGIN1("blink.net", "Resource", resource, "data", loadResourceTraceData(resource->identifier(), resource->url(), resource->resourceRequest().priority()));
+
if (m_documentLoader)
m_documentLoader->applicationCacheHost()->willStartLoadingResource(request);
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698