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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 1815383003: Attach requestId to resource fetch trace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | 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/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 515a577be25bb1d2839280469410f3f3872e8c22..cc1fd7d6805333794ac2bd2abcae89d8e88d494b 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -35,6 +35,7 @@
#include "core/fetch/ResourceLoader.h"
#include "core/fetch/ResourceLoaderSet.h"
#include "core/fetch/UniqueIdentifier.h"
+#include "core/inspector/IdentifiersFactory.h"
Nate Chapin 2016/03/23 22:43:07 This is a layering violation: core/fetch/ isn't al
#include "platform/Histogram.h"
#include "platform/Logging.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -299,6 +300,17 @@ static PassOwnPtr<TracedValue> urlForTraceEvent(const KURL& url)
return value.release();
}
+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();
+}
+
PassRefPtrWillBeRawPtr<Resource> ResourceFetcher::resourceForStaticData(const FetchRequest& request, const ResourceFactory& factory, const SubstituteData& substituteData)
{
const KURL& url = request.resourceRequest().url();
@@ -1006,7 +1018,7 @@ void ResourceFetcher::willStartLoadingResource(Resource* resource, ResourceLoade
context().willStartLoadingResource(request);
storeResourceTimingInitiatorInformation(resource);
- TRACE_EVENT_ASYNC_BEGIN2("blink.net", "Resource", resource, "url", resource->url().getString().ascii(), "priority", resource->resourceRequest().priority());
+ TRACE_EVENT_ASYNC_BEGIN1("blink.net", "Resource", resource, "data", loadResourceTraceData(resource->identifier(), resource->url(), resource->resourceRequest().priority()));
context().dispatchWillSendRequest(resource->identifier(), request, ResourceResponse(), resource->options().initiatorInfo);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698