blob: 0a19f57a160fe7cd897e3010a3f1c06be018df03 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/workers/main_thread_worklet_reporting_proxy.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/deprecation.h"
#include "third_party/blink/renderer/core/frame/use_counter.h"
namespace blink {
MainThreadWorkletReportingProxy::MainThreadWorkletReportingProxy(
Document* document)
: document_(document) {}
void MainThreadWorkletReportingProxy::CountFeature(WebFeature feature) {
DCHECK(IsMainThread());
// A parent document is on the same thread, so just record API use in the
// document's UseCounter.
UseCounter::Count(document_->GetFrame(), feature);
}
void MainThreadWorkletReportingProxy::CountDeprecation(WebFeature feature) {
DCHECK(IsMainThread());
// A parent document is on the same thread, so just record API use in the
// document's UseCounter.
Deprecation::CountDeprecation(document_->GetFrame(), feature);
}
void MainThreadWorkletReportingProxy::DidTerminateWorkerThread() {
// MainThreadWorklet does not start and terminate a thread.
NOTREACHED();
}
} // namespace blink