void UseCounter::count(const Document& document, Feature feature) { FrameHost* host = document.frameHost(); if (!host) return; ASSERT(host->useCounter().deprecationMessage(feature).isEmpty()); host->useCounter().recordMeasurement(feature); }
void UseCounter::count(const Frame* frame, Feature feature) { if (!frame) return; FrameHost* host = frame->host(); if (!host) return; ASSERT(host->useCounter().deprecationMessage(feature).isEmpty()); host->useCounter().recordMeasurement(feature); }
void UseCounter::countDeprecation(const Document& document, Feature feature) { FrameHost* host = document.frameHost(); if (!host) return; if (host->useCounter().recordMeasurement(feature)) { ASSERT(!host->useCounter().deprecationMessage(feature).isEmpty()); host->console().addMessage(DeprecationMessageSource, WarningMessageLevel, host->useCounter().deprecationMessage(feature)); } }
void UseCounter::countDeprecation(const LocalFrame* frame, Feature feature) { if (!frame) return; FrameHost* host = frame->host(); if (!host) return; if (host->useCounter().recordMeasurement(feature)) { ASSERT(!host->useCounter().deprecationMessage(feature).isEmpty()); frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, host->useCounter().deprecationMessage(feature))); } }
bool UseCounter::isCounted(Document& document, Feature feature) { Frame* frame = document.frame(); if (!frame) return false; FrameHost* host = frame->host(); if (!host) return false; return host->useCounter().hasRecordedMeasurement(feature); }
bool UseCounter::isCounted(Document& document, const String& string) { Frame* frame = document.frame(); if (!frame) return false; FrameHost* host = frame->host(); if (!host) return false; CSSPropertyID propertyID = cssPropertyID(string); if (propertyID == CSSPropertyInvalid) return false; return host->useCounter().isCounted(propertyID); }