[webkit-reviews] review granted: [Bug 104751] webdatabase: Split the SQLStatement between its front-end and back-end. : [Attachment 188629] the proposed patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 15 18:14:28 PST 2013


Geoffrey Garen <ggaren at apple.com> has granted Mark Lam <mark.lam at apple.com>'s
request for review:
Bug 104751: webdatabase: Split the SQLStatement between its front-end and
back-end.
https://bugs.webkit.org/show_bug.cgi?id=104751

Attachment 188629: the proposed patch.
https://bugs.webkit.org/attachment.cgi?id=188629&action=review

------- Additional Comments from Geoffrey Garen <ggaren at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=188629&action=review


r=me

> Source/WebCore/Modules/webdatabase/SQLStatement.h:49
>  class SQLStatement : public ThreadSafeRefCounted<SQLStatement> {

Since the SQLStatementBackend is the sole owner of this object, let's not use
thread safe refcounting; instead, let's use OwnPtr inside SQLStatementBackend.

> Source/WebCore/Modules/webdatabase/SQLStatement.h:64
> +    SQLStatementBackend* m_backend;

This is a good place to comment that m_backend owns us, to explain why a raw
pointer is OK here.

> Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp:67
> +//	  - During this time, SQLTransaction operates on a raw SQLStatement*
and not a RefPtr.
> +//	    It is understood that the SQLTransactionBackend will be keeping the
SQLStatement
> +//	    alive via its SQLStatementBackend via
SQLTransactionBackend::m_currentStatement
> +//	    for this entire period.

How about clarifying something like:

Inside SQLTransaction::deliverStatementCallback(), we operate on a raw
SQLStatement*. This pointer is valid because it is owned by
SQLTransactionBackend's SQLTransactionBackend::m_currentStatementBackend.

> Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp:383
> +SQLStatement* SQLTransactionBackend::currentStatement()
> +{
> +    return m_currentStatement->frontend();
> +}

Idiomatically, m_currentStatement implies an SQLStatement, not an
SQLStatementBackend. Let's call it m_currentStatementBackend.


More information about the webkit-reviews mailing list