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

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

Issue 2172613002: Renderer-side changes for NoState Prefetch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests Created 4 years, 4 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 44900c503d5a46d869bd335d49f37958e2b0c9ce..ee9bec6a8a6de107dd070595a0dc671111ffc1fb 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -193,6 +193,7 @@
#include "core/loader/FrameLoaderClient.h"
#include "core/loader/ImageLoader.h"
#include "core/loader/NavigationScheduler.h"
+#include "core/loader/PrerendererClient.h"
#include "core/loader/appcache/ApplicationCacheHost.h"
#include "core/observer/ResizeObserverController.h"
#include "core/page/ChromeClient.h"
@@ -1320,6 +1321,15 @@ PageVisibilityState Document::pageVisibilityState() const
return m_frame->page()->visibilityState();
}
+bool Document::isPrefetchOnly() const
+{
+ if (!m_frame || !m_frame->page())
+ return false;
+
+ PrerendererClient* prerendererClient = PrerendererClient::from(m_frame->page());
+ return prerendererClient && prerendererClient->isPrefetchOnly();
+}
+
String Document::visibilityState() const
{
return pageVisibilityStateString(pageVisibilityState());

Powered by Google App Engine
This is Rietveld 408576698