Bug 65436

Summary: Use threadsafeCopy() API when using Database Directory path variable
Product: WebKit Reporter: Srikumar B <srikumar.b>
Component: New BugsAssignee: Srikumar B <srikumar.b>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, levin, nagar28496, srikumar.b, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch file
levin: review-
revised patch with the comments from David Levin none

Description Srikumar B 2011-07-31 14:58:28 PDT
Use threadsafeCopy() while using m_databaseDirectoryPath in DatabaseTracker class
Comment 1 Srikumar B 2011-07-31 15:31:05 PDT
Created attachment 102468 [details]
patch file

Attaching the patch file with the changes to use threadsafeCopy() API
Comment 2 Srikumar B 2011-08-01 13:05:54 PDT
tracker database path(m_databaseDirectoryPath) is being used in multiple places. 

trackerDatabasePath() and deleteOrigin() APIs currently use the DB path without using threadsafeCopy() but these APIs can be called from multiple threads as this tracker DB path is common for all threads which use Database
Comment 3 Srikumar B 2011-08-01 16:08:55 PDT
Kindly assign the bug to me if there are any comments in the review
Comment 4 David Levin 2011-08-01 16:54:20 PDT
Comment on attachment 102468 [details]
patch file

View in context: https://bugs.webkit.org/attachment.cgi?id=102468&action=review

> Source/WebCore/ChangeLog:8
> +        Use threadsafeCopy() API when using m_databaseDirectoryPath string variable

when the databaseGuard lock hasn't been taken

> Source/WebCore/storage/DatabaseTracker.cpp:105
> +    return SQLiteFileSystem::appendDatabaseFileNameToPath(m_databaseDirectoryPath.threadsafeCopy(), "Databases.db");

This one seems good.

> Source/WebCore/storage/DatabaseTracker.cpp:820
> +           SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_databaseDirectoryPath.threadsafeCopy());

This seems unnecessary since the lock m_databaseGuard has been taken.
Comment 5 Srikumar B 2011-08-01 17:36:35 PDT
Created attachment 102598 [details]
revised patch with the comments from David Levin

David,
Thanks for the comments. I updated the patch with reference to your comments.
Comment 6 WebKit Review Bot 2011-08-01 17:50:07 PDT
Comment on attachment 102598 [details]
revised patch with the comments from David Levin

Clearing flags on attachment: 102598

Committed r92157: <http://trac.webkit.org/changeset/92157>
Comment 7 WebKit Review Bot 2011-08-01 17:50:11 PDT
All reviewed patches have been landed.  Closing bug.