| 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 95de635c0081b1f9ec5c6ca89ca5ed9fa52cc07a..564d3e0c0db5200b39dfd169419d4fb551c830c5 100644
|
| --- a/third_party/WebKit/Source/core/frame/UseCounter.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/UseCounter.cpp
|
| @@ -1165,6 +1165,24 @@ void UseCounter::didCommitLoad(KURL url) {
|
| }
|
| }
|
|
|
| +// static
|
| +const Document* UseCounter::singleOwnerDocument(
|
| + const StyleSheetContents* styleSheetContents) {
|
| + // FIXME: We may want to handle stylesheets that have multiple owners
|
| + // https://crbug.com/242125
|
| + if (styleSheetContents && styleSheetContents->hasSingleOwnerNode())
|
| + return styleSheetContents->singleOwnerDocument();
|
| + return nullptr;
|
| +}
|
| +
|
| +// static
|
| +const Document* UseCounter::singleOwnerDocument(
|
| + const CSSStyleSheet* styleSheet) {
|
| + if (styleSheet)
|
| + return UseCounter::singleOwnerDocument(styleSheet->contents());
|
| + return nullptr;
|
| +}
|
| +
|
| void UseCounter::count(const Frame* frame, Feature feature) {
|
| if (!frame)
|
| return;
|
| @@ -1250,26 +1268,6 @@ void UseCounter::count(Feature feature) {
|
| recordMeasurement(feature);
|
| }
|
|
|
| -UseCounter* UseCounter::getFrom(const Document* document) {
|
| - if (document && document->frameHost())
|
| - return &document->frameHost()->useCounter();
|
| - return 0;
|
| -}
|
| -
|
| -UseCounter* UseCounter::getFrom(const CSSStyleSheet* sheet) {
|
| - if (sheet)
|
| - return getFrom(sheet->contents());
|
| - return 0;
|
| -}
|
| -
|
| -UseCounter* UseCounter::getFrom(const StyleSheetContents* sheetContents) {
|
| - // FIXME: We may want to handle stylesheets that have multiple owners
|
| - // https://crbug.com/242125
|
| - if (sheetContents && sheetContents->hasSingleOwnerNode())
|
| - return getFrom(sheetContents->singleOwnerDocument());
|
| - return 0;
|
| -}
|
| -
|
| EnumerationHistogram& UseCounter::featuresHistogram() const {
|
| // Every SVGImage has it's own Page instance, and multiple web pages can
|
| // share the usage of a single SVGImage. Ideally perhaps we'd delegate
|
|
|