OLD | NEW |
---|---|
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 Loading... | |
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().SchemeIsBlob()) { | |
nasko
2017/06/19 18:16:55
Maybe we can log these only for http/https cases,
clamy
2017/06/20 15:14:35
Done.
| |
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 Loading... | |
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 |
OLD | NEW |