Changeset 256303 in webkit
- Timestamp:
- Feb 11, 2020 6:08:30 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 17 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r256294 r256303 1 2020-02-11 Youenn Fablet <youenn@apple.com> 2 3 Use ObjectIdentifier for WebSocketStream/WebSocketChannel 4 https://bugs.webkit.org/show_bug.cgi?id=207507 5 6 Reviewed by Alex Christensen. 7 8 Replace uint64_t by ObjectIdentifier. 9 This adds type safety and ensures we get valid identifiers from IPC. 10 We still need to check for destinationID being not null in a few places. 11 No observable change of behavior. 12 13 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 14 (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): 15 (WebKit::NetworkConnectionToWebProcess::createSocketStream): 16 (WebKit::NetworkConnectionToWebProcess::createSocketChannel): 17 (WebKit::NetworkConnectionToWebProcess::removeSocketChannel): 18 * NetworkProcess/NetworkConnectionToWebProcess.h: 19 * NetworkProcess/NetworkConnectionToWebProcess.messages.in: 20 * NetworkProcess/NetworkSocketChannel.cpp: 21 (WebKit::NetworkSocketChannel::create): 22 (WebKit::NetworkSocketChannel::NetworkSocketChannel): 23 * NetworkProcess/NetworkSocketChannel.h: 24 * NetworkProcess/NetworkSocketStream.cpp: 25 (WebKit::NetworkSocketStream::create): 26 (WebKit::NetworkSocketStream::NetworkSocketStream): 27 (WebKit::NetworkSocketStream::messageSenderDestinationID const): 28 * NetworkProcess/NetworkSocketStream.h: 29 * Scripts/webkit/messages.py: 30 * WebKit.xcodeproj/project.pbxproj: 31 * WebProcess/Network/NetworkProcessConnection.cpp: 32 (WebKit::NetworkProcessConnection::didReceiveMessage): 33 * WebProcess/Network/WebSocketChannel.cpp: 34 (WebKit::WebSocketChannel::WebSocketChannel): 35 (WebKit::WebSocketChannel::messageSenderDestinationID const): 36 (WebKit::WebSocketChannel::connect): 37 * WebProcess/Network/WebSocketChannel.h: 38 (WebKit::WebSocketChannel::identifier const): 39 * WebProcess/Network/WebSocketChannelManager.cpp: 40 (WebKit::WebSocketChannelManager::didReceiveMessage): 41 * WebProcess/Network/WebSocketChannelManager.h: 42 * WebProcess/Network/WebSocketIdentifier.h: Added. 43 * WebProcess/Network/WebSocketStream.cpp: 44 (WebKit::WebSocketStream::streamWithIdentifier): 45 (WebKit::WebSocketStream::WebSocketStream): 46 (WebKit::WebSocketStream::~WebSocketStream): 47 (WebKit::WebSocketStream::messageSenderDestinationID const): 48 * WebProcess/Network/WebSocketStream.h: 49 1 50 2020-02-11 chris fleizach <cfleizach@apple.com> 2 51 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
r255681 r256303 62 62 #include "WebSWServerToContextConnection.h" 63 63 #include "WebSWServerToContextConnectionMessages.h" 64 #include "WebSocketIdentifier.h" 64 65 #include "WebsiteDataStoreParameters.h" 65 66 #include <WebCore/DocumentStorageAccess.h> … … 176 177 177 178 if (decoder.messageReceiverName() == Messages::NetworkSocketStream::messageReceiverName()) { 178 if (auto* socketStream = m_networkSocketStreams.get( decoder.destinationID())) {179 if (auto* socketStream = m_networkSocketStreams.get(makeObjectIdentifier<WebSocketIdentifierType>(decoder.destinationID()))) { 179 180 socketStream->didReceiveMessage(connection, decoder); 180 181 if (decoder.messageName() == Messages::NetworkSocketStream::Close::name()) 181 m_networkSocketStreams.remove( decoder.destinationID());182 m_networkSocketStreams.remove(makeObjectIdentifier<WebSocketIdentifierType>(decoder.destinationID())); 182 183 } 183 184 return; … … 185 186 186 187 if (decoder.messageReceiverName() == Messages::NetworkSocketChannel::messageReceiverName()) { 187 if (auto* channel = m_networkSocketChannels.get( decoder.destinationID()))188 if (auto* channel = m_networkSocketChannels.get(makeObjectIdentifier<WebSocketIdentifierType>(decoder.destinationID()))) 188 189 channel->didReceiveMessage(connection, decoder); 189 190 return; … … 336 337 } 337 338 338 void NetworkConnectionToWebProcess::createSocketStream(URL&& url, String cachePartition, uint64_tidentifier)339 void NetworkConnectionToWebProcess::createSocketStream(URL&& url, String cachePartition, WebSocketIdentifier identifier) 339 340 { 340 341 ASSERT(!m_networkSocketStreams.contains(identifier)); … … 343 344 token = { m_networkProcess->sourceApplicationAuditData() }; 344 345 #endif 345 m_networkSocketStreams. set(identifier, NetworkSocketStream::create(m_networkProcess.get(), WTFMove(url), m_sessionID, cachePartition, identifier, m_connection, WTFMove(token)));346 } 347 348 void NetworkConnectionToWebProcess::createSocketChannel(const ResourceRequest& request, const String& protocol, uint64_tidentifier)346 m_networkSocketStreams.add(identifier, NetworkSocketStream::create(m_networkProcess.get(), WTFMove(url), m_sessionID, cachePartition, identifier, m_connection, WTFMove(token))); 347 } 348 349 void NetworkConnectionToWebProcess::createSocketChannel(const ResourceRequest& request, const String& protocol, WebSocketIdentifier identifier) 349 350 { 350 351 ASSERT(!m_networkSocketChannels.contains(identifier)); … … 353 354 } 354 355 355 void NetworkConnectionToWebProcess::removeSocketChannel( uint64_tidentifier)356 void NetworkConnectionToWebProcess::removeSocketChannel(WebSocketIdentifier identifier) 356 357 { 357 358 ASSERT(m_networkSocketChannels.contains(identifier)); -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
r255681 r256303 38 38 #include "WebPaymentCoordinatorProxy.h" 39 39 #include "WebResourceLoadObserver.h" 40 #include "WebSocketIdentifier.h" 40 41 #include <WebCore/FrameIdentifier.h> 41 42 #include <WebCore/MessagePortChannelProvider.h> … … 156 157 Vector<RefPtr<WebCore::BlobDataFileReference>> resolveBlobReferences(const NetworkResourceLoadParameters&); 157 158 158 void removeSocketChannel( uint64_t identifier);159 void removeSocketChannel(WebSocketIdentifier); 159 160 160 161 WebCore::ProcessIdentifier webProcessIdentifier() const { return m_webProcessIdentifier; } … … 219 220 void setCaptureExtraNetworkLoadMetricsEnabled(bool); 220 221 221 void createSocketStream(URL&&, String cachePartition, uint64_t);222 223 void createSocketChannel(const WebCore::ResourceRequest&, const String& protocol, uint64_t identifier);222 void createSocketStream(URL&&, String cachePartition, WebSocketIdentifier); 223 224 void createSocketChannel(const WebCore::ResourceRequest&, const String& protocol, WebSocketIdentifier); 224 225 void updateQuotaBasedOnSpaceUsageForTesting(const WebCore::ClientOrigin&); 225 226 … … 314 315 PAL::SessionID m_sessionID; 315 316 316 HashMap< uint64_t, RefPtr<NetworkSocketStream>> m_networkSocketStreams;317 HashMap< uint64_t, std::unique_ptr<NetworkSocketChannel>> m_networkSocketChannels;317 HashMap<WebSocketIdentifier, RefPtr<NetworkSocketStream>> m_networkSocketStreams; 318 HashMap<WebSocketIdentifier, std::unique_ptr<NetworkSocketChannel>> m_networkSocketChannels; 318 319 NetworkResourceLoadMap m_networkResourceLoaders; 319 320 HashMap<String, RefPtr<WebCore::BlobDataFileReference>> m_blobDataFileReferences; -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
r255681 r256303 52 52 SetCaptureExtraNetworkLoadMetricsEnabled(bool enabled) 53 53 54 CreateSocketStream(URL url, String cachePartition, uint64_tidentifier)55 CreateSocketChannel(WebCore::ResourceRequest request, String protocol, uint64_tidentifier)54 CreateSocketStream(URL url, String cachePartition, WebKit::WebSocketIdentifier identifier) 55 CreateSocketChannel(WebCore::ResourceRequest request, String protocol, WebKit::WebSocketIdentifier identifier) 56 56 57 57 #if ENABLE(RESOURCE_LOAD_STATISTICS) -
trunk/Source/WebKit/NetworkProcess/NetworkSocketChannel.cpp
r248846 r256303 37 37 using namespace WebCore; 38 38 39 std::unique_ptr<NetworkSocketChannel> NetworkSocketChannel::create(NetworkConnectionToWebProcess& connection, PAL::SessionID sessionID, const ResourceRequest& request, const String& protocol, uint64_tidentifier)39 std::unique_ptr<NetworkSocketChannel> NetworkSocketChannel::create(NetworkConnectionToWebProcess& connection, PAL::SessionID sessionID, const ResourceRequest& request, const String& protocol, WebSocketIdentifier identifier) 40 40 { 41 41 auto result = makeUnique<NetworkSocketChannel>(connection, connection.networkProcess().networkSession(sessionID), request, protocol, identifier); … … 47 47 } 48 48 49 NetworkSocketChannel::NetworkSocketChannel(NetworkConnectionToWebProcess& connection, NetworkSession* session, const ResourceRequest& request, const String& protocol, uint64_tidentifier)49 NetworkSocketChannel::NetworkSocketChannel(NetworkConnectionToWebProcess& connection, NetworkSession* session, const ResourceRequest& request, const String& protocol, WebSocketIdentifier identifier) 50 50 : m_connectionToWebProcess(connection) 51 51 , m_identifier(identifier) -
trunk/Source/WebKit/NetworkProcess/NetworkSocketChannel.h
r251361 r256303 28 28 #include "MessageReceiver.h" 29 29 #include "MessageSender.h" 30 #include "WebSocketIdentifier.h" 30 31 #include <pal/SessionID.h> 31 32 #include <wtf/CompletionHandler.h> … … 52 53 WTF_MAKE_FAST_ALLOCATED; 53 54 public: 54 static std::unique_ptr<NetworkSocketChannel> create(NetworkConnectionToWebProcess&, PAL::SessionID, const WebCore::ResourceRequest&, const String& protocol, uint64_t identifier);55 static std::unique_ptr<NetworkSocketChannel> create(NetworkConnectionToWebProcess&, PAL::SessionID, const WebCore::ResourceRequest&, const String& protocol, WebSocketIdentifier); 55 56 56 NetworkSocketChannel(NetworkConnectionToWebProcess&, NetworkSession*, const WebCore::ResourceRequest&, const String& protocol, uint64_t identifier);57 NetworkSocketChannel(NetworkConnectionToWebProcess&, NetworkSession*, const WebCore::ResourceRequest&, const String& protocol, WebSocketIdentifier); 57 58 ~NetworkSocketChannel(); 58 59 … … 73 74 74 75 IPC::Connection* messageSenderConnection() const final; 75 uint64_t messageSenderDestinationID() const final { return m_identifier ; }76 uint64_t messageSenderDestinationID() const final { return m_identifier.toUInt64(); } 76 77 77 78 void finishClosingIfPossible(); 78 79 79 80 NetworkConnectionToWebProcess& m_connectionToWebProcess; 80 uint64_tm_identifier;81 WebSocketIdentifier m_identifier; 81 82 WeakPtr<NetworkSession> m_session; 82 83 std::unique_ptr<WebSocketTask> m_socket; -
trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp
r240955 r256303 36 36 using namespace WebCore; 37 37 38 Ref<NetworkSocketStream> NetworkSocketStream::create(NetworkProcess& networkProcess, URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_tidentifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData)38 Ref<NetworkSocketStream> NetworkSocketStream::create(NetworkProcess& networkProcess, URL&& url, PAL::SessionID sessionID, const String& credentialPartition, WebSocketIdentifier identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData) 39 39 { 40 40 return adoptRef(*new NetworkSocketStream(networkProcess, WTFMove(url), sessionID, credentialPartition, identifier, connection, WTFMove(auditData))); 41 41 } 42 42 43 NetworkSocketStream::NetworkSocketStream(NetworkProcess& networkProcess, URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_tidentifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData)43 NetworkSocketStream::NetworkSocketStream(NetworkProcess& networkProcess, URL&& url, PAL::SessionID sessionID, const String& credentialPartition, WebSocketIdentifier identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData) 44 44 : m_identifier(identifier) 45 45 , m_connection(connection) … … 115 115 uint64_t NetworkSocketStream::messageSenderDestinationID() const 116 116 { 117 return m_identifier ;117 return m_identifier.toUInt64(); 118 118 } 119 119 -
trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.h
r240955 r256303 28 28 #include "MessageReceiver.h" 29 29 #include "MessageSender.h" 30 #include "WebSocketIdentifier.h" 30 31 #include <WebCore/SocketStreamHandleClient.h> 31 32 #include <WebCore/SocketStreamHandleImpl.h> … … 44 45 class NetworkSocketStream : public RefCounted<NetworkSocketStream>, public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::SocketStreamHandleClient { 45 46 public: 46 static Ref<NetworkSocketStream> create(NetworkProcess&, URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&);47 static Ref<NetworkSocketStream> create(NetworkProcess&, URL&&, PAL::SessionID, const String& credentialPartition, WebSocketIdentifier, IPC::Connection&, WebCore::SourceApplicationAuditToken&&); 47 48 ~NetworkSocketStream(); 48 49 … … 65 66 uint64_t messageSenderDestinationID() const final; 66 67 67 NetworkSocketStream(NetworkProcess&, URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&);68 NetworkSocketStream(NetworkProcess&, URL&&, PAL::SessionID, const String& credentialPartition, WebSocketIdentifier, IPC::Connection&, WebCore::SourceApplicationAuditToken&&); 68 69 69 uint64_tm_identifier;70 WebSocketIdentifier m_identifier; 70 71 IPC::Connection& m_connection; 71 72 Ref<WebCore::SocketStreamHandleImpl> m_impl; -
trunk/Source/WebKit/Scripts/webkit/messages.py
r256185 r256303 237 237 'WebKit::UserContentControllerIdentifier', 238 238 'WebKit::WebPageProxyIdentifier', 239 'WebKit::WebSocketIdentifier', 239 240 ]) 240 241 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r256236 r256303 3383 3383 417915B72257046E00D6F97E /* NetworkSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkSocketChannel.cpp; sourceTree = "<group>"; }; 3384 3384 417915B82257046E00D6F97E /* NetworkSocketChannel.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NetworkSocketChannel.messages.in; sourceTree = "<group>"; }; 3385 41794D1C23EDD757008C453F /* WebSocketIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketIdentifier.h; path = Network/WebSocketIdentifier.h; sourceTree = "<group>"; }; 3385 3386 41897ECC1F415D5C0016FA42 /* WebCacheStorageProvider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebCacheStorageProvider.cpp; sourceTree = "<group>"; }; 3386 3387 41897ECD1F415D5C0016FA42 /* WebCacheStorageConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebCacheStorageConnection.h; sourceTree = "<group>"; }; … … 7349 7350 417915B22256C2E200D6F97E /* WebSocketChannelManager.cpp */, 7350 7351 417915B02256C0D600D6F97E /* WebSocketChannelManager.h */, 7352 41794D1C23EDD757008C453F /* WebSocketIdentifier.h */, 7351 7353 5C7706731D111D8B0012700F /* WebSocketProvider.cpp */, 7352 7354 5C7C88DC1D0F41A0009D2F6D /* WebSocketProvider.h */, -
trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp
r256185 r256303 90 90 } 91 91 if (decoder.messageReceiverName() == Messages::WebSocketStream::messageReceiverName()) { 92 if (auto* stream = WebSocketStream::streamWithIdentifier( decoder.destinationID()))92 if (auto* stream = WebSocketStream::streamWithIdentifier(makeObjectIdentifier<WebSocketIdentifierType>(decoder.destinationID()))) 93 93 stream->didReceiveMessage(connection, decoder); 94 94 return; -
trunk/Source/WebKit/WebProcess/Network/WebSocketChannel.cpp
r249891 r256303 63 63 WebSocketChannel::WebSocketChannel(Document& document, WebSocketChannelClient& client) 64 64 : m_document(makeWeakPtr(document)) 65 , m_identifier(WebSocketIdentifier::generate()) 65 66 , m_client(makeWeakPtr(client)) 66 67 , m_messageQueue(createMessageQueue(document, *this)) … … 79 80 uint64_t WebSocketChannel::messageSenderDestinationID() const 80 81 { 81 return identifier();82 return m_identifier.toUInt64(); 82 83 } 83 84 … … 104 105 m_client->didUpgradeURL(); 105 106 106 MessageSender::send(Messages::NetworkConnectionToWebProcess::CreateSocketChannel { *request, protocol, identifier()});107 MessageSender::send(Messages::NetworkConnectionToWebProcess::CreateSocketChannel { *request, protocol, m_identifier }); 107 108 return ConnectStatus::OK; 108 109 } -
trunk/Source/WebKit/WebProcess/Network/WebSocketChannel.h
r250287 r256303 28 28 #include "MessageReceiver.h" 29 29 #include "MessageSender.h" 30 #include "WebSocketIdentifier.h" 30 31 #include <WebCore/NetworkSendQueue.h> 31 32 #include <WebCore/ThreadableWebSocketChannel.h> 32 #include <wtf/Identified.h>33 33 #include <wtf/WeakPtr.h> 34 34 … … 41 41 namespace WebKit { 42 42 43 class WebSocketChannel : public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::ThreadableWebSocketChannel, public RefCounted<WebSocketChannel> , public Identified<WebSocketChannel>{43 class WebSocketChannel : public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::ThreadableWebSocketChannel, public RefCounted<WebSocketChannel> { 44 44 public: 45 45 static Ref<WebSocketChannel> create(WebCore::Document&, WebCore::WebSocketChannelClient&); 46 46 ~WebSocketChannel(); 47 48 WebSocketIdentifier identifier() const { return m_identifier; } 47 49 48 50 void didReceiveMessage(IPC::Connection&, IPC::Decoder&); … … 91 93 92 94 WeakPtr<WebCore::Document> m_document; 95 WebSocketIdentifier m_identifier; 93 96 WeakPtr<WebCore::WebSocketChannelClient> m_client; 94 97 String m_subprotocol; -
trunk/Source/WebKit/WebProcess/Network/WebSocketChannelManager.cpp
r246388 r256303 45 45 void WebSocketChannelManager::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder) 46 46 { 47 auto iterator = m_channels.find( decoder.destinationID());47 auto iterator = m_channels.find(makeObjectIdentifier<WebSocketIdentifierType>(decoder.destinationID())); 48 48 if (iterator != m_channels.end()) 49 49 iterator->value->didReceiveMessage(connection, decoder); -
trunk/Source/WebKit/WebProcess/Network/WebSocketChannelManager.h
r246388 r256303 49 49 50 50 private: 51 HashMap< uint64_t, Ref<WebSocketChannel>> m_channels;51 HashMap<WebSocketIdentifier, Ref<WebSocketChannel>> m_channels; 52 52 }; 53 53 -
trunk/Source/WebKit/WebProcess/Network/WebSocketIdentifier.h
r256302 r256303 1 1 /* 2 * Copyright (C) 20 19Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 6 6 * are met: 7 7 * 1. Redistributions of source code must retain the above copyright 8 * notice , this list of conditions and the following disclaimer.8 * notice , this list of conditions and the following disclaimer. 9 9 * 2. Redistributions in binary form must reproduce the above copyright 10 10 * notice, this list of conditions and the following disclaimer in the … … 26 26 #pragma once 27 27 28 #include "WebSocketChannel.h" 29 30 namespace IPC { 31 class Connection; 32 class Decoder; 33 } 34 35 namespace WebCore { 36 class Document; 37 class ThreadableWebSocketChannel; 38 } 28 #include <wtf/ObjectIdentifier.h> 39 29 40 30 namespace WebKit { 41 31 42 class WebSocketChannelManager { 43 public: 44 WebSocketChannelManager() = default; 45 RefPtr<WebCore::ThreadableWebSocketChannel> createWebSocketChannel(WebCore::Document&, WebCore::WebSocketChannelClient&); 46 47 void networkProcessCrashed(); 48 void didReceiveMessage(IPC::Connection&, IPC::Decoder&); 49 50 private: 51 HashMap<uint64_t, Ref<WebSocketChannel>> m_channels; 52 }; 32 enum WebSocketIdentifierType { }; 33 using WebSocketIdentifier = ObjectIdentifier<WebSocketIdentifierType>; 53 34 54 35 } // namespace WebKit -
trunk/Source/WebKit/WebProcess/Network/WebSocketStream.cpp
r250079 r256303 33 33 #include "WebCoreArgumentCoders.h" 34 34 #include "WebProcess.h" 35 #include "WebSocketIdentifier.h" 35 36 #include <WebCore/CookieRequestHeaderFieldProxy.h> 36 37 #include <WebCore/SocketStreamError.h> … … 42 43 43 44 static Lock globalWebSocketStreamMapLock; 44 static HashMap< uint64_t, WebSocketStream*>& globalWebSocketStreamMap()45 static HashMap<WebSocketIdentifier, WebSocketStream*>& globalWebSocketStreamMap() 45 46 { 46 static NeverDestroyed<HashMap< uint64_t, WebSocketStream*>> globalMap;47 static NeverDestroyed<HashMap<WebSocketIdentifier, WebSocketStream*>> globalMap; 47 48 return globalMap; 48 49 } 49 50 50 WebSocketStream* WebSocketStream::streamWithIdentifier( uint64_tidentifier)51 WebSocketStream* WebSocketStream::streamWithIdentifier(WebSocketIdentifier identifier) 51 52 { 52 53 LockHolder locker(globalWebSocketStreamMapLock); … … 84 85 WebSocketStream::WebSocketStream(const URL& url, WebCore::SocketStreamHandleClient& client, const String& cachePartition) 85 86 : SocketStreamHandle(url, client) 87 , m_identifier(WebSocketIdentifier::generate()) 86 88 , m_client(client) 87 89 { 88 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::CreateSocketStream(url, cachePartition, identifier()), 0);90 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::CreateSocketStream(url, cachePartition, m_identifier), 0); 89 91 90 92 LockHolder locker(globalWebSocketStreamMapLock); 91 ASSERT(!globalWebSocketStreamMap().contains( identifier()));92 globalWebSocketStreamMap().set( identifier(), this);93 ASSERT(!globalWebSocketStreamMap().contains(m_identifier)); 94 globalWebSocketStreamMap().set(m_identifier, this); 93 95 } 94 96 … … 96 98 { 97 99 LockHolder locker(globalWebSocketStreamMapLock); 98 ASSERT(globalWebSocketStreamMap().contains( identifier()));99 globalWebSocketStreamMap().remove( identifier());100 ASSERT(globalWebSocketStreamMap().contains(m_identifier)); 101 globalWebSocketStreamMap().remove(m_identifier); 100 102 } 101 103 … … 107 109 uint64_t WebSocketStream::messageSenderDestinationID() const 108 110 { 109 return identifier();111 return m_identifier.toUInt64(); 110 112 } 111 113 -
trunk/Source/WebKit/WebProcess/Network/WebSocketStream.h
r250079 r256303 28 28 #include "MessageReceiver.h" 29 29 #include "MessageSender.h" 30 #include "WebSocketIdentifier.h" 30 31 #include <WebCore/SocketStreamHandle.h> 31 #include <wtf/Identified.h>32 32 33 33 namespace IPC { … … 43 43 namespace WebKit { 44 44 45 class WebSocketStream : public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::SocketStreamHandle , public Identified<WebSocketStream>{45 class WebSocketStream : public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::SocketStreamHandle { 46 46 public: 47 47 static Ref<WebSocketStream> create(const URL&, WebCore::SocketStreamHandleClient&, const String& credentialPartition); 48 48 static void networkProcessCrashed(); 49 static WebSocketStream* streamWithIdentifier( uint64_t);49 static WebSocketStream* streamWithIdentifier(WebSocketIdentifier); 50 50 51 51 void didReceiveMessage(IPC::Connection&, IPC::Decoder&); … … 76 76 ~WebSocketStream(); 77 77 78 WebSocketIdentifier m_identifier; 78 79 size_t m_bufferedAmount { 0 }; 79 80 WebCore::SocketStreamHandleClient& m_client;
Note: See TracChangeset
for help on using the changeset viewer.