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

Unified Diff: Source/modules/fetch/GlobalFetch.cpp

Issue 838003006: Add use counters for Fetch API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 11 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
« no previous file with comments | « Source/modules/fetch/Body.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/GlobalFetch.cpp
diff --git a/Source/modules/fetch/GlobalFetch.cpp b/Source/modules/fetch/GlobalFetch.cpp
index eb921833f42644187db3106370f9d9ec39057840..7be8c0abda60b66399b9fb1fb3b5ce45c7914093 100644
--- a/Source/modules/fetch/GlobalFetch.cpp
+++ b/Source/modules/fetch/GlobalFetch.cpp
@@ -7,6 +7,7 @@
#include "core/dom/ActiveDOMObject.h"
#include "core/frame/LocalDOMWindow.h"
+#include "core/frame/UseCounter.h"
#include "core/workers/WorkerGlobalScope.h"
#include "modules/fetch/FetchManager.h"
#include "modules/fetch/Request.h"
@@ -100,11 +101,14 @@ private:
ScriptPromise GlobalFetch::fetch(ScriptState* scriptState, DOMWindow& window, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState)
{
+ UseCounter::count(window.executionContext(), UseCounter::Fetch);
return GlobalFetchImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), window.executionContext()).fetch(scriptState, input, init, exceptionState);
}
ScriptPromise GlobalFetch::fetch(ScriptState* scriptState, WorkerGlobalScope& worker, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState)
{
+ // Note that UseCounter doesn't work with SharedWorker or ServiceWorker.
+ UseCounter::count(worker.executionContext(), UseCounter::Fetch);
return GlobalFetchImpl<WorkerGlobalScope>::from(worker, worker.executionContext()).fetch(scriptState, input, init, exceptionState);
}
« no previous file with comments | « Source/modules/fetch/Body.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698