Changeset 148425 in webkit


Ignore:
Timestamp:
Apr 15, 2013 3:11:36 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Filesystem callback notifyCreateSnapshotFileAndReadMetadata can be called on the wring thread
https://bugs.webkit.org/show_bug.cgi?id=114610

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-04-15
Reviewed by Xan Lopez.

Override notifyCreateSnapshotFileAndReadMetadata to make sure the
callback is called on the right thread.

Fixes a crash in several fast/filesystem test in debug builds.

  • platform/blackberry/WorkerPlatformAsyncFileSystemCallbacks.cpp:

(WebCore::WorkerPlatformAsyncFileSystemCallbacks::notifyCreateSnapshotFileAndReadMetadata):
(WebCore::WorkerPlatformAsyncFileSystemCallbacks::notifyCreateSnapshotFileAndReadMetadataOnWorkerThread):

  • platform/blackberry/WorkerPlatformAsyncFileSystemCallbacks.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148423 r148425  
     12013-04-15  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [BlackBerry] Filesystem callback notifyCreateSnapshotFileAndReadMetadata can be called on the wring thread
     4        https://bugs.webkit.org/show_bug.cgi?id=114610
     5
     6        Reviewed by Xan Lopez.
     7
     8        Override notifyCreateSnapshotFileAndReadMetadata to make sure the
     9        callback is called on the right thread.
     10
     11        Fixes a crash in several fast/filesystem test in debug builds.
     12
     13        * platform/blackberry/WorkerPlatformAsyncFileSystemCallbacks.cpp:
     14        (WebCore::WorkerPlatformAsyncFileSystemCallbacks::notifyCreateSnapshotFileAndReadMetadata):
     15        (WebCore::WorkerPlatformAsyncFileSystemCallbacks::notifyCreateSnapshotFileAndReadMetadataOnWorkerThread):
     16        * platform/blackberry/WorkerPlatformAsyncFileSystemCallbacks.h:
     17
    1182013-04-15  Arvid Nilsson  <anilsson@rim.com>
    219
  • trunk/Source/WebCore/platform/blackberry/WorkerPlatformAsyncFileSystemCallbacks.cpp

    r148242 r148425  
    131131}
    132132
     133void WorkerPlatformAsyncFileSystemCallbacks::notifyCreateSnapshotFileAndReadMetadata(const BlackBerry::Platform::WebFileInfo& fileInfo)
     134{
     135    m_mutex.lock();
     136    if (!m_context) {
     137        m_mutex.unlock();
     138        PlatformAsyncFileSystemCallbacks::deleteMe();
     139        return;
     140    }
     141
     142    postTaskToWorkerThread(createCallbackTask(&notifyCreateSnapshotFileAndReadMetadataOnWorkerThread, this, fileInfo));
     143    m_mutex.unlock();
     144}
     145
    133146void WorkerPlatformAsyncFileSystemCallbacks::notifyReadDirectory(const std::vector<BlackBerry::Platform::WebFileSystemEntry>& entries, bool hasMore)
    134147{
     
    201214}
    202215
     216void WorkerPlatformAsyncFileSystemCallbacks::notifyCreateSnapshotFileAndReadMetadataOnWorkerThread(ScriptExecutionContext*, WorkerPlatformAsyncFileSystemCallbacks* callbacks, const BlackBerry::Platform::WebFileInfo& fileInfo)
     217{
     218    callbacks->PlatformAsyncFileSystemCallbacks::notifyCreateSnapshotFileAndReadMetadata(fileInfo);
     219}
     220
    203221void WorkerPlatformAsyncFileSystemCallbacks::notifyReadDirectoryEntryOnWorkerThread(ScriptExecutionContext*, WorkerPlatformAsyncFileSystemCallbacks* callbacks, const std::vector<BlackBerry::Platform::WebFileSystemEntry>& entries, bool hasMore)
    204222{
  • trunk/Source/WebCore/platform/blackberry/WorkerPlatformAsyncFileSystemCallbacks.h

    r148242 r148425  
    8585    virtual void notifyFail(BlackBerry::Platform::WebFileError);
    8686    virtual void notifyReadMetadata(const BlackBerry::Platform::WebFileInfo&);
     87    virtual void notifyCreateSnapshotFileAndReadMetadata(const BlackBerry::Platform::WebFileInfo&);
    8788    virtual void notifyReadDirectory(const std::vector<BlackBerry::Platform::WebFileSystemEntry>& entries, bool hasMore);
    8889    virtual void notifyCreateFileWriter(BlackBerry::Platform::WebFileWriter* platformWriter, long long length);
     
    9899    static void notifyFailOnWorkerThread(ScriptExecutionContext*, WorkerPlatformAsyncFileSystemCallbacks*, BlackBerry::Platform::WebFileError);
    99100    static void notifyReadMetadataOnWorkerThread(ScriptExecutionContext*, WorkerPlatformAsyncFileSystemCallbacks*, const BlackBerry::Platform::WebFileInfo&);
     101    static void notifyCreateSnapshotFileAndReadMetadataOnWorkerThread(ScriptExecutionContext*, WorkerPlatformAsyncFileSystemCallbacks*, const BlackBerry::Platform::WebFileInfo&);
    100102    static void notifyReadDirectoryEntryOnWorkerThread(ScriptExecutionContext*, WorkerPlatformAsyncFileSystemCallbacks*, const std::vector<BlackBerry::Platform::WebFileSystemEntry>& entries, bool hasMore);
    101103    static void notifyCreateFileWriterOnWorkerThread(ScriptExecutionContext*, WorkerPlatformAsyncFileSystemCallbacks*, BlackBerry::Platform::WebFileWriter* platformWriter, long long length);
Note: See TracChangeset for help on using the changeset viewer.