Changeset 85165 in webkit


Ignore:
Timestamp:
Apr 27, 2011 11:21:34 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-27 Dmitry Lomov <dslomov@google.com>

Reviewed by David Levin.

CrossThreadCopier should not have a default specialization for raw pointers
https://bugs.webkit.org/show_bug.cgi?id=59234
Removed the ablity to pass raw pointers cross-thread
Added and applied annotations for doing that

  • fileapi/FileReader.cpp: (WebCore::FileReader::readInternal): (WebCore::FileReader::abort):
  • fileapi/FileStreamProxy.cpp: (WebCore::FileStreamProxy::startOnFileThread): (WebCore::FileStreamProxy::stopOnFileThread): (WebCore::FileStreamProxy::getSize): (WebCore::FileStreamProxy::getSizeOnFileThread): (WebCore::FileStreamProxy::openForRead): (WebCore::FileStreamProxy::openForReadOnFileThread): (WebCore::FileStreamProxy::openForWrite): (WebCore::FileStreamProxy::openForWriteOnFileThread): (WebCore::FileStreamProxy::close): (WebCore::FileStreamProxy::read): (WebCore::FileStreamProxy::readOnFileThread): (WebCore::FileStreamProxy::write): (WebCore::FileStreamProxy::writeOnFileThread): (WebCore::FileStreamProxy::truncate): (WebCore::FileStreamProxy::truncateOnFileThread):
  • loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): (WebCore::WorkerThreadableLoader::MainThreadBridge::destroy): (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel):
  • page/GeolocationPositionCache.cpp: (WebCore::GeolocationPositionCache::triggerReadFromDatabase): (WebCore::GeolocationPositionCache::triggerWriteToDatabase):
  • platform/CrossThreadCopier.h: (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper): (WebCore::AllowCrossThreadAccessWrapper::value): (WebCore::AllowCrossThreadAccess): (WebCore::AllowExtendedLifetimeWrapper::AllowExtendedLifetimeWrapper): (WebCore::AllowExtendedLifetimeWrapper::value): (WebCore::AllowExtendedLifetime):
  • platform/graphics/chromium/cc/CCCompletionEvent.h:
  • storage/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::get): (WebCore::IDBObjectStoreBackendImpl::put): (WebCore::IDBObjectStoreBackendImpl::deleteFunction): (WebCore::IDBObjectStoreBackendImpl::clear): (WebCore::IDBObjectStoreBackendImpl::createIndex): (WebCore::IDBObjectStoreBackendImpl::deleteIndex): (WebCore::IDBObjectStoreBackendImpl::openCursor):
  • storage/SQLCallbackWrapper.h: (WebCore::SQLCallbackWrapper::clear):
  • websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel): (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge): (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect): (WebCore::WorkerThreadableWebSocketChannel::Bridge::send): (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Bridge::close): (WebCore::WorkerThreadableWebSocketChannel::Bridge::disconnect): (WebCore::WorkerThreadableWebSocketChannel::Bridge::suspend): (WebCore::WorkerThreadableWebSocketChannel::Bridge::resume):
  • workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):

2011-04-27 Dmitry Lomov <dslomov@google.com>

Reviewed by David Levin.

CrossThreadCopier should not have a default specialization for raw pointers
https://bugs.webkit.org/show_bug.cgi?id=59234
Removed the ablity to pass raw pointers cross-thread
Added and applied annotations for doing that

  • src/WebSharedWorkerImpl.cpp: (WebKit::WebSharedWorkerImpl::connect): (WebKit::WebSharedWorkerImpl::connectTask):
  • src/WebSharedWorkerImpl.h:
  • src/WebWorkerBase.cpp: (WebKit::WebWorkerBase::postMessageToWorkerObject): (WebKit::WebWorkerBase::postExceptionToWorkerObject): (WebKit::WebWorkerBase::postConsoleMessageToWorkerObject): (WebKit::WebWorkerBase::confirmMessageFromWorkerObject): (WebKit::WebWorkerBase::reportPendingActivity): (WebKit::WebWorkerBase::workerContextClosed): (WebKit::WebWorkerBase::workerContextDestroyed):
  • src/WebWorkerClientImpl.cpp: (WebKit::WebWorkerClientImpl::startWorkerContext): (WebKit::WebWorkerClientImpl::terminateWorkerContext): (WebKit::WebWorkerClientImpl::postMessageToWorkerContext): (WebKit::WebWorkerClientImpl::workerObjectDestroyed): (WebKit::WebWorkerClientImpl::postMessageToWorkerObject): (WebKit::WebWorkerClientImpl::postExceptionToWorkerObject): (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObject): (WebKit::WebWorkerClientImpl::confirmMessageFromWorkerObject): (WebKit::WebWorkerClientImpl::reportPendingActivity):
  • src/WebWorkerImpl.cpp: (WebKit::WebWorkerImpl::postMessageToWorkerContext):
  • src/WorkerFileSystemCallbacksBridge.cpp: (WebKit::WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postMoveToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postCopyToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postRemoveToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postRemoveRecursivelyToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postReadMetadataToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postCreateFileToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postCreateDirectoryToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postFileExistsToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postDirectoryExistsToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::postReadDirectoryToMainThread): (WebKit::WorkerFileSystemCallbacksBridge::didFailOnMainThread): (WebKit::WorkerFileSystemCallbacksBridge::didOpenFileSystemOnMainThread): (WebKit::WorkerFileSystemCallbacksBridge::didSucceedOnMainThread): (WebKit::WorkerFileSystemCallbacksBridge::didReadMetadataOnMainThread): (WebKit::WorkerFileSystemCallbacksBridge::didReadDirectoryOnMainThread):
  • src/WorkerFileWriterCallbacksBridge.cpp: (WebKit::WorkerFileWriterCallbacksBridge::postWriteToMainThread): (WebKit::WorkerFileWriterCallbacksBridge::postTruncateToMainThread): (WebKit::WorkerFileWriterCallbacksBridge::postAbortToMainThread): (WebKit::WorkerFileWriterCallbacksBridge::didWrite): (WebKit::WorkerFileWriterCallbacksBridge::didFail): (WebKit::WorkerFileWriterCallbacksBridge::didTruncate): (WebKit::WorkerFileWriterCallbacksBridge::postInitToMainThread): (WebKit::WorkerFileWriterCallbacksBridge::dispatchTaskToMainThread): (WebKit::WorkerFileWriterCallbacksBridge::dispatchTaskToWorkerThread):
  • tests/CCThreadTest.cpp: (WebCore::TEST):
Location:
trunk/Source
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r85164 r85165  
     12011-04-27  Dmitry Lomov  <dslomov@google.com>
     2
     3        Reviewed by David Levin.
     4
     5        CrossThreadCopier should not have a default specialization for raw pointers
     6        https://bugs.webkit.org/show_bug.cgi?id=59234
     7        Removed the ablity to pass raw pointers cross-thread
     8        Added and applied annotations for doing that
     9
     10        * fileapi/FileReader.cpp:
     11        (WebCore::FileReader::readInternal):
     12        (WebCore::FileReader::abort):
     13        * fileapi/FileStreamProxy.cpp:
     14        (WebCore::FileStreamProxy::startOnFileThread):
     15        (WebCore::FileStreamProxy::stopOnFileThread):
     16        (WebCore::FileStreamProxy::getSize):
     17        (WebCore::FileStreamProxy::getSizeOnFileThread):
     18        (WebCore::FileStreamProxy::openForRead):
     19        (WebCore::FileStreamProxy::openForReadOnFileThread):
     20        (WebCore::FileStreamProxy::openForWrite):
     21        (WebCore::FileStreamProxy::openForWriteOnFileThread):
     22        (WebCore::FileStreamProxy::close):
     23        (WebCore::FileStreamProxy::read):
     24        (WebCore::FileStreamProxy::readOnFileThread):
     25        (WebCore::FileStreamProxy::write):
     26        (WebCore::FileStreamProxy::writeOnFileThread):
     27        (WebCore::FileStreamProxy::truncate):
     28        (WebCore::FileStreamProxy::truncateOnFileThread):
     29        * loader/WorkerThreadableLoader.cpp:
     30        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
     31        (WebCore::WorkerThreadableLoader::MainThreadBridge::destroy):
     32        (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel):
     33        * page/GeolocationPositionCache.cpp:
     34        (WebCore::GeolocationPositionCache::triggerReadFromDatabase):
     35        (WebCore::GeolocationPositionCache::triggerWriteToDatabase):
     36        * platform/CrossThreadCopier.h:
     37        (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper):
     38        (WebCore::AllowCrossThreadAccessWrapper::value):
     39        (WebCore::AllowCrossThreadAccess):
     40        (WebCore::AllowExtendedLifetimeWrapper::AllowExtendedLifetimeWrapper):
     41        (WebCore::AllowExtendedLifetimeWrapper::value):
     42        (WebCore::AllowExtendedLifetime):
     43        * platform/graphics/chromium/cc/CCCompletionEvent.h:
     44        * storage/IDBObjectStoreBackendImpl.cpp:
     45        (WebCore::IDBObjectStoreBackendImpl::get):
     46        (WebCore::IDBObjectStoreBackendImpl::put):
     47        (WebCore::IDBObjectStoreBackendImpl::deleteFunction):
     48        (WebCore::IDBObjectStoreBackendImpl::clear):
     49        (WebCore::IDBObjectStoreBackendImpl::createIndex):
     50        (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
     51        (WebCore::IDBObjectStoreBackendImpl::openCursor):
     52        * storage/SQLCallbackWrapper.h:
     53        (WebCore::SQLCallbackWrapper::clear):
     54        * websockets/WorkerThreadableWebSocketChannel.cpp:
     55        (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel):
     56        (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
     57        (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
     58        (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
     59        (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
     60        (WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
     61        (WebCore::WorkerThreadableWebSocketChannel::Bridge::disconnect):
     62        (WebCore::WorkerThreadableWebSocketChannel::Bridge::suspend):
     63        (WebCore::WorkerThreadableWebSocketChannel::Bridge::resume):
     64        * workers/WorkerMessagingProxy.cpp:
     65        (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
     66
    1672011-04-27  Adam Barth  <abarth@webkit.org>
    268
  • trunk/Source/WebCore/fileapi/FileReader.cpp

    r84923 r85165  
    130130
    131131    if (m_state == None)
    132         scriptExecutionContext()->postTask(createCallbackTask(&delayedStart, this));
     132        scriptExecutionContext()->postTask(createCallbackTask(&delayedStart, AllowAccessLater(this)));
    133133
    134134    m_blob = blob;
     
    151151
    152152    // Schedule to have the abort done later since abort() might be called from the event handler and we do not want the resource loading code to be in the stack.
    153     scriptExecutionContext()->postTask(createCallbackTask(&delayedAbort, this));
     153    scriptExecutionContext()->postTask(
     154        createCallbackTask(&delayedAbort, AllowAccessLater(this)));
    154155}
    155156
  • trunk/Source/WebCore/fileapi/FileStreamProxy.cpp

    r77852 r85165  
    8787        return;
    8888    m_stream->start();
    89     m_context->postTask(createCallbackTask(&didStart, this));
     89    m_context->postTask(createCallbackTask(&didStart, AllowCrossThreadAccess(this)));
    9090}
    9191
     
    108108{
    109109    m_stream->stop();
    110     m_context->postTask(createCallbackTask(&derefProxyOnContext, this));
     110    m_context->postTask(createCallbackTask(&derefProxyOnContext, AllowCrossThreadAccess(this)));
    111111}
    112112
     
    125125{
    126126    long long size = m_stream->getSize(path, expectedModificationTime);
    127     m_context->postTask(createCallbackTask(&didGetSize, this, size));
     127    m_context->postTask(createCallbackTask(&didGetSize, AllowCrossThreadAccess(this), size));
    128128}
    129129
     
    142142{
    143143    bool success = m_stream->openForRead(path, offset, length);
    144     m_context->postTask(createCallbackTask(&didOpen, this, success));
     144    m_context->postTask(createCallbackTask(&didOpen, AllowCrossThreadAccess(this), success));
    145145}
    146146
    147147void FileStreamProxy::openForWrite(const String& path)
    148148{
    149     fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::openForWriteOnFileThread, path));
     149    fileThread()->postTask(
     150        createFileThreadTask(this,
     151                             &FileStreamProxy::openForWriteOnFileThread, path));
    150152}
    151153
     
    153155{
    154156    bool success = m_stream->openForWrite(path);
    155     m_context->postTask(createCallbackTask(&didOpen, this, success));
     157    m_context->postTask(createCallbackTask(&didOpen, AllowCrossThreadAccess(this), success));
    156158}
    157159
     
    174176void FileStreamProxy::read(char* buffer, int length)
    175177{
    176     fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::readOnFileThread, buffer, length));
     178    fileThread()->postTask(
     179        createFileThreadTask(this, &FileStreamProxy::readOnFileThread,
     180                             AllowCrossThreadAccess(buffer), length));
    177181}
    178182
     
    180184{
    181185    int bytesRead = m_stream->read(buffer, length);
    182     m_context->postTask(createCallbackTask(&didRead, this, bytesRead));
     186    m_context->postTask(createCallbackTask(&didRead, AllowCrossThreadAccess(this), bytesRead));
    183187}
    184188
     
    197201{
    198202    int bytesWritten = m_stream->write(blobURL, position, length);
    199     m_context->postTask(createCallbackTask(&didWrite, this, bytesWritten));
     203    m_context->postTask(createCallbackTask(&didWrite, AllowCrossThreadAccess(this), bytesWritten));
    200204}
    201205
     
    214218{
    215219    bool success = m_stream->truncate(position);
    216     m_context->postTask(createCallbackTask(&didTruncate, this, success));
     220    m_context->postTask(createCallbackTask(&didTruncate, AllowCrossThreadAccess(this), success));
    217221}
    218222
  • trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp

    r84260 r85165  
    9696{
    9797    ASSERT(m_workerClientWrapper.get());
    98     m_loaderProxy.postTaskToLoader(createCallbackTask(&MainThreadBridge::mainThreadCreateLoader, this, request, options, outgoingReferrer));
     98    m_loaderProxy.postTaskToLoader(
     99        createCallbackTask(&MainThreadBridge::mainThreadCreateLoader,
     100                           AllowCrossThreadAccess(this), request, options, outgoingReferrer));
    99101}
    100102
     
    130132
    131133    // "delete this" and m_mainThreadLoader::deref() on the worker object's thread.
    132     m_loaderProxy.postTaskToLoader(createCallbackTask(&MainThreadBridge::mainThreadDestroy, this));
     134    m_loaderProxy.postTaskToLoader(
     135        createCallbackTask(&MainThreadBridge::mainThreadDestroy, AllowCrossThreadAccess(this)));
    133136}
    134137
     
    146149void WorkerThreadableLoader::MainThreadBridge::cancel()
    147150{
    148     m_loaderProxy.postTaskToLoader(createCallbackTask(&MainThreadBridge::mainThreadCancel, this));
     151    m_loaderProxy.postTaskToLoader(
     152        createCallbackTask(&MainThreadBridge::mainThreadCancel, AllowCrossThreadAccess(this)));
    149153    ThreadableLoaderClientWrapper* clientWrapper = m_workerClientWrapper.get();
    150154    if (!clientWrapper->done()) {
  • trunk/Source/WebCore/page/GeolocationPositionCache.cpp

    r74794 r85165  
    129129void GeolocationPositionCache::triggerReadFromDatabase()
    130130{
    131     m_queue.append(createCallbackTask(&GeolocationPositionCache::readFromDatabase, this));
     131    m_queue.append(createCallbackTask(&GeolocationPositionCache::readFromDatabase, AllowCrossThreadAccess(this)));
    132132}
    133133
     
    188188void GeolocationPositionCache::triggerWriteToDatabase()
    189189{
    190     m_queue.append(createCallbackTask(writeToDatabase, this));
     190    m_queue.append(createCallbackTask(writeToDatabase, AllowCrossThreadAccess(this)));
    191191}
    192192
  • trunk/Source/WebCore/platform/CrossThreadCopier.h

    r81567 r85165  
    6363    };
    6464
    65     // Pointers get passed through without any significant changes.
    66     template<typename T> struct CrossThreadCopierBase<false, false, T*> : public CrossThreadCopierPassThrough<T*> {
    67     };
    68 
    6965    template<> struct CrossThreadCopierBase<false, false, ThreadableLoaderOptions> : public CrossThreadCopierPassThrough<ThreadableLoaderOptions> {
    7066    };
     
    120116    };
    121117
     118    template<typename T> struct AllowCrossThreadAccessWrapper {
     119    public:
     120        explicit AllowCrossThreadAccessWrapper(T* value) : m_value(value) { }
     121        T* value() const { return m_value; }
     122    private:
     123        T* m_value;
     124    };
     125
     126    template<typename T> struct CrossThreadCopierBase<false, false, AllowCrossThreadAccessWrapper<T> > {
     127        typedef T* Type;
     128        static Type copy(const AllowCrossThreadAccessWrapper<T>& wrapper) { return wrapper.value(); }
     129    };
     130
     131    template<typename T> AllowCrossThreadAccessWrapper<T> AllowCrossThreadAccess(T* value)
     132    {
     133        return AllowCrossThreadAccessWrapper<T>(value);
     134    }
     135
     136    // FIXME: Move to a different header file. AllowAccessLater is for cross-thread access
     137    // that is not cross-thread (tasks posted to a queue guaranteed to run on the same thread).
     138    template<typename T> struct AllowAccessLaterWrapper {
     139    public:
     140        explicit AllowAccessLaterWrapper(T* value) : m_value(value) { }
     141        T* value() const { return m_value; }
     142    private:
     143        T* m_value;
     144    };
     145
     146    template<typename T> struct CrossThreadCopierBase<false, false, AllowAccessLaterWrapper<T> > {
     147        typedef T* Type;
     148        static Type copy(const AllowAccessLaterWrapper<T>& wrapper) { return wrapper.value(); }
     149    };
     150
     151    template<typename T> AllowAccessLaterWrapper<T> AllowAccessLater(T* value)
     152    {
     153        return AllowAccessLaterWrapper<T>(value);
     154    }
     155
     156
    122157} // namespace WebCore
    123158
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCCompletionEvent.h

    r83249 r85165  
     1
    12/*
    23 * Copyright (C) 2011 Google Inc. All rights reserved.
  • trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp

    r85145 r85165  
    385385    RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
    386386    RefPtr<IDBTransactionBackendInterface> transactionPtr = transaction;
    387     if (!transaction->scheduleTask(createCallbackTask(&IDBObjectStoreBackendImpl::createIndexInternal, objectStore, index, transaction),
    388                                    createCallbackTask(&IDBObjectStoreBackendImpl::removeIndexFromMap, objectStore, index))) {
     387    if (!transaction->scheduleTask(
     388              createCallbackTask(&IDBObjectStoreBackendImpl::createIndexInternal,
     389                                 objectStore, index, transactionPtr),
     390              createCallbackTask(&IDBObjectStoreBackendImpl::removeIndexFromMap,
     391                                 objectStore, index))) {
    389392        ec = IDBDatabaseException::NOT_ALLOWED_ERR;
    390393        return 0;
     
    438441    RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
    439442    RefPtr<IDBTransactionBackendInterface> transactionPtr = transaction;
    440     if (!transaction->scheduleTask(createCallbackTask(&IDBObjectStoreBackendImpl::deleteIndexInternal, objectStore, index, transactionPtr),
    441                                    createCallbackTask(&IDBObjectStoreBackendImpl::addIndexToMap, objectStore, index))) {
     443    if (!transaction->scheduleTask(
     444              createCallbackTask(&IDBObjectStoreBackendImpl::deleteIndexInternal,
     445                                 objectStore, index, transactionPtr),
     446              createCallbackTask(&IDBObjectStoreBackendImpl::addIndexToMap,
     447                                 objectStore, index))) {
    442448        ec = IDBDatabaseException::NOT_ALLOWED_ERR;
    443449        return;
     
    452458}
    453459
    454 void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, unsigned short direction, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
     460void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, unsigned short direction, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
    455461{
    456462    RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
    457463    RefPtr<IDBKeyRange> range = prpRange;
    458464    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
    459     RefPtr<IDBTransactionBackendInterface> transaction = transactionPtr;
    460     if (!transaction->scheduleTask(createCallbackTask(&IDBObjectStoreBackendImpl::openCursorInternal, objectStore, range, direction, callbacks, transaction)))
    461         ec = IDBDatabaseException::NOT_ALLOWED_ERR;
     465    RefPtr<IDBTransactionBackendInterface> transactionPtr = transaction;
     466    if (!transaction->scheduleTask(
     467            createCallbackTask(&IDBObjectStoreBackendImpl::openCursorInternal,
     468                               objectStore, range, direction, callbacks, transactionPtr))) {
     469        ec = IDBDatabaseException::NOT_ALLOWED_ERR;
     470    }
    462471}
    463472
  • trunk/Source/WebCore/storage/SQLCallbackWrapper.h

    r80897 r85165  
    7575            callback = m_callback.release().leakRef();
    7676        }
    77         context->postTask(createCallbackTask(&safeRelease, callback));
     77        context->postTask(createCallbackTask(&safeRelease, AllowAccessLater(callback)));
    7878    }
    7979
  • trunk/Source/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp

    r63159 r85165  
    247247
    248248    Peer* peer = Peer::create(clientWrapper, thisPtr->m_loaderProxy, context, taskMode, url, protocol);
    249     thisPtr->m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&Bridge::setWebSocketChannel, thisPtr, peer, clientWrapper), taskMode);
     249    thisPtr->m_loaderProxy.postTaskForModeToWorkerContext(
     250        createCallbackTask(&Bridge::setWebSocketChannel,
     251                           AllowCrossThreadAccess(thisPtr),
     252                           AllowCrossThreadAccess(peer), clientWrapper), taskMode);
    250253}
    251254
     
    259262    ASSERT(m_workerClientWrapper.get());
    260263    setMethodNotCompleted();
    261     m_loaderProxy.postTaskToLoader(createCallbackTask(&Bridge::mainThreadCreateWebSocketChannel, this, m_workerClientWrapper, m_taskMode, url, protocol));
     264    m_loaderProxy.postTaskToLoader(
     265        createCallbackTask(&Bridge::mainThreadCreateWebSocketChannel,
     266                           AllowCrossThreadAccess(this), m_workerClientWrapper, m_taskMode, url, protocol));
    262267    waitForMethodCompletion();
    263268    ASSERT(m_peer);
     
    282287    ASSERT(m_workerClientWrapper);
    283288    ASSERT(m_peer);
    284     m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadConnect, m_peer));
     289    m_loaderProxy.postTaskToLoader(
     290        createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadConnect, AllowCrossThreadAccess(m_peer)));
    285291}
    286292
     
    300306    ASSERT(m_peer);
    301307    setMethodNotCompleted();
    302     m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSend, m_peer, message));
     308    m_loaderProxy.postTaskToLoader(
     309        createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSend,
     310                           AllowCrossThreadAccess(m_peer), message));
    303311    RefPtr<Bridge> protect(this);
    304312    waitForMethodCompletion();
     
    322330    ASSERT(m_peer);
    323331    setMethodNotCompleted();
    324     m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadBufferedAmount, m_peer));
     332    m_loaderProxy.postTaskToLoader(
     333        createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadBufferedAmount, AllowCrossThreadAccess(m_peer)));
    325334    RefPtr<Bridge> protect(this);
    326335    waitForMethodCompletion();
     
    343352{
    344353    ASSERT(m_peer);
    345     m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadClose, m_peer));
     354    m_loaderProxy.postTaskToLoader(
     355        createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadClose, AllowCrossThreadAccess(m_peer)));
    346356}
    347357
     
    361371        Peer* peer = m_peer;
    362372        m_peer = 0;
    363         m_loaderProxy.postTaskToLoader(createCallbackTask(&mainThreadDestroy, peer));
     373        m_loaderProxy.postTaskToLoader(
     374            createCallbackTask(&mainThreadDestroy, AllowCrossThreadAccess(peer)));
    364375    }
    365376    m_workerContext = 0;
     
    378389{
    379390    ASSERT(m_peer);
    380     m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSuspend, m_peer));
     391    m_loaderProxy.postTaskToLoader(
     392        createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSuspend, AllowCrossThreadAccess(m_peer)));
    381393}
    382394
     
    393405{
    394406    ASSERT(m_peer);
    395     m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadResume, m_peer));
     407    m_loaderProxy.postTaskToLoader(
     408        createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadResume, AllowCrossThreadAccess(m_peer)));
    396409}
    397410
  • trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp

    r84892 r85165  
    289289void WorkerMessagingProxy::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
    290290{
    291     m_scriptExecutionContext->postTask(createCallbackTask(&postConsoleMessageTask, this, source, type, level, message, lineNumber, sourceURL));
     291    m_scriptExecutionContext->postTask(
     292        createCallbackTask(&postConsoleMessageTask, AllowCrossThreadAccess(this),
     293                           source, type, level, message, lineNumber, sourceURL));
    292294}
    293295
  • trunk/Source/WebKit/chromium/ChangeLog

    r85136 r85165  
     12011-04-27  Dmitry Lomov  <dslomov@google.com>
     2
     3        Reviewed by David Levin.
     4       
     5        CrossThreadCopier should not have a default specialization for raw pointers
     6        https://bugs.webkit.org/show_bug.cgi?id=59234
     7        Removed the ablity to pass raw pointers cross-thread
     8        Added and applied annotations for doing that
     9
     10        * src/WebSharedWorkerImpl.cpp:
     11        (WebKit::WebSharedWorkerImpl::connect):
     12        (WebKit::WebSharedWorkerImpl::connectTask):
     13        * src/WebSharedWorkerImpl.h:
     14        * src/WebWorkerBase.cpp:
     15        (WebKit::WebWorkerBase::postMessageToWorkerObject):
     16        (WebKit::WebWorkerBase::postExceptionToWorkerObject):
     17        (WebKit::WebWorkerBase::postConsoleMessageToWorkerObject):
     18        (WebKit::WebWorkerBase::confirmMessageFromWorkerObject):
     19        (WebKit::WebWorkerBase::reportPendingActivity):
     20        (WebKit::WebWorkerBase::workerContextClosed):
     21        (WebKit::WebWorkerBase::workerContextDestroyed):
     22        * src/WebWorkerClientImpl.cpp:
     23        (WebKit::WebWorkerClientImpl::startWorkerContext):
     24        (WebKit::WebWorkerClientImpl::terminateWorkerContext):
     25        (WebKit::WebWorkerClientImpl::postMessageToWorkerContext):
     26        (WebKit::WebWorkerClientImpl::workerObjectDestroyed):
     27        (WebKit::WebWorkerClientImpl::postMessageToWorkerObject):
     28        (WebKit::WebWorkerClientImpl::postExceptionToWorkerObject):
     29        (WebKit::WebWorkerClientImpl::postConsoleMessageToWorkerObject):
     30        (WebKit::WebWorkerClientImpl::confirmMessageFromWorkerObject):
     31        (WebKit::WebWorkerClientImpl::reportPendingActivity):
     32        * src/WebWorkerImpl.cpp:
     33        (WebKit::WebWorkerImpl::postMessageToWorkerContext):
     34        * src/WorkerFileSystemCallbacksBridge.cpp:
     35        (WebKit::WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread):
     36        (WebKit::WorkerFileSystemCallbacksBridge::postMoveToMainThread):
     37        (WebKit::WorkerFileSystemCallbacksBridge::postCopyToMainThread):
     38        (WebKit::WorkerFileSystemCallbacksBridge::postRemoveToMainThread):
     39        (WebKit::WorkerFileSystemCallbacksBridge::postRemoveRecursivelyToMainThread):
     40        (WebKit::WorkerFileSystemCallbacksBridge::postReadMetadataToMainThread):
     41        (WebKit::WorkerFileSystemCallbacksBridge::postCreateFileToMainThread):
     42        (WebKit::WorkerFileSystemCallbacksBridge::postCreateDirectoryToMainThread):
     43        (WebKit::WorkerFileSystemCallbacksBridge::postFileExistsToMainThread):
     44        (WebKit::WorkerFileSystemCallbacksBridge::postDirectoryExistsToMainThread):
     45        (WebKit::WorkerFileSystemCallbacksBridge::postReadDirectoryToMainThread):
     46        (WebKit::WorkerFileSystemCallbacksBridge::didFailOnMainThread):
     47        (WebKit::WorkerFileSystemCallbacksBridge::didOpenFileSystemOnMainThread):
     48        (WebKit::WorkerFileSystemCallbacksBridge::didSucceedOnMainThread):
     49        (WebKit::WorkerFileSystemCallbacksBridge::didReadMetadataOnMainThread):
     50        (WebKit::WorkerFileSystemCallbacksBridge::didReadDirectoryOnMainThread):
     51        * src/WorkerFileWriterCallbacksBridge.cpp:
     52        (WebKit::WorkerFileWriterCallbacksBridge::postWriteToMainThread):
     53        (WebKit::WorkerFileWriterCallbacksBridge::postTruncateToMainThread):
     54        (WebKit::WorkerFileWriterCallbacksBridge::postAbortToMainThread):
     55        (WebKit::WorkerFileWriterCallbacksBridge::didWrite):
     56        (WebKit::WorkerFileWriterCallbacksBridge::didFail):
     57        (WebKit::WorkerFileWriterCallbacksBridge::didTruncate):
     58        (WebKit::WorkerFileWriterCallbacksBridge::postInitToMainThread):
     59        (WebKit::WorkerFileWriterCallbacksBridge::dispatchTaskToMainThread):
     60        (WebKit::WorkerFileWriterCallbacksBridge::dispatchTaskToWorkerThread):
     61        * tests/CCThreadTest.cpp:
     62        (WebCore::TEST):
     63
    1642011-04-27  James Robinson  <jamesr@chromium.org>
    265
  • trunk/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp

    r62574 r85165  
    7777
    7878    workerThread()->runLoop().postTask(
    79         createCallbackTask(&connectTask, this, channel.release()));
     79        createCallbackTask(&connectTask, channel.release()));
    8080    if (listener)
    8181        listener->connected();
    8282}
    8383
    84 void WebSharedWorkerImpl::connectTask(ScriptExecutionContext* context, WebSharedWorkerImpl* worker, PassOwnPtr<MessagePortChannel> channel)
     84void WebSharedWorkerImpl::connectTask(ScriptExecutionContext* context, PassOwnPtr<MessagePortChannel> channel)
    8585{
    8686    // Wrap the passed-in channel in a MessagePort, and send it off via a connect event.
  • trunk/Source/WebKit/chromium/src/WebSharedWorkerImpl.h

    r59022 r85165  
    6464    virtual ~WebSharedWorkerImpl();
    6565
    66     static void connectTask(WebCore::ScriptExecutionContext*, WebSharedWorkerImpl*, PassOwnPtr<WebCore::MessagePortChannel>);
     66    static void connectTask(WebCore::ScriptExecutionContext*, PassOwnPtr<WebCore::MessagePortChannel>);
    6767
    6868    WebCommonWorkerClient* m_client;
  • trunk/Source/WebKit/chromium/src/WebWorkerBase.cpp

    r85030 r85165  
    9191        MutexLocker locker(m_mutex);
    9292        if (m_worker)
    93             m_worker->postTaskForModeToWorkerContext(createCallbackTask(&didComplete, this, result), m_mode);
     93            m_worker->postTaskForModeToWorkerContext(
     94                createCallbackTask(&didComplete, AllowCrossThreadAccess(this), result), m_mode);
    9495    }
    9596
     
    99100        , m_mode(mode)
    100101    {
    101         worker->dispatchTaskToMainThread(createCallbackTask(&allowDatabaseTask, commonClient, frame, String(name), String(displayName), estimatedSize, this));
     102        worker->dispatchTaskToMainThread(
     103            createCallbackTask(&allowDatabaseTask, AllowCrossThreadAccess(commonClient),
     104                               AllowCrossThreadAccess(frame),
     105                               String(name), String(displayName), estimatedSize,
     106                               AllowCrossThreadAccess(this)));
    102107    }
    103108
     
    264269                                              PassOwnPtr<MessagePortChannelArray> channels)
    265270{
    266     dispatchTaskToMainThread(createCallbackTask(&postMessageTask, this,
     271    dispatchTaskToMainThread(createCallbackTask(&postMessageTask, AllowCrossThreadAccess(this),
    267272                                                message->toWireString(), channels));
    268273}
     
    289294                                                const String& sourceURL)
    290295{
    291     dispatchTaskToMainThread(createCallbackTask(&postExceptionTask, this,
    292                                                 errorMessage, lineNumber,
    293                                                 sourceURL));
     296    dispatchTaskToMainThread(
     297        createCallbackTask(&postExceptionTask, AllowCrossThreadAccess(this),
     298                           errorMessage, lineNumber,
     299                           sourceURL));
    294300}
    295301
     
    314320                                                     const String& sourceURL)
    315321{
    316     dispatchTaskToMainThread(createCallbackTask(&postConsoleMessageTask, this,
     322    dispatchTaskToMainThread(createCallbackTask(&postConsoleMessageTask, AllowCrossThreadAccess(this),
    317323                                                source, type, level,
    318324                                                message, lineNumber, sourceURL));
     
    336342void WebWorkerBase::confirmMessageFromWorkerObject(bool hasPendingActivity)
    337343{
    338     dispatchTaskToMainThread(createCallbackTask(&confirmMessageTask, this,
     344    dispatchTaskToMainThread(createCallbackTask(&confirmMessageTask, AllowCrossThreadAccess(this),
    339345                                                hasPendingActivity));
    340346}
     
    352358{
    353359    dispatchTaskToMainThread(createCallbackTask(&reportPendingActivityTask,
    354                                                 this, hasPendingActivity));
     360                                                AllowCrossThreadAccess(this),
     361                                                hasPendingActivity));
    355362}
    356363
     
    367374{
    368375    dispatchTaskToMainThread(createCallbackTask(&workerContextClosedTask,
    369                                                 this));
     376                                                AllowCrossThreadAccess(this)));
    370377}
    371378
     
    382389{
    383390    dispatchTaskToMainThread(createCallbackTask(&workerContextDestroyedTask,
    384                                                 this));
     391                                                AllowCrossThreadAccess(this)));
    385392}
    386393
  • trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp

    r76216 r85165  
    142142        WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(
    143143            &startWorkerContextTask,
    144             this,
     144            AllowCrossThreadAccess(this),
    145145            scriptURL.string(),
    146146            userAgent,
     
    157157    m_askedToTerminate = true;
    158158    if (!isMainThread()) {
    159         WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&terminateWorkerContextTask, this));
     159        WebWorkerBase::dispatchTaskToMainThread(
     160            createCallbackTask(&terminateWorkerContextTask, AllowCrossThreadAccess(this)));
    160161        return;
    161162    }
     
    173174    if (!isMainThread()) {
    174175        WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&postMessageToWorkerContextTask,
    175                                                                    this,
     176                                                                   AllowCrossThreadAccess(this),
    176177                                                                   message->toWireString(),
    177178                                                                   channels));
     
    203204    // this object, so don't delete it right away.
    204205    WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&workerObjectDestroyedTask,
    205                                                                this));
     206                                                               AllowCrossThreadAccess(this)));
    206207}
    207208
     
    222223    if (currentThread() != m_workerThreadId) {
    223224        m_scriptExecutionContext->postTask(createCallbackTask(&postMessageToWorkerObjectTask,
    224                                                               this,
     225                                                              AllowCrossThreadAccess(this),
    225226                                                              String(message),
    226227                                                              channels2.release()));
     
    238239    if (currentThread() != m_workerThreadId) {
    239240        m_scriptExecutionContext->postTask(createCallbackTask(&postExceptionToWorkerObjectTask,
    240                                                               this,
     241                                                              AllowCrossThreadAccess(this),
    241242                                                              String(errorMessage),
    242243                                                              lineNumber,
     
    262263    if (currentThread() != m_workerThreadId) {
    263264        m_scriptExecutionContext->postTask(createCallbackTask(&postConsoleMessageToWorkerObjectTask,
    264                                                               this,
     265                                                              AllowCrossThreadAccess(this),
    265266                                                              sourceId,
    266267                                                              messageType,
     
    295296    // collection.
    296297    m_scriptExecutionContext->postTask(createCallbackTask(&confirmMessageFromWorkerObjectTask,
    297                                                           this));
     298                                                          AllowCrossThreadAccess(this)));
    298299}
    299300
     
    302303    // See above comment in confirmMessageFromWorkerObject.
    303304    m_scriptExecutionContext->postTask(createCallbackTask(&reportPendingActivityTask,
    304                                                           this,
     305                                                          AllowCrossThreadAccess(this),
    305306                                                          hasPendingActivity));
    306307}
  • trunk/Source/WebKit/chromium/src/WebWorkerImpl.cpp

    r62589 r85165  
    130130    workerThread()->runLoop().postTask(
    131131        createCallbackTask(&postMessageToWorkerContextTask,
    132                            this, String(message), channels.release()));
     132                           AllowCrossThreadAccess(this), String(message), channels.release()));
    133133}
    134134
  • trunk/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp

    r82540 r85165  
    156156void WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, const String& mode)
    157157{
    158     dispatchTaskToMainThread(createCallbackTask(&openFileSystemOnMainThread, commonClient, type, size, create, this, mode));
     158    dispatchTaskToMainThread(
     159        createCallbackTask(&openFileSystemOnMainThread,
     160                           AllowCrossThreadAccess(commonClient), type, size, create,
     161                           AllowCrossThreadAccess(this), mode));
    159162}
    160163
    161164void WorkerFileSystemCallbacksBridge::postMoveToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode)
    162165{
    163     dispatchTaskToMainThread(createCallbackTask(&moveOnMainThread, fileSystem, sourcePath, destinationPath, this, mode));
     166    dispatchTaskToMainThread(
     167        createCallbackTask(&moveOnMainThread,
     168                           AllowCrossThreadAccess(fileSystem), sourcePath, destinationPath,
     169                           AllowCrossThreadAccess(this), mode));
    164170}
    165171
    166172void WorkerFileSystemCallbacksBridge::postCopyToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode)
    167173{
    168     dispatchTaskToMainThread(createCallbackTask(&copyOnMainThread, fileSystem, sourcePath, destinationPath, this, mode));
     174    dispatchTaskToMainThread(
     175        createCallbackTask(&copyOnMainThread,
     176                           AllowCrossThreadAccess(fileSystem), sourcePath, destinationPath,
     177                           AllowCrossThreadAccess(this), mode));
    169178}
    170179
     
    172181{
    173182    ASSERT(fileSystem);
    174     dispatchTaskToMainThread(createCallbackTask(&removeOnMainThread, fileSystem, path, this, mode));
     183    dispatchTaskToMainThread(
     184        createCallbackTask(&removeOnMainThread,
     185                           AllowCrossThreadAccess(fileSystem), path,
     186                           AllowCrossThreadAccess(this), mode));
    175187}
    176188
     
    178190{
    179191    ASSERT(fileSystem);
    180     dispatchTaskToMainThread(createCallbackTask(&removeRecursivelyOnMainThread, fileSystem, path, this, mode));
     192    dispatchTaskToMainThread(
     193        createCallbackTask(&removeRecursivelyOnMainThread,
     194                           AllowCrossThreadAccess(fileSystem), path,
     195                           AllowCrossThreadAccess(this), mode));
    181196}
    182197
     
    184199{
    185200    ASSERT(fileSystem);
    186     dispatchTaskToMainThread(createCallbackTask(&readMetadataOnMainThread, fileSystem, path, this, mode));
     201    dispatchTaskToMainThread(
     202        createCallbackTask(&readMetadataOnMainThread,
     203                           AllowCrossThreadAccess(fileSystem), path,
     204                           AllowCrossThreadAccess(this), mode));
    187205}
    188206
    189207void WorkerFileSystemCallbacksBridge::postCreateFileToMainThread(WebFileSystem* fileSystem, const String& path, bool exclusive, const String& mode)
    190208{
    191     dispatchTaskToMainThread(createCallbackTask(&createFileOnMainThread, fileSystem, path, exclusive, this, mode));
     209    dispatchTaskToMainThread(
     210        createCallbackTask(&createFileOnMainThread,
     211                           AllowCrossThreadAccess(fileSystem), path, exclusive,
     212                           AllowCrossThreadAccess(this), mode));
    192213}
    193214
     
    195216{
    196217    ASSERT(fileSystem);
    197     dispatchTaskToMainThread(createCallbackTask(&createDirectoryOnMainThread, fileSystem, path, exclusive, this, mode));
     218    dispatchTaskToMainThread(
     219        createCallbackTask(&createDirectoryOnMainThread,
     220                           AllowCrossThreadAccess(fileSystem), path, exclusive,
     221                           AllowCrossThreadAccess(this), mode));
    198222}
    199223
     
    201225{
    202226    ASSERT(fileSystem);
    203     dispatchTaskToMainThread(createCallbackTask(&fileExistsOnMainThread, fileSystem, path, this, mode));
     227    dispatchTaskToMainThread(
     228        createCallbackTask(&fileExistsOnMainThread,
     229                           AllowCrossThreadAccess(fileSystem), path,
     230                           AllowCrossThreadAccess(this), mode));
    204231}
    205232
     
    207234{
    208235    ASSERT(fileSystem);
    209     dispatchTaskToMainThread(createCallbackTask(&directoryExistsOnMainThread, fileSystem, path, this, mode));
     236    dispatchTaskToMainThread(
     237        createCallbackTask(&directoryExistsOnMainThread,
     238                           AllowCrossThreadAccess(fileSystem), path,
     239                           AllowCrossThreadAccess(this), mode));
    210240}
    211241
     
    213243{
    214244    ASSERT(fileSystem);
    215     dispatchTaskToMainThread(createCallbackTask(&readDirectoryOnMainThread, fileSystem, path, this, mode));
     245    dispatchTaskToMainThread(
     246        createCallbackTask(&readDirectoryOnMainThread,
     247                           AllowCrossThreadAccess(fileSystem), path,
     248                           AllowCrossThreadAccess(this), mode));
    216249}
    217250
     
    277310void WorkerFileSystemCallbacksBridge::didFailOnMainThread(WebFileError error, const String& mode)
    278311{
    279     mayPostTaskToWorker(createCallbackTask(&didFailOnWorkerThread, this, error), mode);
     312    mayPostTaskToWorker(createCallbackTask(&didFailOnWorkerThread, AllowCrossThreadAccess(this), error), mode);
    280313}
    281314
    282315void WorkerFileSystemCallbacksBridge::didOpenFileSystemOnMainThread(const String& name, const String& rootPath, const String& mode)
    283316{
    284     mayPostTaskToWorker(createCallbackTask(&didOpenFileSystemOnWorkerThread, this, name, rootPath), mode);
     317    mayPostTaskToWorker(createCallbackTask(&didOpenFileSystemOnWorkerThread,
     318                                           AllowCrossThreadAccess(this), name, rootPath), mode);
    285319}
    286320
    287321void WorkerFileSystemCallbacksBridge::didSucceedOnMainThread(const String& mode)
    288322{
    289     mayPostTaskToWorker(createCallbackTask(&didSucceedOnWorkerThread, this), mode);
     323    mayPostTaskToWorker(createCallbackTask(&didSucceedOnWorkerThread, AllowCrossThreadAccess(this)), mode);
    290324}
    291325
    292326void WorkerFileSystemCallbacksBridge::didReadMetadataOnMainThread(const WebFileInfo& info, const String& mode)
    293327{
    294     mayPostTaskToWorker(createCallbackTask(&didReadMetadataOnWorkerThread, this, info), mode);
     328    mayPostTaskToWorker(createCallbackTask(&didReadMetadataOnWorkerThread, AllowCrossThreadAccess(this), info), mode);
    295329}
    296330
    297331void WorkerFileSystemCallbacksBridge::didReadDirectoryOnMainThread(const WebVector<WebFileSystemEntry>& entries, bool hasMore, const String& mode)
    298332{
    299     mayPostTaskToWorker(createCallbackTask(&didReadDirectoryOnWorkerThread, this, entries, hasMore), mode);
     333    mayPostTaskToWorker(
     334        createCallbackTask(&didReadDirectoryOnWorkerThread,
     335                           AllowCrossThreadAccess(this), entries, hasMore), mode);
    300336}
    301337
  • trunk/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp

    r72711 r85165  
    6262    ASSERT(!m_operationInProgress);
    6363    m_operationInProgress = true;
    64     dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, this, position, data));
     64    dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread,
     65                                                AllowCrossThreadAccess(this), position, data));
    6566}
    6667
     
    6970    ASSERT(!m_operationInProgress);
    7071    m_operationInProgress = true;
    71     dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, this, length));
     72    dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread,
     73                                                AllowCrossThreadAccess(this), length));
    7274}
    7375
     
    7577{
    7678    ASSERT(m_operationInProgress);
    77     dispatchTaskToMainThread(createCallbackTask(&abortOnMainThread, this));
     79    dispatchTaskToMainThread(createCallbackTask(&abortOnMainThread, AllowCrossThreadAccess(this)));
    7880}
    7981
     
    114116void WorkerFileWriterCallbacksBridge::didWrite(long long bytes, bool complete)
    115117{
    116     dispatchTaskToWorkerThread(createCallbackTask(&didWriteOnWorkerThread, this, bytes, complete));
     118    dispatchTaskToWorkerThread(
     119        createCallbackTask(&didWriteOnWorkerThread, AllowCrossThreadAccess(this), bytes, complete));
    117120}
    118121
    119122void WorkerFileWriterCallbacksBridge::didFail(WebFileError error)
    120123{
    121     dispatchTaskToWorkerThread(createCallbackTask(&didFailOnWorkerThread, this, error));
     124    dispatchTaskToWorkerThread(
     125        createCallbackTask(&didFailOnWorkerThread, AllowCrossThreadAccess(this), error));
    122126}
    123127
    124128void WorkerFileWriterCallbacksBridge::didTruncate()
    125129{
    126     dispatchTaskToWorkerThread(createCallbackTask(&didTruncateOnWorkerThread, this));
     130    dispatchTaskToWorkerThread(
     131        createCallbackTask(&didTruncateOnWorkerThread, AllowCrossThreadAccess(this)));
    127132}
    128133
     
    145150void WorkerFileWriterCallbacksBridge::postInitToMainThread(const String& path)
    146151{
    147     dispatchTaskToMainThread(createCallbackTask(&initOnMainThread, this, path));
     152    dispatchTaskToMainThread(
     153        createCallbackTask(&initOnMainThread, AllowCrossThreadAccess(this), path));
    148154}
    149155
     
    197203{
    198204    ASSERT(m_workerContext->isContextThread());
    199     WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, this, task));
     205    WebWorkerBase::dispatchTaskToMainThread(
     206        createCallbackTask(&runTaskOnMainThread, AllowCrossThreadAccess(this), task));
    200207}
    201208
     
    203210{
    204211    ASSERT(isMainThread());
    205     m_proxy->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, this, task), m_mode);
     212    m_proxy->postTaskForModeToWorkerContext(
     213        createCallbackTask(&runTaskOnWorkerThread, AllowCrossThreadAccess(this), task), m_mode);
    206214}
    207215
  • trunk/Source/WebKit/chromium/tests/CCThreadTest.cpp

    r83249 r85165  
    5454    PingPongUsingCondition target;
    5555    CCCompletionEvent completion;
    56     thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping, &completion));
     56    thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping,
     57                                        AllowCrossThreadAccess(&completion)));
    5758    completion.wait();
    5859
Note: See TracChangeset for help on using the changeset viewer.