[Webkit-unassigned] [Bug 46234] Add HRTFDatabaseLoader files

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 24 16:19:18 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=46234





--- Comment #3 from Chris Rogers <crogers at google.com>  2010-09-24 16:19:17 PST ---
(In reply to comment #2)
> (From update of attachment 68315 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=68315&action=review
> 
> How is this class supposed to be used?  It seems that a user would first call loadAsynchronously(), but then have nothing better to do but poll isLoaded() until it returns true, which doesn't seem very useful.  Should this expose a callback for users?

Sorry, I didn't suppy enough context about this patch.  Please see WebCore/webaudio/AudioContext.cpp for the call to loadAsynchronously().
Also there is a method AudioContext::isRunnable() which calls the isLoaded() method.  Then the audio thread calls context()->isRunnable() at the start of each render cycle.  Please see patch:

https://bugs.webkit.org/attachment.cgi?id=68416&action=prettypatch


> 
> r- for the unsafe use of RefPtr across threads.
> 
> > WebCore/platform/audio/HRTFDatabaseLoader.cpp:76
> > +        m_hrtfDatabase = HRTFDatabase::createForSubject("Composite", m_databaseSampleRate);
> 
> It is not safe to increment a reference on a RefCounted object from one thread and then increment/decrement references from another thread.

I believe that it is safe to call m_hrtfDatabase.clear() in the unload() method because waitForThreadCompletion() has already returned.  Also, in the calling
sequences actually used for this code, it should be safe for HRTFPanner::pan() to make the reference.  But in re-reading this I think it's unnecessary.
I think I could clean this up by having the database() method return just a simple HRTFDatabase* pointer to avoid any possible problems here and also simplify the API.

I'll re-post a patch with that change and the corresponding change to the HRTFPanner patch.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list