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

Unified Diff: third_party/WebKit/Source/core/frame/UseCounter.cpp

Issue 2720933003: Removed FrameHost::useCounter() (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/UseCounter.cpp
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.cpp b/third_party/WebKit/Source/core/frame/UseCounter.cpp
index 79272a3075bb1af7a4b11567b0cf8e1fbf853488..fe6fdb54807d70e7998cb34e2cfc91b56608fe6e 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.cpp
+++ b/third_party/WebKit/Source/core/frame/UseCounter.cpp
@@ -31,9 +31,9 @@
#include "core/dom/ExecutionContext.h"
#include "core/frame/Deprecation.h"
#include "core/frame/FrameConsole.h"
-#include "core/frame/FrameHost.h"
#include "core/frame/LocalFrame.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/page/Page.h"
#include "core/workers/WorkerOrWorkletGlobalScope.h"
#include "platform/Histogram.h"
#include "platform/instrumentation/tracing/TraceEvent.h"
@@ -1173,11 +1173,11 @@ void UseCounter::didCommitLoad(KURL url) {
void UseCounter::count(const Frame* frame, Feature feature) {
if (!frame)
return;
- FrameHost* host = frame->host();
- if (!host)
+ Page* page = frame->page();
+ if (!page)
return;
- host->useCounter().count(feature);
+ page->useCounter().count(feature);
}
void UseCounter::count(const Document& document, Feature feature) {
@@ -1185,13 +1185,10 @@ void UseCounter::count(const Document& document, Feature feature) {
}
bool UseCounter::isCounted(Document& document, Feature feature) {
- Frame* frame = document.frame();
- if (!frame)
- return false;
- FrameHost* host = frame->host();
- if (!host)
+ Page* page = document.page();
+ if (!page)
return false;
- return host->useCounter().hasRecordedMeasurement(feature);
+ return page->useCounter().hasRecordedMeasurement(feature);
}
bool UseCounter::isCounted(CSSPropertyID unresolvedProperty) {
@@ -1204,17 +1201,14 @@ void UseCounter::addObserver(Observer* observer) {
}
bool UseCounter::isCounted(Document& document, const String& string) {
- Frame* frame = document.frame();
- if (!frame)
- return false;
- FrameHost* host = frame->host();
- if (!host)
+ Page* page = document.page();
+ if (!page)
return false;
CSSPropertyID unresolvedProperty = unresolvedCSSPropertyID(string);
if (unresolvedProperty == CSSPropertyInvalid)
return false;
- return host->useCounter().isCounted(unresolvedProperty);
+ return page->useCounter().isCounted(unresolvedProperty);
}
void UseCounter::count(ExecutionContext* context, Feature feature) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameHost.cpp ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698