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

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

Issue 2909613002: Replaced usage of RefPtr::Release with std::move wraps. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 if (policy == kUse && !resource->StillNeedsLoad() && 324 if (policy == kUse && !resource->StillNeedsLoad() &&
325 !validated_urls_.Contains(params.GetResourceRequest().Url())) { 325 !validated_urls_.Contains(params.GetResourceRequest().Url())) {
326 // Resources loaded from memory cache should be reported the first time 326 // Resources loaded from memory cache should be reported the first time
327 // they're used. 327 // they're used.
328 RefPtr<ResourceTimingInfo> info = ResourceTimingInfo::Create( 328 RefPtr<ResourceTimingInfo> info = ResourceTimingInfo::Create(
329 params.Options().initiator_info.name, MonotonicallyIncreasingTime(), 329 params.Options().initiator_info.name, MonotonicallyIncreasingTime(),
330 resource->GetType() == Resource::kMainResource); 330 resource->GetType() == Resource::kMainResource);
331 PopulateTimingInfo(info.Get(), resource); 331 PopulateTimingInfo(info.Get(), resource);
332 info->ClearLoadTimings(); 332 info->ClearLoadTimings();
333 info->SetLoadFinishTime(info->InitialTime()); 333 info->SetLoadFinishTime(info->InitialTime());
334 scheduled_resource_timing_reports_.push_back(info.Release()); 334 scheduled_resource_timing_reports_.push_back(std::move(info));
335 if (!resource_timing_report_timer_.IsActive()) 335 if (!resource_timing_report_timer_.IsActive())
336 resource_timing_report_timer_.StartOneShot(0, BLINK_FROM_HERE); 336 resource_timing_report_timer_.StartOneShot(0, BLINK_FROM_HERE);
337 } 337 }
338 338
339 if (validated_urls_.size() >= kMaxValidatedURLsSize) { 339 if (validated_urls_.size() >= kMaxValidatedURLsSize) {
340 validated_urls_.clear(); 340 validated_urls_.clear();
341 } 341 }
342 validated_urls_.insert(params.GetResourceRequest().Url()); 342 validated_urls_.insert(params.GetResourceRequest().Url());
343 } 343 }
344 344
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 833
834 if (resource->IsCacheValidator()) { 834 if (resource->IsCacheValidator()) {
835 const AtomicString& timing_allow_origin = 835 const AtomicString& timing_allow_origin =
836 resource->GetResponse().HttpHeaderField(HTTPNames::Timing_Allow_Origin); 836 resource->GetResponse().HttpHeaderField(HTTPNames::Timing_Allow_Origin);
837 if (!timing_allow_origin.IsEmpty()) 837 if (!timing_allow_origin.IsEmpty())
838 info->SetOriginalTimingAllowOrigin(timing_allow_origin); 838 info->SetOriginalTimingAllowOrigin(timing_allow_origin);
839 } 839 }
840 840
841 if (!is_main_resource || 841 if (!is_main_resource ||
842 Context().UpdateTimingInfoForIFrameNavigation(info.Get())) { 842 Context().UpdateTimingInfoForIFrameNavigation(info.Get())) {
843 resource_timing_info_map_.insert(resource, info.Release()); 843 resource_timing_info_map_.insert(resource, std::move(info));
844 } 844 }
845 } 845 }
846 846
847 void ResourceFetcher::RecordResourceTimingOnRedirect( 847 void ResourceFetcher::RecordResourceTimingOnRedirect(
848 Resource* resource, 848 Resource* resource,
849 const ResourceResponse& redirect_response, 849 const ResourceResponse& redirect_response,
850 bool cross_origin) { 850 bool cross_origin) {
851 ResourceTimingInfoMap::iterator it = resource_timing_info_map_.find(resource); 851 ResourceTimingInfoMap::iterator it = resource_timing_info_map_.find(resource);
852 if (it != resource_timing_info_map_.end()) { 852 if (it != resource_timing_info_map_.end()) {
853 it->value->AddRedirect(redirect_response, cross_origin); 853 it->value->AddRedirect(redirect_response, cross_origin);
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 visitor->Trace(archive_); 1659 visitor->Trace(archive_);
1660 visitor->Trace(loaders_); 1660 visitor->Trace(loaders_);
1661 visitor->Trace(non_blocking_loaders_); 1661 visitor->Trace(non_blocking_loaders_);
1662 visitor->Trace(document_resources_); 1662 visitor->Trace(document_resources_);
1663 visitor->Trace(preloads_); 1663 visitor->Trace(preloads_);
1664 visitor->Trace(matched_preloads_); 1664 visitor->Trace(matched_preloads_);
1665 visitor->Trace(resource_timing_info_map_); 1665 visitor->Trace(resource_timing_info_map_);
1666 } 1666 }
1667 1667
1668 } // namespace blink 1668 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698