[Webkit-unassigned] [Bug 37154] V8CustomIDBCallbacks<> should not hold a reference to the frame

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 6 12:11:53 PDT 2010


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





--- Comment #5 from Jeremy Orlow <jorlow at chromium.org>  2010-04-06 12:11:51 PST ---
(In reply to comment #4)
> +     v8::Persistent<v8::Object> m_onSuccess;
> +     v8::Persistent<v8::Object> m_onError;
> 
> Please use OwnHandle instead to avoid manual new/dispose.

Oooo.  Nice.

> + class V8CustomIDBCallbacks : public IDBCallbacks<ResultType> {
> 
> I wish the base class where were more abstract so it could be used by non-DB
> callbacks.
> 
> As another approach, you could make a more complex object for m_onSuccess
> instead of just holding a V8 handle.  That object could encapsulate the world
> handle / activeDOMObject logic.  Then V8CustomIDBCallbacks could be a simple
> composition of the callbacks.

A little while ago I actually tried to do that, but (IIRC) I found that I
either had to make the container class a factory that you inject the individual
callback classes into or you have to subclass both the container class and the
individual sub-classes.

I'm not against making the code more complex in the interest of re-use, but I
really think we should get at very least |window.indexedDB.open()| always
calling the error callback before we worry too much about it.

-- 
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