void WorkerGlobalScope::countDeprecation(UseCounter::Feature feature) const { // FIXME: How should we count features for shared/service workers? ASSERT(isSharedWorkerGlobalScope() || isServiceWorkerGlobalScope() || isCompositorWorkerGlobalScope()); // For each deprecated feature, send console message at most once // per worker lifecycle. if (!m_deprecationWarningBits.hasRecordedMeasurement(feature)) { m_deprecationWarningBits.recordMeasurement(feature); ASSERT(!Deprecation::deprecationMessage(feature).isEmpty()); ASSERT(getExecutionContext()); getExecutionContext()->addConsoleMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, Deprecation::deprecationMessage(feature))); } }
void WorkerGlobalScope::countDeprecation(UseCounter::Feature feature) const { // TODO(nhiroki): How should we count features for shared/service workers? // (http://crbug.com/376039) DCHECK(isSharedWorkerGlobalScope() || isServiceWorkerGlobalScope() || isCompositorWorkerGlobalScope()); DCHECK(feature != UseCounter::OBSOLETE_PageDestruction); DCHECK(feature < UseCounter::NumberOfFeatures); // For each deprecated feature, send console message at most once // per worker lifecycle. if (!m_deprecationWarningBits.quickGet(feature)) { m_deprecationWarningBits.quickSet(feature); DCHECK(!Deprecation::deprecationMessage(feature).isEmpty()); DCHECK(getExecutionContext()); getExecutionContext()->addConsoleMessage( ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, Deprecation::deprecationMessage(feature))); } }