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

Unified Diff: Source/core/loader/cache/CachedResourceLoader.cpp

Issue 14672042: Prepare to add more initiator info to CachedResource(Request) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 7 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 | « Source/core/loader/cache/CachedResourceLoader.h ('k') | Source/core/loader/cache/CachedResourceRequest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/cache/CachedResourceLoader.cpp
diff --git a/Source/core/loader/cache/CachedResourceLoader.cpp b/Source/core/loader/cache/CachedResourceLoader.cpp
index dc8493134c8bfccfa7128f1f3aecc82b7cb2f656..aedd16571d630799a2af9c2f5f984ae198ff3d27 100644
--- a/Source/core/loader/cache/CachedResourceLoader.cpp
+++ b/Source/core/loader/cache/CachedResourceLoader.cpp
@@ -557,15 +557,17 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::loadResource(CachedRe
void CachedResourceLoader::storeResourceTimingInitiatorInformation(const CachedResourceHandle<CachedResource>& resource, const CachedResourceRequest& request)
{
+ CachedResourceInitiatorInfo info = request.initiatorInfo();
+ info.startTime = monotonicallyIncreasingTime();
+
if (resource->type() == CachedResource::MainResource) {
// <iframe>s should report the initial navigation requested by the parent document, but not subsequent navigations.
if (frame()->ownerElement() && !frame()->ownerElement()->loadedNonEmptyDocument()) {
- InitiatorInfo info = { frame()->ownerElement()->localName(), monotonicallyIncreasingTime() };
+ info.name = frame()->ownerElement()->localName();
m_initiatorMap.add(resource.get(), info);
frame()->ownerElement()->didLoadNonEmptyDocument();
}
} else {
- InitiatorInfo info = { request.initiatorName(), monotonicallyIncreasingTime() };
m_initiatorMap.add(resource.get(), info);
}
}
@@ -754,14 +756,14 @@ void CachedResourceLoader::loadDone(CachedResource* resource)
RefPtr<Document> protectDocument(m_document);
if (resource && resource->response().isHTTP() && ((!resource->errorOccurred() && !resource->wasCanceled()) || resource->response().httpStatusCode() == 304)) {
- HashMap<CachedResource*, InitiatorInfo>::iterator initiatorIt = m_initiatorMap.find(resource);
+ HashMap<CachedResource*, CachedResourceInitiatorInfo>::iterator initiatorIt = m_initiatorMap.find(resource);
if (initiatorIt != m_initiatorMap.end()) {
ASSERT(document());
Document* initiatorDocument = document();
if (resource->type() == CachedResource::MainResource)
initiatorDocument = document()->parentDocument();
ASSERT(initiatorDocument);
- const InitiatorInfo& info = initiatorIt->value;
+ const CachedResourceInitiatorInfo& info = initiatorIt->value;
initiatorDocument->domWindow()->performance()->addResourceTiming(info.name, initiatorDocument, resource->resourceRequest(), resource->response(), info.startTime, resource->loadFinishTime());
m_initiatorMap.remove(initiatorIt);
}
@@ -996,8 +998,6 @@ void CachedResourceLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo)
info.addMember(m_preloads, "preloads");
info.addMember(m_pendingPreloads, "pendingPreloads");
info.addMember(m_garbageCollectDocumentResourcesTimer, "garbageCollectDocumentResourcesTimer");
- // FIXME: m_initiatorMap has pointers to already deleted CachedResources
- info.ignoreMember(m_initiatorMap);
}
const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions()
« no previous file with comments | « Source/core/loader/cache/CachedResourceLoader.h ('k') | Source/core/loader/cache/CachedResourceRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698