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

Side by Side Diff: third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.cpp

Issue 1578263006: Add metrics for usage of permission features from iframes in blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/notifications/Notification.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "modules/webmidi/NavigatorWebMIDI.h" 31 #include "modules/webmidi/NavigatorWebMIDI.h"
32 32
33 #include "bindings/core/v8/ScriptPromise.h" 33 #include "bindings/core/v8/ScriptPromise.h"
34 #include "bindings/core/v8/ScriptPromiseResolver.h" 34 #include "bindings/core/v8/ScriptPromiseResolver.h"
35 #include "core/dom/DOMException.h" 35 #include "core/dom/DOMException.h"
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
38 #include "core/frame/Navigator.h" 38 #include "core/frame/Navigator.h"
39 #include "core/frame/UseCounter.h"
39 #include "modules/webmidi/MIDIAccessInitializer.h" 40 #include "modules/webmidi/MIDIAccessInitializer.h"
40 #include "modules/webmidi/MIDIOptions.h" 41 #include "modules/webmidi/MIDIOptions.h"
41 42
42 namespace blink { 43 namespace blink {
43 44
44 NavigatorWebMIDI::NavigatorWebMIDI(LocalFrame* frame) 45 NavigatorWebMIDI::NavigatorWebMIDI(LocalFrame* frame)
45 : DOMWindowProperty(frame) 46 : DOMWindowProperty(frame)
46 { 47 {
47 } 48 }
48 49
(...skipping 26 matching lines...) Expand all
75 { 76 {
76 return NavigatorWebMIDI::from(navigator).requestMIDIAccess(scriptState, opti ons); 77 return NavigatorWebMIDI::from(navigator).requestMIDIAccess(scriptState, opti ons);
77 } 78 }
78 79
79 ScriptPromise NavigatorWebMIDI::requestMIDIAccess(ScriptState* scriptState, cons t MIDIOptions& options) 80 ScriptPromise NavigatorWebMIDI::requestMIDIAccess(ScriptState* scriptState, cons t MIDIOptions& options)
80 { 81 {
81 if (!frame() || frame()->document()->activeDOMObjectsAreStopped()) { 82 if (!frame() || frame()->document()->activeDOMObjectsAreStopped()) {
82 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(AbortError, "The frame is not working.")); 83 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(AbortError, "The frame is not working."));
83 } 84 }
84 85
86 UseCounter::countCrossOriginIframe(*frame()->document(), UseCounter::Request MIDIAccessIframe);
85 return MIDIAccessInitializer::start(scriptState, options); 87 return MIDIAccessInitializer::start(scriptState, options);
86 } 88 }
87 89
88 } // namespace blink 90 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/notifications/Notification.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698