| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "DocumentStatisticsCollector.h" | 5 #include "DocumentStatisticsCollector.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/InputTypeNames.h" | 8 #include "core/InputTypeNames.h" |
| 9 #include "core/dom/ElementTraversal.h" | 9 #include "core/dom/ElementTraversal.h" |
| 10 #include "core/dom/NodeComputedStyle.h" | 10 #include "core/dom/NodeComputedStyle.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (meta.name() == ogType || meta.getAttribute(propertyAttr) == ogType) { | 174 if (meta.name() == ogType || meta.getAttribute(propertyAttr) == ogType) { |
| 175 if (equalIgnoringCase(meta.content(), "article")) { | 175 if (equalIgnoringCase(meta.content(), "article")) { |
| 176 return true; | 176 return true; |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 return false; | 180 return false; |
| 181 } | 181 } |
| 182 | 182 |
| 183 bool isMobileFriendly(Document& document) { | 183 bool isMobileFriendly(Document& document) { |
| 184 if (FrameHost* frameHost = document.frameHost()) | 184 return document.viewportDescription().isSpecifiedByAuthor(); |
| 185 return frameHost->visualViewport().shouldDisableDesktopWorkarounds(); | |
| 186 return false; | |
| 187 } | 185 } |
| 188 | 186 |
| 189 } // namespace | 187 } // namespace |
| 190 | 188 |
| 191 WebDistillabilityFeatures DocumentStatisticsCollector::collectStatistics( | 189 WebDistillabilityFeatures DocumentStatisticsCollector::collectStatistics( |
| 192 Document& document) { | 190 Document& document) { |
| 193 TRACE_EVENT0("blink", "DocumentStatisticsCollector::collectStatistics"); | 191 TRACE_EVENT0("blink", "DocumentStatisticsCollector::collectStatistics"); |
| 194 | 192 |
| 195 WebDistillabilityFeatures features = WebDistillabilityFeatures(); | 193 WebDistillabilityFeatures features = WebDistillabilityFeatures(); |
| 196 | 194 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 220 double elapsedTime = monotonicallyIncreasingTime() - startTime; | 218 double elapsedTime = monotonicallyIncreasingTime() - startTime; |
| 221 | 219 |
| 222 DEFINE_STATIC_LOCAL(CustomCountHistogram, distillabilityHistogram, | 220 DEFINE_STATIC_LOCAL(CustomCountHistogram, distillabilityHistogram, |
| 223 ("WebCore.DistillabilityUs", 1, 1000000, 50)); | 221 ("WebCore.DistillabilityUs", 1, 1000000, 50)); |
| 224 distillabilityHistogram.count(static_cast<int>(1e6 * elapsedTime)); | 222 distillabilityHistogram.count(static_cast<int>(1e6 * elapsedTime)); |
| 225 | 223 |
| 226 return features; | 224 return features; |
| 227 } | 225 } |
| 228 | 226 |
| 229 } // namespace blink | 227 } // namespace blink |
| OLD | NEW |