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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h

Issue 2314903002: Web Audio: when media playback requires a user gesture, apply rule to cross origin iframes. (Closed)
Patch Set: apply changes from TPAC discussion Created 4 years, 2 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 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 // - it has been stopped by its execution context. 252 // - it has been stopped by its execution context.
253 virtual bool isContextClosed() const { return m_isCleared; } 253 virtual bool isContextClosed() const { return m_isCleared; }
254 254
255 // Get the security origin for this audio context. 255 // Get the security origin for this audio context.
256 SecurityOrigin* getSecurityOrigin() const; 256 SecurityOrigin* getSecurityOrigin() const;
257 257
258 // Get the PeriodicWave for the specified oscillator type. The table is ini tialized internally 258 // Get the PeriodicWave for the specified oscillator type. The table is ini tialized internally
259 // if necessary. 259 // if necessary.
260 PeriodicWave* periodicWave(int type); 260 PeriodicWave* periodicWave(int type);
261 261
262 // Check whether the AudioContext requires a user gesture and whether the
263 // current stack is processing user gesture and record these information in
264 // a histogram.
265 void recordUserGestureState();
266
267 protected: 262 protected:
268 explicit BaseAudioContext(Document*); 263 explicit BaseAudioContext(Document*);
269 BaseAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames , float sampleRate); 264 BaseAudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames , float sampleRate);
270 265
271 void initialize(); 266 void initialize();
272 void uninitialize(); 267 void uninitialize();
273 268
274 void setContextState(AudioContextState); 269 void setContextState(AudioContextState);
275 270
276 virtual void didClose() {} 271 virtual void didClose() {}
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 Member<PeriodicWave> m_periodicWaveTriangle; 365 Member<PeriodicWave> m_periodicWaveTriangle;
371 366
372 // This is considering 32 is large enough for multiple channels audio. 367 // This is considering 32 is large enough for multiple channels audio.
373 // It is somewhat arbitrary and could be increased if necessary. 368 // It is somewhat arbitrary and could be increased if necessary.
374 enum { MaxNumberOfChannels = 32 }; 369 enum { MaxNumberOfChannels = 32 };
375 }; 370 };
376 371
377 } // namespace blink 372 } // namespace blink
378 373
379 #endif // BaseAudioContext_h 374 #endif // BaseAudioContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698