It seems the code can be simplified a bit using OwnPtr.
Created attachment 192010 [details] Patch
Comment on attachment 192010 [details] Patch LGTM.
Comment on attachment 192010 [details] Patch Clearing flags on attachment: 192010 Committed r145190: <http://trac.webkit.org/changeset/145190>
All reviewed patches have been landed. Closing bug.