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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2944033002: PlzNavigate: improve bf navigations metrics (Closed)
Patch Set: Addressed comments 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 std::unique_ptr<net::URLRequest> request, 2233 std::unique_ptr<net::URLRequest> request,
2234 std::unique_ptr<ResourceHandler> handler) { 2234 std::unique_ptr<ResourceHandler> handler) {
2235 DCHECK(!request->is_pending()); 2235 DCHECK(!request->is_pending());
2236 ResourceRequestInfoImpl* info = 2236 ResourceRequestInfoImpl* info =
2237 ResourceRequestInfoImpl::ForRequest(request.get()); 2237 ResourceRequestInfoImpl::ForRequest(request.get());
2238 2238
2239 // Log metrics for back-forward navigations. 2239 // Log metrics for back-forward navigations.
2240 // TODO(clamy): Remove this once we understand the reason behind the 2240 // TODO(clamy): Remove this once we understand the reason behind the
2241 // back-forward PLT regression with PlzNavigate 2241 // back-forward PLT regression with PlzNavigate
2242 if ((info->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK) && 2242 if ((info->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK) &&
2243 IsResourceTypeFrame(info->GetResourceType())) { 2243 IsResourceTypeFrame(info->GetResourceType()) &&
2244 request->url().SchemeIsHTTPOrHTTPS()) {
2244 LogBackForwardNavigationFlagsHistogram(request->load_flags()); 2245 LogBackForwardNavigationFlagsHistogram(request->load_flags());
2245 } 2246 }
2246 2247
2247 if ((TimeTicks::Now() - last_user_gesture_time_) < 2248 if ((TimeTicks::Now() - last_user_gesture_time_) <
2248 TimeDelta::FromMilliseconds(kUserGestureWindowMs)) { 2249 TimeDelta::FromMilliseconds(kUserGestureWindowMs)) {
2249 request->SetLoadFlags(request->load_flags() | net::LOAD_MAYBE_USER_GESTURE); 2250 request->SetLoadFlags(request->load_flags() | net::LOAD_MAYBE_USER_GESTURE);
2250 } 2251 }
2251 2252
2252 // Add the memory estimate that starting this request will consume. 2253 // Add the memory estimate that starting this request will consume.
2253 info->set_memory_cost(CalculateApproximateMemoryCost(request.get())); 2254 info->set_memory_cost(CalculateApproximateMemoryCost(request.get()));
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2700 &throttles); 2701 &throttles);
2701 if (!throttles.empty()) { 2702 if (!throttles.empty()) {
2702 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2703 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2703 std::move(throttles))); 2704 std::move(throttles)));
2704 } 2705 }
2705 } 2706 }
2706 return handler; 2707 return handler;
2707 } 2708 }
2708 2709
2709 } // namespace content 2710 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.cc ('k') | content/browser/loader/resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698