Changeset 223732 in webkit
- Timestamp:
- Oct 19, 2017 6:34:03 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r223728 r223732 1 2017-10-19 Chris Dumez <cdumez@apple.com> 2 3 SerializedScriptValue passed to postMessage() cannot be null 4 https://bugs.webkit.org/show_bug.cgi?id=178550 5 6 Reviewed by Youenn Fablet. 7 8 SerializedScriptValue passed to postMessage() cannot be null. Therefore, we 9 should use Ref<> type, not RefPtr<>. 10 11 * dom/MessagePortChannel.h: 12 * dom/default/PlatformMessagePortChannel.cpp: 13 (WebCore::MessagePortChannel::postMessageToRemote): 14 * workers/WorkerGlobalScopeProxy.h: 15 * workers/WorkerMessagingProxy.cpp: 16 (WebCore::WorkerMessagingProxy::postMessageToWorkerObject): 17 (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope): 18 * workers/WorkerMessagingProxy.h: 19 * workers/WorkerObjectProxy.h: 20 * workers/service/context/ServiceWorkerThread.cpp: 21 1 22 2017-10-19 Daniel Bates <dabates@apple.com> 2 23 -
trunk/Source/WebCore/dom/MessagePortChannel.h
r212609 r223732 83 83 84 84 // Sends a message and optional cloned port to the remote port. 85 void postMessageToRemote(Ref<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray> );85 void postMessageToRemote(Ref<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>&&); 86 86 87 87 // Extracts a message from the message queue for this port. -
trunk/Source/WebCore/dom/default/PlatformMessagePortChannel.cpp
r223728 r223732 81 81 } 82 82 83 void MessagePortChannel::postMessageToRemote(Ref<SerializedScriptValue>&& message, std::unique_ptr<MessagePortChannelArray> channels)83 void MessagePortChannel::postMessageToRemote(Ref<SerializedScriptValue>&& message, std::unique_ptr<MessagePortChannelArray>&& channels) 84 84 { 85 85 LockHolder lock(m_channel->m_mutex); -
trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h
r223728 r223732 53 53 virtual void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, JSC::RuntimeFlags, PAL::SessionID) = 0; 54 54 virtual void terminateWorkerGlobalScope() = 0; 55 virtual void postMessageToWorkerGlobalScope(Ref Ptr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) = 0;55 virtual void postMessageToWorkerGlobalScope(Ref<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>&&) = 0; 56 56 virtual bool hasPendingActivity() const = 0; 57 57 virtual void workerObjectDestroyed() = 0; -
trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp
r220857 r223732 95 95 } 96 96 97 void WorkerMessagingProxy::postMessageToWorkerObject(Ref Ptr<SerializedScriptValue>&& message, std::unique_ptr<MessagePortChannelArray>channels)97 void WorkerMessagingProxy::postMessageToWorkerObject(Ref<SerializedScriptValue>&& message, std::unique_ptr<MessagePortChannelArray>&& channels) 98 98 { 99 99 m_scriptExecutionContext->postTask([this, channels = WTFMove(channels), message = WTFMove(message)] (ScriptExecutionContext& context) mutable { … … 107 107 } 108 108 109 void WorkerMessagingProxy::postMessageToWorkerGlobalScope(Ref Ptr<SerializedScriptValue>&& message, std::unique_ptr<MessagePortChannelArray>channels)109 void WorkerMessagingProxy::postMessageToWorkerGlobalScope(Ref<SerializedScriptValue>&& message, std::unique_ptr<MessagePortChannelArray>&& channels) 110 110 { 111 111 if (m_askedToTerminate) -
trunk/Source/WebCore/workers/WorkerMessagingProxy.h
r220857 r223732 48 48 void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, JSC::RuntimeFlags, PAL::SessionID) final; 49 49 void terminateWorkerGlobalScope() final; 50 void postMessageToWorkerGlobalScope(Ref Ptr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) final;50 void postMessageToWorkerGlobalScope(Ref<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>&&) final; 51 51 bool hasPendingActivity() const final; 52 52 void workerObjectDestroyed() final; … … 55 55 // Implementations of WorkerObjectProxy. 56 56 // (Only use these functions in the worker context thread.) 57 void postMessageToWorkerObject(Ref Ptr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) final;57 void postMessageToWorkerObject(Ref<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>&&) final; 58 58 void postExceptionToWorkerObject(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) final; 59 59 void postMessageToPageInspector(const String&) final; -
trunk/Source/WebCore/workers/WorkerObjectProxy.h
r207546 r223732 42 42 class WorkerObjectProxy : public WorkerReportingProxy { 43 43 public: 44 virtual void postMessageToWorkerObject(Ref Ptr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) = 0;44 virtual void postMessageToWorkerObject(Ref<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>&&) = 0; 45 45 46 46 virtual void confirmMessageFromWorkerObject(bool hasPendingActivity) = 0; -
trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
r223728 r223732 56 56 void postMessageToPageInspector(const String&) final { }; 57 57 void workerGlobalScopeDestroyed() final { }; 58 void postMessageToWorkerObject(Ref Ptr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) final { };58 void postMessageToWorkerObject(Ref<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>&&) final { }; 59 59 void confirmMessageFromWorkerObject(bool) final { }; 60 60 void reportPendingActivity(bool) final { };
Note: See TracChangeset
for help on using the changeset viewer.