Bug 35341 - Expose Database object of currently active task on the database thread
Summary: Expose Database object of currently active task on the database thread
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-24 07:19 PST by jochen
Modified: 2010-02-24 19:51 PST (History)
2 users (show)

See Also:


Attachments
Patch (2.35 KB, patch)
2010-02-24 07:22 PST, jochen
no flags Details | Formatted Diff | Diff
patch (2.40 KB, patch)
2010-02-24 07:38 PST, jochen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2010-02-24 07:19:36 PST
Expose Database object of currently active task on the database thread
Comment 1 jochen 2010-02-24 07:22:31 PST
Created attachment 49390 [details]
Patch
Comment 2 jochen 2010-02-24 07:24:16 PST
I can't think of any way to test this using a html file
Comment 3 Jeremy Orlow 2010-02-24 07:32:45 PST
Comment on attachment 49390 [details]
Patch

Close...but I think it's worth adding an assert.

> diff --git a/WebCore/storage/DatabaseThread.cpp b/WebCore/storage/DatabaseThread.cpp
> index ec4c6d1..e5a21d1 100644
> --- a/WebCore/storage/DatabaseThread.cpp
> +++ b/WebCore/storage/DatabaseThread.cpp
> @@ -42,6 +42,7 @@ namespace WebCore {
>  
>  DatabaseThread::DatabaseThread()
>      : m_threadID(0)
> +    , m_databaseOfCurrentTask(0)
>      , m_transactionClient(new SQLTransactionClient())
>      , m_transactionCoordinator(new SQLTransactionCoordinator())
>      , m_cleanupSync(0)
> @@ -96,7 +97,9 @@ void* DatabaseThread::databaseThread()
>  
>      AutodrainedPool pool;
>      while (OwnPtr<DatabaseTask> task = m_queue.waitForMessage()) {

ASSERT it's 0 first

> +        m_databaseOfCurrentTask = task->database();
>          task->performTask();
> +        m_databaseOfCurrentTask = 0;
>          pool.cycle();
>      }
Comment 4 jochen 2010-02-24 07:38:05 PST
Created attachment 49392 [details]
patch
Comment 5 Jeremy Orlow 2010-02-24 07:38:50 PST
Comment on attachment 49392 [details]
patch

r=me
Comment 6 WebKit Commit Bot 2010-02-24 19:51:15 PST
Comment on attachment 49392 [details]
patch

Clearing flags on attachment: 49392

Committed r55214: <http://trac.webkit.org/changeset/55214>
Comment 7 WebKit Commit Bot 2010-02-24 19:51:20 PST
All reviewed patches have been landed.  Closing bug.