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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1426673009: Log UMA for navigation start timestamp skew for browser-initiated loads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation_start_renderer
Patch Set: Created 5 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // stack. 468 // stack.
469 base::TimeTicks SanitizeNavigationTiming( 469 base::TimeTicks SanitizeNavigationTiming(
470 blink::WebFrameLoadType load_type, 470 blink::WebFrameLoadType load_type,
471 const base::TimeTicks& browser_navigation_start, 471 const base::TimeTicks& browser_navigation_start,
472 const base::TimeTicks& renderer_navigation_start) { 472 const base::TimeTicks& renderer_navigation_start) {
473 if (load_type != blink::WebFrameLoadType::Standard) 473 if (load_type != blink::WebFrameLoadType::Standard)
474 return base::TimeTicks(); 474 return base::TimeTicks();
475 DCHECK(!browser_navigation_start.is_null()); 475 DCHECK(!browser_navigation_start.is_null());
476 base::TimeTicks navigation_start = 476 base::TimeTicks navigation_start =
477 std::min(browser_navigation_start, renderer_navigation_start); 477 std::min(browser_navigation_start, renderer_navigation_start);
478 // TODO(csharrison) Investigate how big a problem the cross process 478 base::TimeDelta difference =
479 // monotonicity really is and on what platforms. Log UMA for: 479 renderer_navigation_start - browser_navigation_start;
480 // |renderer_navigation_start - browser_navigation_start| 480 if (difference > base::TimeDelta()) {
481 UMA_HISTOGRAM_CUSTOM_TIMES(
482 "Navigation.Start.RendererBrowserDifference.Positive", difference,
483 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromSeconds(5),
Alexei Svitkine (slow) 2015/11/06 16:53:18 Suggest using UMA_HISTOGRAM_TIMES(). It gives you
484 50);
485 } else {
486 UMA_HISTOGRAM_CUSTOM_TIMES(
487 "Navigation.Start.RendererBrowserDifference.Negative", -difference,
488 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromSeconds(5),
489 50);
490 }
481 return navigation_start; 491 return navigation_start;
482 } 492 }
483 493
484 // PlzNavigate 494 // PlzNavigate
485 CommonNavigationParams MakeCommonNavigationParams( 495 CommonNavigationParams MakeCommonNavigationParams(
486 blink::WebURLRequest* request, 496 blink::WebURLRequest* request,
487 bool should_replace_current_entry) { 497 bool should_replace_current_entry) {
488 const RequestExtraData kEmptyData; 498 const RequestExtraData kEmptyData;
489 const RequestExtraData* extra_data = 499 const RequestExtraData* extra_data =
490 static_cast<RequestExtraData*>(request->extraData()); 500 static_cast<RequestExtraData*>(request->extraData());
(...skipping 4853 matching lines...) Expand 10 before | Expand all | Expand 10 after
5344 mojo::ServiceProviderPtr service_provider; 5354 mojo::ServiceProviderPtr service_provider;
5345 mojo::URLRequestPtr request(mojo::URLRequest::New()); 5355 mojo::URLRequestPtr request(mojo::URLRequest::New());
5346 request->url = mojo::String::From(url); 5356 request->url = mojo::String::From(url);
5347 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), 5357 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider),
5348 nullptr, nullptr, 5358 nullptr, nullptr,
5349 base::Bind(&OnGotContentHandlerID)); 5359 base::Bind(&OnGotContentHandlerID));
5350 return service_provider.Pass(); 5360 return service_provider.Pass();
5351 } 5361 }
5352 5362
5353 } // namespace content 5363 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698