Ignore:
Timestamp:
Nov 2, 2009, 1:31:22 PM (16 years ago)
Author:
[email protected]
Message:

Remove threadsafe refcounting from tasks used with WTF::MessageQueue.
https://bugs.webkit.org/show_bug.cgi?id=30612

Reviewed by David Levin.

JavaScriptCore:

  • wtf/MessageQueue.h:

(WTF::MessageQueue::alwaysTruePredicate):
(WTF::MessageQueue::~MessageQueue):
(WTF::MessageQueue::append):
(WTF::MessageQueue::appendAndCheckEmpty):
(WTF::MessageQueue::prepend):
(WTF::MessageQueue::waitForMessage):
(WTF::MessageQueue::waitForMessageFilteredWithTimeout):
(WTF::MessageQueue::tryGetMessage):
(WTF::MessageQueue::removeIf):
The MessageQueue is changed to act as a queue of OwnPtr<DataType>. It takes ownership
of posted tasks and passes it to the new owner (in another thread) when the task is fetched.
All methods have arguments of type PassOwnPtr<DataType> and return the same type.

  • wtf/Threading.cpp:

(WTF::createThread):
Superficial change to trigger rebuild of JSC project on Windows,
workaround for https://bugs.webkit.org/show_bug.cgi?id=30890

WebCore:

No new tests since no new functionality. Storage, MessagePorts and Workers tests cover this.

There are a lot of files but most changes are simply replace RefPtr and PassRefPtr with
OwnPtr and PassOwnPtr when dealing with Tasks.

ScriptExecutionContext::Task, DatabaseTask and WorkerRunLoop::Task are no longer
threadsafe refcounted, but simply Noncopyable.

  • dom/Document.cpp:

(WebCore::ScriptExecutionContextTaskTimer::ScriptExecutionContextTaskTimer):
(WebCore::PerformTaskContext::PerformTaskContext):
(WebCore::Document::postTask):

  • dom/Document.h:
  • dom/ScriptExecutionContext.cpp:

(WebCore::ProcessMessagesSoonTask::create):

  • dom/ScriptExecutionContext.h:
  • dom/default/PlatformMessagePortChannel.cpp:

(WebCore::PlatformMessagePortChannel::tryGetMessageFromRemote):

  • dom/default/PlatformMessagePortChannel.h:

(WebCore::PlatformMessagePortChannel::MessagePortQueue::tryGetMessage):
(WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):

  • loader/FrameLoader.cpp:

(WebCore::HashChangeEventTask::create):

  • loader/appcache/ApplicationCacheGroup.cpp:

(WebCore::CallCacheListenerTask::create):

  • storage/Database.cpp:

(WebCore::Database::openAndVerifyVersion):
(WebCore::Database::markAsDeletedAndClose):
(WebCore::Database::scheduleTransaction):
(WebCore::Database::scheduleTransactionStep):
(WebCore::Database::tableNames):

  • storage/DatabaseTask.h:

(WebCore::DatabaseOpenTask::create):
(WebCore::DatabaseCloseTask::create):
(WebCore::DatabaseTransactionTask::create):
(WebCore::DatabaseTableNamesTask::create):

  • storage/DatabaseThread.cpp:

(WebCore::DatabaseThread::databaseThread):
(WebCore::DatabaseThread::scheduleTask):
(WebCore::DatabaseThread::scheduleImmediateTask):
(WebCore::SameDatabasePredicate::operator()):

  • storage/DatabaseThread.h:
  • storage/LocalStorageTask.h:

(WebCore::LocalStorageTask::createImport):
(WebCore::LocalStorageTask::createSync):
(WebCore::LocalStorageTask::createTerminate):

  • storage/LocalStorageThread.cpp:

(WebCore::LocalStorageThread::localStorageThread):

  • storage/LocalStorageThread.h:
  • websockets/WebSocket.cpp:

(WebCore::ProcessWebSocketEventTask::create):

  • workers/DefaultSharedWorkerRepository.cpp:

(WebCore::SharedWorkerProxy::postTaskToLoader):
(WebCore::SharedWorkerProxy::postTaskForModeToWorkerContext):
(WebCore::SharedWorkerConnectTask::create):

  • workers/GenericWorkerTask.h:

(WebCore::GenericWorkerTask1::create):
(WebCore::GenericWorkerTask2::create):
(WebCore::GenericWorkerTask3::create):
(WebCore::GenericWorkerTask4::create):
(WebCore::GenericWorkerTask5::create):
(WebCore::GenericWorkerTask6::create):
(WebCore::GenericWorkerTask7::create):
(WebCore::GenericWorkerTask8::create):
(WebCore::createCallbackTask):

  • workers/WorkerContext.cpp:

(WebCore::WorkerContext::postTask):

  • workers/WorkerContext.h:
  • workers/WorkerLoaderProxy.h:
  • workers/WorkerMessagingProxy.cpp:

(WebCore::MessageWorkerContextTask::create):
(WebCore::MessageWorkerTask::create):
(WebCore::WorkerExceptionTask::create):
(WebCore::WorkerContextDestroyedTask::create):
(WebCore::WorkerTerminateTask::create):
(WebCore::WorkerThreadActivityReportTask::create):
(WebCore::WorkerMessagingProxy::postTaskForModeToWorkerContext):
(WebCore::WorkerMessagingProxy::postTaskToLoader):
(WebCore::WorkerMessagingProxy::workerThreadCreated):

  • workers/WorkerMessagingProxy.h:
  • workers/WorkerRunLoop.cpp:

(WebCore::ModePredicate::operator()):
(WebCore::WorkerRunLoop::runInMode):
(WebCore::WorkerRunLoop::postTask):
(WebCore::WorkerRunLoop::postTaskForMode):
(WebCore::WorkerRunLoop::Task::create):
(WebCore::WorkerRunLoop::Task::performTask):
(WebCore::WorkerRunLoop::Task::Task):

  • workers/WorkerRunLoop.h:

(WebCore::WorkerRunLoop::Task::~Task):
(WebCore::WorkerRunLoop::Task::mode):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Threading.cpp

    r50248 r50427  
    7676    NewThreadContext* context = new NewThreadContext(entryPoint, data, name);
    7777
    78     // Prevent the thread body from executing until we've established the thread identifier
     78    // Prevent the thread body from executing until we've established the thread identifier.
    7979    MutexLocker locker(context->creationMutex);
    8080
Note: See TracChangeset for help on using the changeset viewer.