DescriptionFix for crash when deleting |DataSource|s on the IO thread.
Although |ChromeURLDataManager::DataSource|s are |RefCountedThreadSafe|, at least two derived classes contain |CancellationFlag| members, which check that they are deleted in the same thread as they are created.
Normally, the |DataSource|s are destructed when |ChromeURLDataManager| (instanced via a Singleton) is destroyed, on the main thread. This is not an issue as the classes with a |CancellationFlag| are created on that thread too.
However, occasionally (see the bug) |AddDataSource()| is called when there is already an entry in |data_sources_|, leading to a |DataSource| being released and destructed in the IO thread.
To fix this problem, I've incremented the reference count and posted a task to the main (UI) thread that will release the reference and so destruct it there.
BUG=49121
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72398
Patch Set 1 #Patch Set 2 : Removed debugging stack traces. #
Total comments: 2
Patch Set 3 : Now using the DeleteOnUIThread trait. #
Total comments: 4
Patch Set 4 : Minor cleanup. #
Messages
Total messages: 8 (0 generated)
|