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

Unified Diff: third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp

Issue 2821233002: Add UseCounter feature for requestMidiAccess with sysex:true (Closed)
Patch Set: rename as per comment Created 3 years, 8 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 | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp
diff --git a/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp b/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp
index 2065ee40a922ee66f691714e8cc5daa1a63af39a..e67f2e32fdefb01bf58c03e64044299c22c1f060 100644
--- a/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp
+++ b/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp
@@ -79,9 +79,14 @@ ScriptPromise NavigatorWebMIDI::requestMIDIAccess(ScriptState* script_state,
DOMException::Create(kAbortError, "The frame is not working."));
}
- UseCounter::CountCrossOriginIframe(
- *ToDocument(ExecutionContext::From(script_state)),
- UseCounter::kRequestMIDIAccessIframe);
+ Document& document = *ToDocument(ExecutionContext::From(script_state));
+ if (options.hasSysex() && options.sysex()) {
+ UseCounter::Count(document, UseCounter::kRequestMIDIAccessWithSysExOption);
+ UseCounter::CountCrossOriginIframe(
+ document, UseCounter::kRequestMIDIAccessIframeWithSysExOption);
+ }
+ UseCounter::CountCrossOriginIframe(document,
+ UseCounter::kRequestMIDIAccessIframe);
return MIDIAccessInitializer::Start(script_state, options);
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698