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

Unified Diff: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h

Issue 2913303002: Avoid unsafe heap access from audio thread. (Closed)
Patch Set: bring back comment Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
index 13db3f7c07f6e5eb2acee3eac9a31154841c9a8f..493a6d092a04edfe053586f415bfd6c021dad567 100644
--- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
+++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
@@ -453,7 +453,9 @@ class MODULES_EXPORT BaseAudioContext
// it creates these Promises.
// Handle Promises for resume() and suspend()
void ResolvePromisesForResume();
- void ResolvePromisesForResumeOnMainThread();
+
+ void PerformCleanupOnMainThread();
+ void ScheduleMainThreadCleanup();
// When the context is going away, reject any pending script promise
// resolvers.
@@ -467,6 +469,11 @@ class MODULES_EXPORT BaseAudioContext
// don't want to call resolve an excessive number of times.
bool is_resolving_resume_promises_;
+ // Set to |true| by the audio thread when it posts a main-thread task to
+ // perform delayed state sync'ing updates that needs to be done on the main
+ // thread. Cleared by the main thread task once it has run.
+ bool has_posted_cleanup_task_;
+
// Whether a user gesture is required to start this AudioContext.
bool user_gesture_required_;

Powered by Google App Engine
This is Rietveld 408576698