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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp

Issue 2647643004: Report nav timing 2 instance as soon as it's requested. (Closed)
Patch Set: addressed comments Created 3 years, 10 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
Index: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index 386b8070007675d1ad5cb0948d882a102099c3fa..59b0b02c7f8173beb92f7dd2a004e62b848b7931 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -312,13 +312,13 @@ void ResourceFetcher::requestLoadStarted(unsigned long identifier,
!m_validatedURLs.contains(request.resourceRequest().url())) {
// Resources loaded from memory cache should be reported the first time
// they're used.
- std::unique_ptr<ResourceTimingInfo> info = ResourceTimingInfo::create(
+ RefPtr<ResourceTimingInfo> info = ResourceTimingInfo::create(
request.options().initiatorInfo.name, monotonicallyIncreasingTime(),
resource->getType() == Resource::MainResource);
populateTimingInfo(info.get(), resource);
info->clearLoadTimings();
info->setLoadFinishTime(info->initialTime());
- m_scheduledResourceTimingReports.push_back(std::move(info));
+ m_scheduledResourceTimingReports.push_back(info.release());
if (!m_resourceTimingReportTimer.isActive())
m_resourceTimingReportTimer.startOneShot(0, BLINK_FROM_HERE);
}
@@ -631,7 +631,7 @@ Resource* ResourceFetcher::requestResource(
void ResourceFetcher::resourceTimingReportTimerFired(TimerBase* timer) {
DCHECK_EQ(timer, &m_resourceTimingReportTimer);
- Vector<std::unique_ptr<ResourceTimingInfo>> timingReports;
+ Vector<RefPtr<ResourceTimingInfo>> timingReports;
timingReports.swap(m_scheduledResourceTimingReports);
for (const auto& timingInfo : timingReports)
context().addResourceTiming(*timingInfo);
@@ -759,7 +759,7 @@ void ResourceFetcher::storePerformanceTimingInitiatorInformation(
ResourceTimingInfo::create(fetchInitiator, startTime, isMainResource);
}
- std::unique_ptr<ResourceTimingInfo> info =
+ RefPtr<ResourceTimingInfo> info =
ResourceTimingInfo::create(fetchInitiator, startTime, isMainResource);
if (resource->isCacheValidator()) {
@@ -1166,7 +1166,7 @@ void ResourceFetcher::handleLoaderFinish(Resource* resource,
encodedDataLength == -1 ? 0 : encodedDataLength);
}
}
- if (std::unique_ptr<ResourceTimingInfo> info =
+ if (RefPtr<ResourceTimingInfo> info =
m_resourceTimingInfoMap.take(resource)) {
// Store redirect responses that were packed inside the final response.
addRedirectsToTimingInfo(resource, info.get());

Powered by Google App Engine
This is Rietveld 408576698