Changeset 85165 in webkit
- Timestamp:
- Apr 27, 2011 11:21:34 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85164 r85165 1 2011-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 1 67 2011-04-27 Adam Barth <abarth@webkit.org> 2 68 -
trunk/Source/WebCore/fileapi/FileReader.cpp
r84923 r85165 130 130 131 131 if (m_state == None) 132 scriptExecutionContext()->postTask(createCallbackTask(&delayedStart, this));132 scriptExecutionContext()->postTask(createCallbackTask(&delayedStart, AllowAccessLater(this))); 133 133 134 134 m_blob = blob; … … 151 151 152 152 // 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))); 154 155 } 155 156 -
trunk/Source/WebCore/fileapi/FileStreamProxy.cpp
r77852 r85165 87 87 return; 88 88 m_stream->start(); 89 m_context->postTask(createCallbackTask(&didStart, this));89 m_context->postTask(createCallbackTask(&didStart, AllowCrossThreadAccess(this))); 90 90 } 91 91 … … 108 108 { 109 109 m_stream->stop(); 110 m_context->postTask(createCallbackTask(&derefProxyOnContext, this));110 m_context->postTask(createCallbackTask(&derefProxyOnContext, AllowCrossThreadAccess(this))); 111 111 } 112 112 … … 125 125 { 126 126 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)); 128 128 } 129 129 … … 142 142 { 143 143 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)); 145 145 } 146 146 147 147 void FileStreamProxy::openForWrite(const String& path) 148 148 { 149 fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::openForWriteOnFileThread, path)); 149 fileThread()->postTask( 150 createFileThreadTask(this, 151 &FileStreamProxy::openForWriteOnFileThread, path)); 150 152 } 151 153 … … 153 155 { 154 156 bool success = m_stream->openForWrite(path); 155 m_context->postTask(createCallbackTask(&didOpen, this, success));157 m_context->postTask(createCallbackTask(&didOpen, AllowCrossThreadAccess(this), success)); 156 158 } 157 159 … … 174 176 void FileStreamProxy::read(char* buffer, int length) 175 177 { 176 fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::readOnFileThread, buffer, length)); 178 fileThread()->postTask( 179 createFileThreadTask(this, &FileStreamProxy::readOnFileThread, 180 AllowCrossThreadAccess(buffer), length)); 177 181 } 178 182 … … 180 184 { 181 185 int bytesRead = m_stream->read(buffer, length); 182 m_context->postTask(createCallbackTask(&didRead, this, bytesRead));186 m_context->postTask(createCallbackTask(&didRead, AllowCrossThreadAccess(this), bytesRead)); 183 187 } 184 188 … … 197 201 { 198 202 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)); 200 204 } 201 205 … … 214 218 { 215 219 bool success = m_stream->truncate(position); 216 m_context->postTask(createCallbackTask(&didTruncate, this, success));220 m_context->postTask(createCallbackTask(&didTruncate, AllowCrossThreadAccess(this), success)); 217 221 } 218 222 -
trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp
r84260 r85165 96 96 { 97 97 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)); 99 101 } 100 102 … … 130 132 131 133 // "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))); 133 136 } 134 137 … … 146 149 void WorkerThreadableLoader::MainThreadBridge::cancel() 147 150 { 148 m_loaderProxy.postTaskToLoader(createCallbackTask(&MainThreadBridge::mainThreadCancel, this)); 151 m_loaderProxy.postTaskToLoader( 152 createCallbackTask(&MainThreadBridge::mainThreadCancel, AllowCrossThreadAccess(this))); 149 153 ThreadableLoaderClientWrapper* clientWrapper = m_workerClientWrapper.get(); 150 154 if (!clientWrapper->done()) { -
trunk/Source/WebCore/page/GeolocationPositionCache.cpp
r74794 r85165 129 129 void GeolocationPositionCache::triggerReadFromDatabase() 130 130 { 131 m_queue.append(createCallbackTask(&GeolocationPositionCache::readFromDatabase, this));131 m_queue.append(createCallbackTask(&GeolocationPositionCache::readFromDatabase, AllowCrossThreadAccess(this))); 132 132 } 133 133 … … 188 188 void GeolocationPositionCache::triggerWriteToDatabase() 189 189 { 190 m_queue.append(createCallbackTask(writeToDatabase, this));190 m_queue.append(createCallbackTask(writeToDatabase, AllowCrossThreadAccess(this))); 191 191 } 192 192 -
trunk/Source/WebCore/platform/CrossThreadCopier.h
r81567 r85165 63 63 }; 64 64 65 // Pointers get passed through without any significant changes.66 template<typename T> struct CrossThreadCopierBase<false, false, T*> : public CrossThreadCopierPassThrough<T*> {67 };68 69 65 template<> struct CrossThreadCopierBase<false, false, ThreadableLoaderOptions> : public CrossThreadCopierPassThrough<ThreadableLoaderOptions> { 70 66 }; … … 120 116 }; 121 117 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 122 157 } // namespace WebCore 123 158 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCCompletionEvent.h
r83249 r85165 1 1 2 /* 2 3 * Copyright (C) 2011 Google Inc. All rights reserved. -
trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
r85145 r85165 385 385 RefPtr<IDBObjectStoreBackendImpl> objectStore = this; 386 386 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))) { 389 392 ec = IDBDatabaseException::NOT_ALLOWED_ERR; 390 393 return 0; … … 438 441 RefPtr<IDBObjectStoreBackendImpl> objectStore = this; 439 442 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))) { 442 448 ec = IDBDatabaseException::NOT_ALLOWED_ERR; 443 449 return; … … 452 458 } 453 459 454 void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, unsigned short direction, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction Ptr, ExceptionCode& ec)460 void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, unsigned short direction, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) 455 461 { 456 462 RefPtr<IDBObjectStoreBackendImpl> objectStore = this; 457 463 RefPtr<IDBKeyRange> range = prpRange; 458 464 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 } 462 471 } 463 472 -
trunk/Source/WebCore/storage/SQLCallbackWrapper.h
r80897 r85165 75 75 callback = m_callback.release().leakRef(); 76 76 } 77 context->postTask(createCallbackTask(&safeRelease, callback));77 context->postTask(createCallbackTask(&safeRelease, AllowAccessLater(callback))); 78 78 } 79 79 -
trunk/Source/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
r63159 r85165 247 247 248 248 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); 250 253 } 251 254 … … 259 262 ASSERT(m_workerClientWrapper.get()); 260 263 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)); 262 267 waitForMethodCompletion(); 263 268 ASSERT(m_peer); … … 282 287 ASSERT(m_workerClientWrapper); 283 288 ASSERT(m_peer); 284 m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadConnect, m_peer)); 289 m_loaderProxy.postTaskToLoader( 290 createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadConnect, AllowCrossThreadAccess(m_peer))); 285 291 } 286 292 … … 300 306 ASSERT(m_peer); 301 307 setMethodNotCompleted(); 302 m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSend, m_peer, message)); 308 m_loaderProxy.postTaskToLoader( 309 createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSend, 310 AllowCrossThreadAccess(m_peer), message)); 303 311 RefPtr<Bridge> protect(this); 304 312 waitForMethodCompletion(); … … 322 330 ASSERT(m_peer); 323 331 setMethodNotCompleted(); 324 m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadBufferedAmount, m_peer)); 332 m_loaderProxy.postTaskToLoader( 333 createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadBufferedAmount, AllowCrossThreadAccess(m_peer))); 325 334 RefPtr<Bridge> protect(this); 326 335 waitForMethodCompletion(); … … 343 352 { 344 353 ASSERT(m_peer); 345 m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadClose, m_peer)); 354 m_loaderProxy.postTaskToLoader( 355 createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadClose, AllowCrossThreadAccess(m_peer))); 346 356 } 347 357 … … 361 371 Peer* peer = m_peer; 362 372 m_peer = 0; 363 m_loaderProxy.postTaskToLoader(createCallbackTask(&mainThreadDestroy, peer)); 373 m_loaderProxy.postTaskToLoader( 374 createCallbackTask(&mainThreadDestroy, AllowCrossThreadAccess(peer))); 364 375 } 365 376 m_workerContext = 0; … … 378 389 { 379 390 ASSERT(m_peer); 380 m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSuspend, m_peer)); 391 m_loaderProxy.postTaskToLoader( 392 createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSuspend, AllowCrossThreadAccess(m_peer))); 381 393 } 382 394 … … 393 405 { 394 406 ASSERT(m_peer); 395 m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadResume, m_peer)); 407 m_loaderProxy.postTaskToLoader( 408 createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadResume, AllowCrossThreadAccess(m_peer))); 396 409 } 397 410 -
trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp
r84892 r85165 289 289 void WorkerMessagingProxy::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL) 290 290 { 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)); 292 294 } 293 295 -
trunk/Source/WebKit/chromium/ChangeLog
r85136 r85165 1 2011-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 1 64 2011-04-27 James Robinson <jamesr@chromium.org> 2 65 -
trunk/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp
r62574 r85165 77 77 78 78 workerThread()->runLoop().postTask( 79 createCallbackTask(&connectTask, this,channel.release()));79 createCallbackTask(&connectTask, channel.release())); 80 80 if (listener) 81 81 listener->connected(); 82 82 } 83 83 84 void WebSharedWorkerImpl::connectTask(ScriptExecutionContext* context, WebSharedWorkerImpl* worker,PassOwnPtr<MessagePortChannel> channel)84 void WebSharedWorkerImpl::connectTask(ScriptExecutionContext* context, PassOwnPtr<MessagePortChannel> channel) 85 85 { 86 86 // 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 64 64 virtual ~WebSharedWorkerImpl(); 65 65 66 static void connectTask(WebCore::ScriptExecutionContext*, WebSharedWorkerImpl*,PassOwnPtr<WebCore::MessagePortChannel>);66 static void connectTask(WebCore::ScriptExecutionContext*, PassOwnPtr<WebCore::MessagePortChannel>); 67 67 68 68 WebCommonWorkerClient* m_client; -
trunk/Source/WebKit/chromium/src/WebWorkerBase.cpp
r85030 r85165 91 91 MutexLocker locker(m_mutex); 92 92 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); 94 95 } 95 96 … … 99 100 , m_mode(mode) 100 101 { 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))); 102 107 } 103 108 … … 264 269 PassOwnPtr<MessagePortChannelArray> channels) 265 270 { 266 dispatchTaskToMainThread(createCallbackTask(&postMessageTask, this,271 dispatchTaskToMainThread(createCallbackTask(&postMessageTask, AllowCrossThreadAccess(this), 267 272 message->toWireString(), channels)); 268 273 } … … 289 294 const String& sourceURL) 290 295 { 291 dispatchTaskToMainThread(createCallbackTask(&postExceptionTask, this, 292 errorMessage, lineNumber, 293 sourceURL)); 296 dispatchTaskToMainThread( 297 createCallbackTask(&postExceptionTask, AllowCrossThreadAccess(this), 298 errorMessage, lineNumber, 299 sourceURL)); 294 300 } 295 301 … … 314 320 const String& sourceURL) 315 321 { 316 dispatchTaskToMainThread(createCallbackTask(&postConsoleMessageTask, this,322 dispatchTaskToMainThread(createCallbackTask(&postConsoleMessageTask, AllowCrossThreadAccess(this), 317 323 source, type, level, 318 324 message, lineNumber, sourceURL)); … … 336 342 void WebWorkerBase::confirmMessageFromWorkerObject(bool hasPendingActivity) 337 343 { 338 dispatchTaskToMainThread(createCallbackTask(&confirmMessageTask, this,344 dispatchTaskToMainThread(createCallbackTask(&confirmMessageTask, AllowCrossThreadAccess(this), 339 345 hasPendingActivity)); 340 346 } … … 352 358 { 353 359 dispatchTaskToMainThread(createCallbackTask(&reportPendingActivityTask, 354 this, hasPendingActivity)); 360 AllowCrossThreadAccess(this), 361 hasPendingActivity)); 355 362 } 356 363 … … 367 374 { 368 375 dispatchTaskToMainThread(createCallbackTask(&workerContextClosedTask, 369 this));376 AllowCrossThreadAccess(this))); 370 377 } 371 378 … … 382 389 { 383 390 dispatchTaskToMainThread(createCallbackTask(&workerContextDestroyedTask, 384 this));391 AllowCrossThreadAccess(this))); 385 392 } 386 393 -
trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp
r76216 r85165 142 142 WebWorkerBase::dispatchTaskToMainThread(createCallbackTask( 143 143 &startWorkerContextTask, 144 this,144 AllowCrossThreadAccess(this), 145 145 scriptURL.string(), 146 146 userAgent, … … 157 157 m_askedToTerminate = true; 158 158 if (!isMainThread()) { 159 WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&terminateWorkerContextTask, this)); 159 WebWorkerBase::dispatchTaskToMainThread( 160 createCallbackTask(&terminateWorkerContextTask, AllowCrossThreadAccess(this))); 160 161 return; 161 162 } … … 173 174 if (!isMainThread()) { 174 175 WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&postMessageToWorkerContextTask, 175 this,176 AllowCrossThreadAccess(this), 176 177 message->toWireString(), 177 178 channels)); … … 203 204 // this object, so don't delete it right away. 204 205 WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&workerObjectDestroyedTask, 205 this));206 AllowCrossThreadAccess(this))); 206 207 } 207 208 … … 222 223 if (currentThread() != m_workerThreadId) { 223 224 m_scriptExecutionContext->postTask(createCallbackTask(&postMessageToWorkerObjectTask, 224 this,225 AllowCrossThreadAccess(this), 225 226 String(message), 226 227 channels2.release())); … … 238 239 if (currentThread() != m_workerThreadId) { 239 240 m_scriptExecutionContext->postTask(createCallbackTask(&postExceptionToWorkerObjectTask, 240 this,241 AllowCrossThreadAccess(this), 241 242 String(errorMessage), 242 243 lineNumber, … … 262 263 if (currentThread() != m_workerThreadId) { 263 264 m_scriptExecutionContext->postTask(createCallbackTask(&postConsoleMessageToWorkerObjectTask, 264 this,265 AllowCrossThreadAccess(this), 265 266 sourceId, 266 267 messageType, … … 295 296 // collection. 296 297 m_scriptExecutionContext->postTask(createCallbackTask(&confirmMessageFromWorkerObjectTask, 297 this));298 AllowCrossThreadAccess(this))); 298 299 } 299 300 … … 302 303 // See above comment in confirmMessageFromWorkerObject. 303 304 m_scriptExecutionContext->postTask(createCallbackTask(&reportPendingActivityTask, 304 this,305 AllowCrossThreadAccess(this), 305 306 hasPendingActivity)); 306 307 } -
trunk/Source/WebKit/chromium/src/WebWorkerImpl.cpp
r62589 r85165 130 130 workerThread()->runLoop().postTask( 131 131 createCallbackTask(&postMessageToWorkerContextTask, 132 this, String(message), channels.release()));132 AllowCrossThreadAccess(this), String(message), channels.release())); 133 133 } 134 134 -
trunk/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
r82540 r85165 156 156 void WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, const String& mode) 157 157 { 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)); 159 162 } 160 163 161 164 void WorkerFileSystemCallbacksBridge::postMoveToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode) 162 165 { 163 dispatchTaskToMainThread(createCallbackTask(&moveOnMainThread, fileSystem, sourcePath, destinationPath, this, mode)); 166 dispatchTaskToMainThread( 167 createCallbackTask(&moveOnMainThread, 168 AllowCrossThreadAccess(fileSystem), sourcePath, destinationPath, 169 AllowCrossThreadAccess(this), mode)); 164 170 } 165 171 166 172 void WorkerFileSystemCallbacksBridge::postCopyToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode) 167 173 { 168 dispatchTaskToMainThread(createCallbackTask(©OnMainThread, fileSystem, sourcePath, destinationPath, this, mode)); 174 dispatchTaskToMainThread( 175 createCallbackTask(©OnMainThread, 176 AllowCrossThreadAccess(fileSystem), sourcePath, destinationPath, 177 AllowCrossThreadAccess(this), mode)); 169 178 } 170 179 … … 172 181 { 173 182 ASSERT(fileSystem); 174 dispatchTaskToMainThread(createCallbackTask(&removeOnMainThread, fileSystem, path, this, mode)); 183 dispatchTaskToMainThread( 184 createCallbackTask(&removeOnMainThread, 185 AllowCrossThreadAccess(fileSystem), path, 186 AllowCrossThreadAccess(this), mode)); 175 187 } 176 188 … … 178 190 { 179 191 ASSERT(fileSystem); 180 dispatchTaskToMainThread(createCallbackTask(&removeRecursivelyOnMainThread, fileSystem, path, this, mode)); 192 dispatchTaskToMainThread( 193 createCallbackTask(&removeRecursivelyOnMainThread, 194 AllowCrossThreadAccess(fileSystem), path, 195 AllowCrossThreadAccess(this), mode)); 181 196 } 182 197 … … 184 199 { 185 200 ASSERT(fileSystem); 186 dispatchTaskToMainThread(createCallbackTask(&readMetadataOnMainThread, fileSystem, path, this, mode)); 201 dispatchTaskToMainThread( 202 createCallbackTask(&readMetadataOnMainThread, 203 AllowCrossThreadAccess(fileSystem), path, 204 AllowCrossThreadAccess(this), mode)); 187 205 } 188 206 189 207 void WorkerFileSystemCallbacksBridge::postCreateFileToMainThread(WebFileSystem* fileSystem, const String& path, bool exclusive, const String& mode) 190 208 { 191 dispatchTaskToMainThread(createCallbackTask(&createFileOnMainThread, fileSystem, path, exclusive, this, mode)); 209 dispatchTaskToMainThread( 210 createCallbackTask(&createFileOnMainThread, 211 AllowCrossThreadAccess(fileSystem), path, exclusive, 212 AllowCrossThreadAccess(this), mode)); 192 213 } 193 214 … … 195 216 { 196 217 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)); 198 222 } 199 223 … … 201 225 { 202 226 ASSERT(fileSystem); 203 dispatchTaskToMainThread(createCallbackTask(&fileExistsOnMainThread, fileSystem, path, this, mode)); 227 dispatchTaskToMainThread( 228 createCallbackTask(&fileExistsOnMainThread, 229 AllowCrossThreadAccess(fileSystem), path, 230 AllowCrossThreadAccess(this), mode)); 204 231 } 205 232 … … 207 234 { 208 235 ASSERT(fileSystem); 209 dispatchTaskToMainThread(createCallbackTask(&directoryExistsOnMainThread, fileSystem, path, this, mode)); 236 dispatchTaskToMainThread( 237 createCallbackTask(&directoryExistsOnMainThread, 238 AllowCrossThreadAccess(fileSystem), path, 239 AllowCrossThreadAccess(this), mode)); 210 240 } 211 241 … … 213 243 { 214 244 ASSERT(fileSystem); 215 dispatchTaskToMainThread(createCallbackTask(&readDirectoryOnMainThread, fileSystem, path, this, mode)); 245 dispatchTaskToMainThread( 246 createCallbackTask(&readDirectoryOnMainThread, 247 AllowCrossThreadAccess(fileSystem), path, 248 AllowCrossThreadAccess(this), mode)); 216 249 } 217 250 … … 277 310 void WorkerFileSystemCallbacksBridge::didFailOnMainThread(WebFileError error, const String& mode) 278 311 { 279 mayPostTaskToWorker(createCallbackTask(&didFailOnWorkerThread, this, error), mode);312 mayPostTaskToWorker(createCallbackTask(&didFailOnWorkerThread, AllowCrossThreadAccess(this), error), mode); 280 313 } 281 314 282 315 void WorkerFileSystemCallbacksBridge::didOpenFileSystemOnMainThread(const String& name, const String& rootPath, const String& mode) 283 316 { 284 mayPostTaskToWorker(createCallbackTask(&didOpenFileSystemOnWorkerThread, this, name, rootPath), mode); 317 mayPostTaskToWorker(createCallbackTask(&didOpenFileSystemOnWorkerThread, 318 AllowCrossThreadAccess(this), name, rootPath), mode); 285 319 } 286 320 287 321 void WorkerFileSystemCallbacksBridge::didSucceedOnMainThread(const String& mode) 288 322 { 289 mayPostTaskToWorker(createCallbackTask(&didSucceedOnWorkerThread, this), mode);323 mayPostTaskToWorker(createCallbackTask(&didSucceedOnWorkerThread, AllowCrossThreadAccess(this)), mode); 290 324 } 291 325 292 326 void WorkerFileSystemCallbacksBridge::didReadMetadataOnMainThread(const WebFileInfo& info, const String& mode) 293 327 { 294 mayPostTaskToWorker(createCallbackTask(&didReadMetadataOnWorkerThread, this, info), mode);328 mayPostTaskToWorker(createCallbackTask(&didReadMetadataOnWorkerThread, AllowCrossThreadAccess(this), info), mode); 295 329 } 296 330 297 331 void WorkerFileSystemCallbacksBridge::didReadDirectoryOnMainThread(const WebVector<WebFileSystemEntry>& entries, bool hasMore, const String& mode) 298 332 { 299 mayPostTaskToWorker(createCallbackTask(&didReadDirectoryOnWorkerThread, this, entries, hasMore), mode); 333 mayPostTaskToWorker( 334 createCallbackTask(&didReadDirectoryOnWorkerThread, 335 AllowCrossThreadAccess(this), entries, hasMore), mode); 300 336 } 301 337 -
trunk/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp
r72711 r85165 62 62 ASSERT(!m_operationInProgress); 63 63 m_operationInProgress = true; 64 dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, this, position, data)); 64 dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, 65 AllowCrossThreadAccess(this), position, data)); 65 66 } 66 67 … … 69 70 ASSERT(!m_operationInProgress); 70 71 m_operationInProgress = true; 71 dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, this, length)); 72 dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, 73 AllowCrossThreadAccess(this), length)); 72 74 } 73 75 … … 75 77 { 76 78 ASSERT(m_operationInProgress); 77 dispatchTaskToMainThread(createCallbackTask(&abortOnMainThread, this));79 dispatchTaskToMainThread(createCallbackTask(&abortOnMainThread, AllowCrossThreadAccess(this))); 78 80 } 79 81 … … 114 116 void WorkerFileWriterCallbacksBridge::didWrite(long long bytes, bool complete) 115 117 { 116 dispatchTaskToWorkerThread(createCallbackTask(&didWriteOnWorkerThread, this, bytes, complete)); 118 dispatchTaskToWorkerThread( 119 createCallbackTask(&didWriteOnWorkerThread, AllowCrossThreadAccess(this), bytes, complete)); 117 120 } 118 121 119 122 void WorkerFileWriterCallbacksBridge::didFail(WebFileError error) 120 123 { 121 dispatchTaskToWorkerThread(createCallbackTask(&didFailOnWorkerThread, this, error)); 124 dispatchTaskToWorkerThread( 125 createCallbackTask(&didFailOnWorkerThread, AllowCrossThreadAccess(this), error)); 122 126 } 123 127 124 128 void WorkerFileWriterCallbacksBridge::didTruncate() 125 129 { 126 dispatchTaskToWorkerThread(createCallbackTask(&didTruncateOnWorkerThread, this)); 130 dispatchTaskToWorkerThread( 131 createCallbackTask(&didTruncateOnWorkerThread, AllowCrossThreadAccess(this))); 127 132 } 128 133 … … 145 150 void WorkerFileWriterCallbacksBridge::postInitToMainThread(const String& path) 146 151 { 147 dispatchTaskToMainThread(createCallbackTask(&initOnMainThread, this, path)); 152 dispatchTaskToMainThread( 153 createCallbackTask(&initOnMainThread, AllowCrossThreadAccess(this), path)); 148 154 } 149 155 … … 197 203 { 198 204 ASSERT(m_workerContext->isContextThread()); 199 WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, this, task)); 205 WebWorkerBase::dispatchTaskToMainThread( 206 createCallbackTask(&runTaskOnMainThread, AllowCrossThreadAccess(this), task)); 200 207 } 201 208 … … 203 210 { 204 211 ASSERT(isMainThread()); 205 m_proxy->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, this, task), m_mode); 212 m_proxy->postTaskForModeToWorkerContext( 213 createCallbackTask(&runTaskOnWorkerThread, AllowCrossThreadAccess(this), task), m_mode); 206 214 } 207 215 -
trunk/Source/WebKit/chromium/tests/CCThreadTest.cpp
r83249 r85165 54 54 PingPongUsingCondition target; 55 55 CCCompletionEvent completion; 56 thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping, &completion)); 56 thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping, 57 AllowCrossThreadAccess(&completion))); 57 58 completion.wait(); 58 59
Note: See TracChangeset
for help on using the changeset viewer.