Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1130)

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp

Issue 2658603003: ServiceWorker: Enable UseCounter for ServiceWorkerGlobalScope (Closed)
Patch Set: int32_t -> uint32_t Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
index fc598759a55cd054b1a42bdef9fb241710551f72..0e35aeb0d1f832bc905a81296b72355ea462aebd 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp
@@ -29,6 +29,8 @@
*/
#include "modules/serviceworkers/ServiceWorkerContainer.h"
+#include <memory>
+#include <utility>
#include "bindings/core/v8/CallbackPromiseAdapter.h"
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
@@ -42,6 +44,7 @@
#include "core/dom/ExecutionContext.h"
#include "core/dom/MessagePort.h"
#include "core/events/MessageEvent.h"
+#include "core/frame/Deprecation.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/UseCounter.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
@@ -59,8 +62,6 @@
#include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
#include "wtf/PtrUtil.h"
-#include <memory>
-#include <utility>
namespace blink {
@@ -458,6 +459,17 @@ void ServiceWorkerContainer::dispatchMessageEvent(
String() /* lastEventId */, source, String() /* suborigin */));
}
+void ServiceWorkerContainer::countFeature(uint32_t feature) {
+ if (!getExecutionContext())
+ return;
+ UseCounter::Feature useCounterFeature =
+ static_cast<UseCounter::Feature>(feature);
+ if (Deprecation::deprecationMessage(useCounterFeature).isEmpty())
+ UseCounter::count(getExecutionContext(), useCounterFeature);
+ else
+ Deprecation::countDeprecation(getExecutionContext(), useCounterFeature);
+}
+
const AtomicString& ServiceWorkerContainer::interfaceName() const {
return EventTargetNames::ServiceWorkerContainer;
}

Powered by Google App Engine
This is Rietveld 408576698