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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1652983005: Remove Enumeration Histograms from the Blink Platform API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_blink_histograms_5a
Patch Set: Fix misplaced bracket on android Created 4 years, 10 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 4037 matching lines...) Expand 10 before | Expand all | Expand 10 after
4048 } 4048 }
4049 4049
4050 void WebViewImpl::didFinishMainFrameDocumentLoad() 4050 void WebViewImpl::didFinishMainFrameDocumentLoad()
4051 { 4051 {
4052 resumeTreeViewCommitsIfRenderingReady(); 4052 resumeTreeViewCommitsIfRenderingReady();
4053 #if OS(ANDROID) 4053 #if OS(ANDROID)
4054 if (!isInternalURL(mainFrameImpl()->frame()->document()->baseURL()) && page( )->settings().usesEncodingDetector()) { 4054 if (!isInternalURL(mainFrameImpl()->frame()->document()->baseURL()) && page( )->settings().usesEncodingDetector()) {
4055 const Document& document = *mainFrameImpl()->frame()->document(); 4055 const Document& document = *mainFrameImpl()->frame()->document();
4056 4056
4057 // "AutodetectEncoding.Attempted" is of boolean type - either 0 or 1. Us e 2 for the boundary value. 4057 // "AutodetectEncoding.Attempted" is of boolean type - either 0 or 1. Us e 2 for the boundary value.
4058 Platform::current()->histogramEnumeration("AutodetectEncoding.Attempted" , document.attemptedToDetermineEncodingFromContentSniffing(), 2); 4058 DEFINE_STATIC_LOCAL(EnumerationHistogram, autoDetectAttemptedHistogram, ("AutodetectEncoding.Attempted", 2));
4059 autoDetectAttemptedHistogram.count(document.attemptedToDetermineEncoding FromContentSniffing());
4059 if (document.encodingWasDetectedFromContentSniffing()) { 4060 if (document.encodingWasDetectedFromContentSniffing()) {
4060 int encodingId = encodingToUmaId(document.encoding()); 4061 int encodingId = encodingToUmaId(document.encoding());
4061 Platform::current()->histogramEnumeration("AutodetectEncoding.Detect ed", encodingId, WTF_ARRAY_LENGTH(kEncodingNames) + 1); 4062
4063 DEFINE_STATIC_LOCAL(EnumerationHistogram, autoDetectDetectedHistogra m, ("AutodetectEncoding.Detected", WTF_ARRAY_LENGTH(kEncodingNames) + 1));
4064 autoDetectDetectedHistogram.count(encodingId);
4062 } 4065 }
4063 } 4066 }
4064 #endif 4067 #endif
4065 } 4068 }
4066 4069
4067 void WebViewImpl::didRemoveAllPendingStylesheetsInMainFrameDocument() 4070 void WebViewImpl::didRemoveAllPendingStylesheetsInMainFrameDocument()
4068 { 4071 {
4069 Document& document = *mainFrameImpl()->frame()->document(); 4072 Document& document = *mainFrameImpl()->frame()->document();
4070 4073
4071 // For HTML if we have no more stylesheets to load and we're past the body 4074 // For HTML if we have no more stylesheets to load and we're past the body
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
4633 { 4636 {
4634 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4637 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4635 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4638 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4636 if (!page()) 4639 if (!page())
4637 return 1; 4640 return 1;
4638 4641
4639 return page()->deviceScaleFactor(); 4642 return page()->deviceScaleFactor();
4640 } 4643 }
4641 4644
4642 } // namespace blink 4645 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698