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

Side by Side Diff: Source/modules/webaudio/AudioContext.h

Issue 1123603002: Process suspend() and resume() in call order (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update according to review Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ManualTests/webaudio/suspend-resume-2.html ('k') | Source/modules/webaudio/AudioContext.cpp » ('j') | 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) 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // this. 275 // this.
276 HeapVector<Member<AudioNode>> m_activeSourceNodes; 276 HeapVector<Member<AudioNode>> m_activeSourceNodes;
277 277
278 // Stop rendering the audio graph. 278 // Stop rendering the audio graph.
279 void stopRendering(); 279 void stopRendering();
280 280
281 // Handle Promises for resume() and suspend() 281 // Handle Promises for resume() and suspend()
282 void resolvePromisesForResume(); 282 void resolvePromisesForResume();
283 void resolvePromisesForResumeOnMainThread(); 283 void resolvePromisesForResumeOnMainThread();
284 284
285 void resolvePromisesForSuspend();
286 void resolvePromisesForSuspendOnMainThread();
287
288 // Vector of promises created by resume(). It takes time to handle them, so we collect all of 285 // Vector of promises created by resume(). It takes time to handle them, so we collect all of
289 // the promises here until they can be resolved or rejected. 286 // the promises here until they can be resolved or rejected.
290 WillBeHeapVector<RefPtrWillBeMember<ScriptPromiseResolver>> m_resumeResolver s; 287 WillBeHeapVector<RefPtrWillBeMember<ScriptPromiseResolver>> m_resumeResolver s;
291 // Like m_resumeResolvers but for suspend().
292 WillBeHeapVector<RefPtrWillBeMember<ScriptPromiseResolver>> m_suspendResolve rs;
293 void rejectPendingResolvers(); 288 void rejectPendingResolvers();
294 289
295 // True if we're in the process of resolving promises for resume(). Resolvi ng can take some 290 // True if we're in the process of resolving promises for resume(). Resolvi ng can take some
296 // time and the audio context process loop is very fast, so we don't want to call resolve an 291 // time and the audio context process loop is very fast, so we don't want to call resolve an
297 // excessive number of times. 292 // excessive number of times.
298 bool m_isResolvingResumePromises; 293 bool m_isResolvingResumePromises;
299 294
300 unsigned m_connectionCount; 295 unsigned m_connectionCount;
301 296
302 // Graph locking. 297 // Graph locking.
(...skipping 24 matching lines...) Expand all
327 // This is considering 32 is large enough for multiple channels audio. 322 // This is considering 32 is large enough for multiple channels audio.
328 // It is somewhat arbitrary and could be increased if necessary. 323 // It is somewhat arbitrary and could be increased if necessary.
329 enum { MaxNumberOfChannels = 32 }; 324 enum { MaxNumberOfChannels = 32 };
330 325
331 unsigned m_contextId; 326 unsigned m_contextId;
332 }; 327 };
333 328
334 } // namespace blink 329 } // namespace blink
335 330
336 #endif // AudioContext_h 331 #endif // AudioContext_h
OLDNEW
« no previous file with comments | « ManualTests/webaudio/suspend-resume-2.html ('k') | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698