Bug 65436 - Use threadsafeCopy() API when using Database Directory path variable
Summary: Use threadsafeCopy() API when using Database Directory path variable
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Srikumar B
Depends on:
Reported: 2011-07-31 14:58 PDT by Srikumar B
Modified: 2019-05-02 16:23 PDT (History)
5 users (show)

See Also:

patch file (1.99 KB, patch)
2011-07-31 15:31 PDT, Srikumar B
levin: review-
Details | Formatted Diff | Diff
revised patch with the comments from David Levin (1.62 KB, patch)
2011-08-01 17:36 PDT, Srikumar B
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

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.