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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/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 2a8f5d8b0e7051695131fc84db5839fbbbbcaf66..554ef07d132cb9a38bbd276a051c2edb736dd222 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -52,7 +52,6 @@
#include "public/platform/WebURLRequest.h"
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
-#include <memory>
using blink::WebURLRequest;
@@ -293,7 +292,7 @@ void ResourceFetcher::requestLoadStarted(unsigned long identifier, Resource* res
if (type == ResourceLoadingFromCache && !resource->stillNeedsLoad() && !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(request.options().initiatorInfo.name, monotonicallyIncreasingTime(), resource->getType() == Resource::MainResource);
+ OwnPtr<ResourceTimingInfo> info = ResourceTimingInfo::create(request.options().initiatorInfo.name, monotonicallyIncreasingTime(), resource->getType() == Resource::MainResource);
populateResourceTiming(info.get(), resource);
info->clearLoadTimings();
info->setLoadFinishTime(info->initialTime());
@@ -308,9 +307,9 @@ void ResourceFetcher::requestLoadStarted(unsigned long identifier, Resource* res
m_validatedURLs.add(request.resourceRequest().url());
}
-static std::unique_ptr<TracedValue> urlForTraceEvent(const KURL& url)
+static PassOwnPtr<TracedValue> urlForTraceEvent(const KURL& url)
{
- std::unique_ptr<TracedValue> value = TracedValue::create();
+ OwnPtr<TracedValue> value = TracedValue::create();
value->setString("url", url.getString());
return value;
}
@@ -525,7 +524,7 @@ Resource* ResourceFetcher::requestResource(FetchRequest& request, const Resource
void ResourceFetcher::resourceTimingReportTimerFired(Timer<ResourceFetcher>* timer)
{
ASSERT_UNUSED(timer, timer == &m_resourceTimingReportTimer);
- Vector<std::unique_ptr<ResourceTimingInfo>> timingReports;
+ Vector<OwnPtr<ResourceTimingInfo>> timingReports;
timingReports.swap(m_scheduledResourceTimingReports);
for (const auto& timingInfo : timingReports)
context().addResourceTiming(*timingInfo);
@@ -610,7 +609,7 @@ void ResourceFetcher::storeResourceTimingInitiatorInformation(Resource* resource
return;
bool isMainResource = resource->getType() == Resource::MainResource;
- std::unique_ptr<ResourceTimingInfo> info = ResourceTimingInfo::create(fetchInitiator, monotonicallyIncreasingTime(), isMainResource);
+ OwnPtr<ResourceTimingInfo> info = ResourceTimingInfo::create(fetchInitiator, monotonicallyIncreasingTime(), isMainResource);
if (resource->isCacheValidator()) {
const AtomicString& timingAllowOrigin = resource->response().httpHeaderField(HTTPNames::Timing_Allow_Origin);
@@ -912,7 +911,7 @@ void ResourceFetcher::didFinishLoading(Resource* resource, double finishTime, in
DCHECK(!m_loaders.contains(resource->loader()));
DCHECK(finishReason == DidFinishFirstPartInMultipart || !m_nonBlockingLoaders.contains(resource->loader()));
- if (std::unique_ptr<ResourceTimingInfo> info = m_resourceTimingInfoMap.take(resource)) {
+ if (OwnPtr<ResourceTimingInfo> info = m_resourceTimingInfoMap.take(resource)) {
if (resource->response().isHTTP() && resource->response().httpStatusCode() < 400) {
populateResourceTiming(info.get(), resource);
info->setLoadFinishTime(finishTime);
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.h ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698