void HostsUsingFeatures::documentDetached(Document& document) { HostsUsingFeatures::Value counter = document.HostsUsingFeaturesValue(); if (counter.isEmpty()) return; const KURL& url = document.url(); if (!url.protocolIsInHTTPFamily()) return; m_urlAndValues.append(std::make_pair(url, counter)); document.HostsUsingFeaturesValue().clear(); DCHECK(document.HostsUsingFeaturesValue().isEmpty()); }
void HostsUsingFeatures::countHostOrIsolatedWorldHumanReadableName(const ScriptState* scriptState, EventTarget& target, Feature feature) { if (!scriptState) return; Document* document = documentFromEventTarget(target); if (!document) return; if (scriptState->world().isMainWorld()) { document->HostsUsingFeaturesValue().count(feature); return; } if (Page* page = document->page()) page->hostsUsingFeatures().countName(feature, scriptState->world().isolatedWorldHumanReadableName()); }
void HostsUsingFeatures::countAnyWorld(Document& document, Feature feature) { document.HostsUsingFeaturesValue().count(feature); }