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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1248643004: Test distillability without JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@early
Patch Set: fix oopsies Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 15359a4fb8625690534dc216358b3b89c4b013b6..927127132f35af3432aed96135d1e32e33d9d5ef 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -68,6 +68,7 @@
#include "core/dom/DOMImplementation.h"
#include "core/dom/DocumentFragment.h"
#include "core/dom/DocumentLifecycleObserver.h"
+#include "core/dom/DocumentStatisticsCollector.h"
#include "core/dom/DocumentType.h"
#include "core/dom/Element.h"
#include "core/dom/ElementDataCache.h"
@@ -215,6 +216,7 @@
#include "platform/weborigin/SchemeRegistry.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/Platform.h"
+#include "public/platform/WebDistillability.h"
#include "public/platform/WebFrameScheduler.h"
#include "wtf/CurrentTime.h"
#include "wtf/DateMath.h"
@@ -4598,6 +4600,8 @@ void Document::finishedParsing()
InspectorInstrumentation::domContentLoadedEventFired(frame.get());
}
+ m_statisticsCollector.setReadyToCollect();
+
// Schedule dropping of the ElementDataCache. We keep it alive for a while after parsing finishes
// so that dynamically inserted content can also benefit from sharing optimizations.
// Note that we don't refresh the timer on cache access since that could lead to huge caches being kept
@@ -5700,6 +5704,11 @@ WebTaskRunner* Document::loadingTaskRunner() const
return Platform::current()->currentThread()->scheduler()->loadingTaskRunner();
}
+WebDistillabilityFeatures Document::distillabilityFeatures()
+{
+ return m_statisticsCollector.collectStatistics(*this);
+}
+
DEFINE_TRACE(Document)
{
#if ENABLE(OILPAN)

Powered by Google App Engine
This is Rietveld 408576698