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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioContext.cpp

Issue 2031393003: WebAudio: record whether user gesture was available and provided. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/webaudio/AudioContext.h" 5 #include "modules/webaudio/AudioContext.h"
6 6
7 #include "bindings/core/v8/ExceptionMessages.h" 7 #include "bindings/core/v8/ExceptionMessages.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 resolver->resolve(); 109 resolver->resolve();
110 } 110 }
111 111
112 return promise; 112 return promise;
113 } 113 }
114 114
115 ScriptPromise AudioContext::resumeContext(ScriptState* scriptState) 115 ScriptPromise AudioContext::resumeContext(ScriptState* scriptState)
116 { 116 {
117 ASSERT(isMainThread()); 117 ASSERT(isMainThread());
118 118
119 recordUserGesture();
Raymond Toy 2016/06/03 17:57:52 I think you probably want to do this around line 1
mlamouri (slow - plz ping) 2016/06/05 14:44:57 Done.
120
119 if (isContextClosed()) { 121 if (isContextClosed()) {
120 return ScriptPromise::rejectWithDOMException( 122 return ScriptPromise::rejectWithDOMException(
121 scriptState, 123 scriptState,
122 DOMException::create( 124 DOMException::create(
123 InvalidAccessError, 125 InvalidAccessError,
124 "cannot resume a closed AudioContext")); 126 "cannot resume a closed AudioContext"));
125 } 127 }
126 128
127 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 129 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
128 ScriptPromise promise = resolver->promise(); 130 ScriptPromise promise = resolver->promise();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 ASSERT(destination()); 193 ASSERT(destination());
192 194
193 if (contextState() == Running) { 195 if (contextState() == Running) {
194 destination()->audioDestinationHandler().stopRendering(); 196 destination()->audioDestinationHandler().stopRendering();
195 setContextState(Suspended); 197 setContextState(Suspended);
196 deferredTaskHandler().clearHandlersToBeDeleted(); 198 deferredTaskHandler().clearHandlersToBeDeleted();
197 } 199 }
198 } 200 }
199 201
200 } // namespace blink 202 } // namespace blink
201
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698