WebKit Bugzilla
Attachment 368249 Details for
Bug 197243
: [RemoteInspector] Fix connection and target identifier types.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
197243.diff (text/plain), 44.21 KB, created by
Basuke Suzuki
on 2019-04-25 11:03:56 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Basuke Suzuki
Created:
2019-04-25 11:03:56 PDT
Size:
44.21 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index f1ae22bdaaf..fa962cceeff 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,86 @@ >+2019-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com> >+ >+ [RemoteInspector] Fix connection and target identifier types. >+ https://bugs.webkit.org/show_bug.cgi?id=197243 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Give dedicated type for RemoteControllableTarget's identifier as Inspector::TargetID. >+ >+ Also rename ClientID type used in Socket backend to ConnectionID because this is the identifier >+ socket endpoint assign to the newly created connection. The size was changed to uint32_t. >+ Enough size for managing connections. >+ >+ * inspector/remote/RemoteConnectionToTarget.cpp: >+ (Inspector::RemoteConnectionToTarget::setup): >+ (Inspector::RemoteConnectionToTarget::close): >+ (Inspector::RemoteConnectionToTarget::targetIdentifier const): >+ * inspector/remote/RemoteConnectionToTarget.h: >+ * inspector/remote/RemoteControllableTarget.h: >+ * inspector/remote/RemoteInspector.cpp: >+ (Inspector::RemoteInspector::nextAvailableTargetIdentifier): >+ (Inspector::RemoteInspector::registerTarget): >+ (Inspector::RemoteInspector::unregisterTarget): >+ (Inspector::RemoteInspector::updateTarget): >+ (Inspector::RemoteInspector::setupFailed): >+ (Inspector::RemoteInspector::setupCompleted): >+ (Inspector::RemoteInspector::waitingForAutomaticInspection): >+ (Inspector::RemoteInspector::updateTargetListing): >+ * inspector/remote/RemoteInspector.h: >+ * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: >+ (Inspector::RemoteConnectionToTarget::targetIdentifier const): >+ (Inspector::RemoteConnectionToTarget::setup): >+ (Inspector::RemoteConnectionToTarget::close): >+ * inspector/remote/cocoa/RemoteInspectorCocoa.mm: >+ (Inspector::RemoteInspector::updateAutomaticInspectionCandidate): >+ (Inspector::RemoteInspector::sendMessageToRemote): >+ (Inspector::RemoteInspector::receivedSetupMessage): >+ (Inspector::RemoteInspector::receivedDataMessage): >+ (Inspector::RemoteInspector::receivedDidCloseMessage): >+ (Inspector::RemoteInspector::receivedIndicateMessage): >+ (Inspector::RemoteInspector::receivedAutomaticInspectionRejectMessage): >+ * inspector/remote/glib/RemoteInspectorGlib.cpp: >+ (Inspector::RemoteInspector::updateAutomaticInspectionCandidate): >+ (Inspector::RemoteInspector::sendMessageToRemote): >+ (Inspector::RemoteInspector::receivedSetupMessage): >+ (Inspector::RemoteInspector::receivedDataMessage): >+ (Inspector::RemoteInspector::receivedCloseMessage): >+ (Inspector::RemoteInspector::setup): >+ (Inspector::RemoteInspector::sendMessageToTarget): >+ * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: >+ (Inspector::RemoteInspectorConnectionClient::didReceiveWebInspectorEvent): >+ * inspector/remote/socket/RemoteInspectorConnectionClient.h: >+ (Inspector::RemoteInspectorConnectionClient::didAccept): >+ * inspector/remote/socket/RemoteInspectorMessageParser.cpp: >+ (Inspector::MessageParser::MessageParser): >+ (Inspector::MessageParser::parse): >+ * inspector/remote/socket/RemoteInspectorMessageParser.h: >+ (Inspector::MessageParser::setDidParseMessageListener): >+ * inspector/remote/socket/RemoteInspectorServer.cpp: >+ (Inspector::RemoteInspectorServer::didAccept): >+ (Inspector::RemoteInspectorServer::didClose): >+ (Inspector::RemoteInspectorServer::dispatchMap): >+ (Inspector::RemoteInspectorServer::sendWebInspectorEvent): >+ (Inspector::RemoteInspectorServer::sendCloseEvent): >+ (Inspector::RemoteInspectorServer::connectionClosed): >+ * inspector/remote/socket/RemoteInspectorServer.h: >+ * inspector/remote/socket/RemoteInspectorSocket.cpp: >+ (Inspector::RemoteInspector::didClose): >+ (Inspector::RemoteInspector::sendMessageToRemote): >+ (Inspector::RemoteInspector::setup): >+ (Inspector::RemoteInspector::sendMessageToTarget): >+ * inspector/remote/socket/RemoteInspectorSocket.h: >+ * inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp: >+ (Inspector::RemoteInspectorSocketEndpoint::connectInet): >+ (Inspector::RemoteInspectorSocketEndpoint::isListening): >+ (Inspector::RemoteInspectorSocketEndpoint::workerThread): >+ (Inspector::RemoteInspectorSocketEndpoint::createClient): >+ (Inspector::RemoteInspectorSocketEndpoint::recvIfEnabled): >+ (Inspector::RemoteInspectorSocketEndpoint::sendIfEnabled): >+ (Inspector::RemoteInspectorSocketEndpoint::send): >+ (Inspector::RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled): >+ * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: >+ > 2019-04-22 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] Use volatile load to populate backing page in MarkedBlock::Footer instead of using holdLock >diff --git a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.cpp b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.cpp >index dd1e703503b..2335b29ecea 100644 >--- a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.cpp >+++ b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.cpp >@@ -49,7 +49,7 @@ bool RemoteConnectionToTarget::setup(bool isAutomaticInspection, bool automatica > if (!m_target) > return false; > >- unsigned targetIdentifier = this->targetIdentifier().valueOr(0); >+ auto targetIdentifier = this->targetIdentifier().valueOr(0); > > if (!m_target || !m_target->remoteControlAllowed()) { > RemoteInspector::singleton().setupFailed(targetIdentifier); >@@ -90,7 +90,7 @@ void RemoteConnectionToTarget::close() > if (!m_target) > return; > >- unsigned targetIdentifier = m_target->targetIdentifier(); >+ auto targetIdentifier = m_target->targetIdentifier(); > > if (m_connected) > m_target->disconnect(*this); >@@ -106,9 +106,9 @@ void RemoteConnectionToTarget::targetClosed() > m_target = nullptr; > } > >-Optional<unsigned> RemoteConnectionToTarget::targetIdentifier() const >+Optional<TargetID> RemoteConnectionToTarget::targetIdentifier() const > { >- return m_target ? Optional<unsigned>(m_target->targetIdentifier()) : WTF::nullopt; >+ return m_target ? Optional<TargetID>(m_target->targetIdentifier()) : WTF::nullopt; > } > > void RemoteConnectionToTarget::sendMessageToFrontend(const String& message) >diff --git a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h >index 8b0e14babb5..eecea0d3ca2 100644 >--- a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h >+++ b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h >@@ -28,6 +28,7 @@ > #if ENABLE(REMOTE_INSPECTOR) > > #include "InspectorFrontendChannel.h" >+#include "RemoteControllableTarget.h" > #include <wtf/Lock.h> > #include <wtf/ThreadSafeRefCounted.h> > >@@ -65,7 +66,7 @@ public: > void close(); > void targetClosed(); > >- Optional<unsigned> targetIdentifier() const; >+ Optional<TargetID> targetIdentifier() const; > #if PLATFORM(COCOA) > NSString *connectionIdentifier() const; > NSString *destination() const; >diff --git a/Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h b/Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h >index 4bbb6a44867..54f23a558ea 100644 >--- a/Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h >+++ b/Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h >@@ -38,6 +38,8 @@ namespace Inspector { > > class FrontendChannel; > >+using TargetID = unsigned; >+ > class JS_EXPORT_PRIVATE RemoteControllableTarget { > public: > virtual ~RemoteControllableTarget(); >@@ -48,8 +50,8 @@ public: > virtual void connect(FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) = 0; > virtual void disconnect(FrontendChannel&) = 0; > >- unsigned targetIdentifier() const { return m_identifier; } >- void setTargetIdentifier(unsigned identifier) { m_identifier = identifier; } >+ TargetID targetIdentifier() const { return m_identifier; } >+ void setTargetIdentifier(TargetID identifier) { m_identifier = identifier; } > > enum class Type { JavaScript, ServiceWorker, Web, Automation }; > virtual Type type() const = 0; >@@ -62,7 +64,7 @@ public: > #endif > > private: >- unsigned m_identifier { 0 }; >+ TargetID m_identifier { 0 }; > }; > > } // namespace Inspector >diff --git a/Source/JavaScriptCore/inspector/remote/RemoteInspector.cpp b/Source/JavaScriptCore/inspector/remote/RemoteInspector.cpp >index c7dabf60748..9a6a96f2906 100644 >--- a/Source/JavaScriptCore/inspector/remote/RemoteInspector.cpp >+++ b/Source/JavaScriptCore/inspector/remote/RemoteInspector.cpp >@@ -44,12 +44,12 @@ void RemoteInspector::startDisabled() > RemoteInspector::startEnabled = false; > } > >-unsigned RemoteInspector::nextAvailableTargetIdentifier() >+TargetID RemoteInspector::nextAvailableTargetIdentifier() > { >- unsigned nextValidTargetIdentifier; >+ TargetID nextValidTargetIdentifier; > do { > nextValidTargetIdentifier = m_nextAvailableTargetIdentifier++; >- } while (!nextValidTargetIdentifier || nextValidTargetIdentifier == std::numeric_limits<unsigned>::max() || m_targetMap.contains(nextValidTargetIdentifier)); >+ } while (!nextValidTargetIdentifier || nextValidTargetIdentifier == std::numeric_limits<TargetID>::max() || m_targetMap.contains(nextValidTargetIdentifier)); > return nextValidTargetIdentifier; > } > >@@ -59,7 +59,7 @@ void RemoteInspector::registerTarget(RemoteControllableTarget* target) > > LockHolder lock(m_mutex); > >- unsigned targetIdentifier = nextAvailableTargetIdentifier(); >+ auto targetIdentifier = nextAvailableTargetIdentifier(); > target->setTargetIdentifier(targetIdentifier); > > { >@@ -82,7 +82,7 @@ void RemoteInspector::unregisterTarget(RemoteControllableTarget* target) > > LockHolder lock(m_mutex); > >- unsigned targetIdentifier = target->targetIdentifier(); >+ auto targetIdentifier = target->targetIdentifier(); > if (!targetIdentifier) > return; > >@@ -104,7 +104,7 @@ void RemoteInspector::updateTarget(RemoteControllableTarget* target) > > LockHolder lock(m_mutex); > >- unsigned targetIdentifier = target->targetIdentifier(); >+ auto targetIdentifier = target->targetIdentifier(); > if (!targetIdentifier) > return; > >@@ -156,7 +156,7 @@ void RemoteInspector::setClient(RemoteInspector::Client* client) > pushListingsSoon(); > } > >-void RemoteInspector::setupFailed(unsigned targetIdentifier) >+void RemoteInspector::setupFailed(TargetID targetIdentifier) > { > LockHolder lock(m_mutex); > >@@ -170,7 +170,7 @@ void RemoteInspector::setupFailed(unsigned targetIdentifier) > pushListingsSoon(); > } > >-void RemoteInspector::setupCompleted(unsigned targetIdentifier) >+void RemoteInspector::setupCompleted(TargetID targetIdentifier) > { > LockHolder lock(m_mutex); > >@@ -178,7 +178,7 @@ void RemoteInspector::setupCompleted(unsigned targetIdentifier) > m_automaticInspectionPaused = false; > } > >-bool RemoteInspector::waitingForAutomaticInspection(unsigned) >+bool RemoteInspector::waitingForAutomaticInspection(TargetID) > { > // We don't take the lock to check this because we assume it will be checked repeatedly. > return m_automaticInspectionPaused; >@@ -208,7 +208,7 @@ TargetListing RemoteInspector::listingForTarget(const RemoteControllableTarget& > return nullptr; > } > >-void RemoteInspector::updateTargetListing(unsigned targetIdentifier) >+void RemoteInspector::updateTargetListing(TargetID targetIdentifier) > { > auto target = m_targetMap.get(targetIdentifier); > if (!target) >diff --git a/Source/JavaScriptCore/inspector/remote/RemoteInspector.h b/Source/JavaScriptCore/inspector/remote/RemoteInspector.h >index 5e5b862e693..71b7cf4ee57 100644 >--- a/Source/JavaScriptCore/inspector/remote/RemoteInspector.h >+++ b/Source/JavaScriptCore/inspector/remote/RemoteInspector.h >@@ -27,6 +27,8 @@ > > #if ENABLE(REMOTE_INSPECTOR) > >+#include "RemoteControllableTarget.h" >+ > #include <utility> > #include <wtf/Forward.h> > #include <wtf/HashMap.h> >@@ -113,16 +115,16 @@ public: > void registerTarget(RemoteControllableTarget*); > void unregisterTarget(RemoteControllableTarget*); > void updateTarget(RemoteControllableTarget*); >- void sendMessageToRemote(unsigned targetIdentifier, const String& message); >+ void sendMessageToRemote(TargetID, const String& message); > > RemoteInspector::Client* client() const { return m_client; } > void setClient(RemoteInspector::Client*); > void clientCapabilitiesDidChange(); > Optional<RemoteInspector::Client::Capabilities> clientCapabilities() const { return m_clientCapabilities; } > >- void setupFailed(unsigned targetIdentifier); >- void setupCompleted(unsigned targetIdentifier); >- bool waitingForAutomaticInspection(unsigned targetIdentifier); >+ void setupFailed(TargetID); >+ void setupCompleted(TargetID); >+ bool waitingForAutomaticInspection(TargetID); > void updateAutomaticInspectionCandidate(RemoteInspectionTarget*); > > bool enabled() const { return m_enabled; } >@@ -139,14 +141,14 @@ public: > void setParentProcessInfomationIsDelayed(); > #endif > >- void updateTargetListing(unsigned targetIdentifier); >+ void updateTargetListing(TargetID); > > #if USE(GLIB) > void requestAutomationSession(const char* sessionID, const Client::SessionCapabilities&); > #endif > #if USE(GLIB) || PLATFORM(PLAYSTATION) >- void setup(unsigned targetIdentifier); >- void sendMessageToTarget(unsigned targetIdentifier, const char* message); >+ void setup(TargetID); >+ void sendMessageToTarget(TargetID, const char* message); > #endif > #if PLATFORM(PLAYSTATION) > static void setConnectionIdentifier(PlatformSocketType); >@@ -155,7 +157,7 @@ public: > private: > RemoteInspector(); > >- unsigned nextAvailableTargetIdentifier(); >+ TargetID nextAvailableTargetIdentifier(); > > enum class StopSource { API, XPCMessage }; > void stopInternal(StopSource); >@@ -168,9 +170,9 @@ private: > static const GDBusInterfaceVTable s_interfaceVTable; > > void receivedGetTargetListMessage(); >- void receivedSetupMessage(unsigned targetIdentifier); >- void receivedDataMessage(unsigned targetIdentifier, const char* message); >- void receivedCloseMessage(unsigned targetIdentifier); >+ void receivedSetupMessage(TargetID); >+ void receivedDataMessage(TargetID, const char* message); >+ void receivedCloseMessage(TargetID); > void receivedAutomationSessionRequestMessage(const char* sessionID); > #endif > >@@ -206,14 +208,14 @@ private: > #endif > #if PLATFORM(PLAYSTATION) > HashMap<String, CallHandler>& dispatchMap() override; >- void didClose(ClientID) override; >+ void didClose(ConnectionID) override; > > void sendWebInspectorEvent(const String&); > >- void receivedGetTargetListMessage(const struct Event&); >- void receivedSetupMessage(const struct Event&); >- void receivedDataMessage(const struct Event&); >- void receivedCloseMessage(const struct Event&); >+ void receivedGetTargetListMessage(const Event&); >+ void receivedSetupMessage(const Event&); >+ void receivedDataMessage(const Event&); >+ void receivedCloseMessage(const Event&); > #endif > static bool startEnabled; > >@@ -223,9 +225,9 @@ private: > // from any thread. > Lock m_mutex; > >- HashMap<unsigned, RemoteControllableTarget*> m_targetMap; >- HashMap<unsigned, RefPtr<RemoteConnectionToTarget>> m_targetConnectionMap; >- HashMap<unsigned, TargetListing> m_targetListingMap; >+ HashMap<TargetID, RemoteControllableTarget*> m_targetMap; >+ HashMap<TargetID, RefPtr<RemoteConnectionToTarget>> m_targetConnectionMap; >+ HashMap<TargetID, TargetListing> m_targetListingMap; > > #if PLATFORM(COCOA) > RefPtr<RemoteInspectorXPCConnection> m_relayConnection; >@@ -238,7 +240,7 @@ private: > #if PLATFORM(PLAYSTATION) > std::unique_ptr<RemoteInspectorSocketEndpoint> m_socketConnection; > static PlatformSocketType s_connectionIdentifier; >- Optional<ClientID> m_clientID; >+ Optional<ConnectionID> m_clientID; > #endif > > RemoteInspector::Client* m_client { nullptr }; >@@ -247,7 +249,7 @@ private: > #if PLATFORM(COCOA) > dispatch_queue_t m_xpcQueue; > #endif >- unsigned m_nextAvailableTargetIdentifier { 1 }; >+ TargetID m_nextAvailableTargetIdentifier { 1 }; > int m_notifyToken { 0 }; > bool m_enabled { false }; > bool m_hasActiveDebugSession { false }; >@@ -260,7 +262,7 @@ private: > bool m_shouldSendParentProcessInformation { false }; > bool m_automaticInspectionEnabled { false }; > bool m_automaticInspectionPaused { false }; >- unsigned m_automaticInspectionCandidateTargetIdentifier { 0 }; >+ TargetID m_automaticInspectionCandidateTargetIdentifier { 0 }; > }; > > } // namespace Inspector >diff --git a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm >index b4740c6f309..9730db82885 100644 >--- a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm >+++ b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm >@@ -120,9 +120,9 @@ RemoteConnectionToTarget::~RemoteConnectionToTarget() > teardownRunLoop(); > } > >-Optional<unsigned> RemoteConnectionToTarget::targetIdentifier() const >+Optional<TargetID> RemoteConnectionToTarget::targetIdentifier() const > { >- return m_target ? Optional<unsigned>(m_target->targetIdentifier()) : WTF::nullopt; >+ return m_target ? Optional<TargetID>(m_target->targetIdentifier()) : WTF::nullopt; > } > > NSString *RemoteConnectionToTarget::connectionIdentifier() const >@@ -159,7 +159,7 @@ bool RemoteConnectionToTarget::setup(bool isAutomaticInspection, bool automatica > if (!m_target) > return false; > >- unsigned targetIdentifier = this->targetIdentifier().valueOr(0); >+ auto targetIdentifier = this->targetIdentifier().valueOr(0); > > ref(); > dispatchAsyncOnTarget(^{ >@@ -198,7 +198,7 @@ void RemoteConnectionToTarget::targetClosed() > > void RemoteConnectionToTarget::close() > { >- unsigned targetIdentifier = m_target ? m_target->targetIdentifier() : 0; >+ auto targetIdentifier = m_target ? m_target->targetIdentifier() : 0; > > ref(); > dispatchAsyncOnTarget(^{ >diff --git a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm >index 6466aaa8b41..5bef21cbb39 100644 >--- a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm >+++ b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm >@@ -122,7 +122,7 @@ void RemoteInspector::updateAutomaticInspectionCandidate(RemoteInspectionTarget* > { > LockHolder lock(m_mutex); > >- unsigned targetIdentifier = target->targetIdentifier(); >+ auto targetIdentifier = target->targetIdentifier(); > if (!targetIdentifier) > return; > >@@ -197,7 +197,7 @@ void RemoteInspector::sendAutomaticInspectionCandidateMessage() > m_relayConnection->sendMessage(WIRAutomaticInspectionCandidateMessage, details); > } > >-void RemoteInspector::sendMessageToRemote(unsigned targetIdentifier, const String& message) >+void RemoteInspector::sendMessageToRemote(TargetID targetIdentifier, const String& message) > { > LockHolder lock(m_mutex); > >@@ -494,7 +494,7 @@ void RemoteInspector::receivedSetupMessage(NSDictionary *userInfo) > BAIL_IF_UNEXPECTED_TYPE_ALLOWING_NIL(automaticallyPauseNumber, [NSNumber class]); > BOOL automaticallyPause = automaticallyPauseNumber.boolValue; > >- unsigned targetIdentifier = targetIdentifierNumber.unsignedIntValue; >+ TargetID targetIdentifier = targetIdentifierNumber.unsignedIntValue; > if (!targetIdentifier) > return; > >@@ -537,7 +537,7 @@ void RemoteInspector::receivedDataMessage(NSDictionary *userInfo) > NSData *data = userInfo[WIRSocketDataKey]; > BAIL_IF_UNEXPECTED_TYPE(data, [NSData class]); > >- unsigned targetIdentifier = targetIdentifierNumber.unsignedIntValue; >+ TargetID targetIdentifier = targetIdentifierNumber.unsignedIntValue; > if (!targetIdentifier) > return; > >@@ -557,7 +557,7 @@ void RemoteInspector::receivedDidCloseMessage(NSDictionary *userInfo) > NSString *connectionIdentifier = userInfo[WIRConnectionIdentifierKey]; > BAIL_IF_UNEXPECTED_TYPE(connectionIdentifier, [NSString class]); > >- unsigned targetIdentifier = targetIdentifierNumber.unsignedIntValue; >+ TargetID targetIdentifier = targetIdentifierNumber.unsignedIntValue; > if (!targetIdentifier) > return; > >@@ -588,7 +588,7 @@ void RemoteInspector::receivedIndicateMessage(NSDictionary *userInfo) > BAIL_IF_UNEXPECTED_TYPE(indicateEnabledNumber, [NSNumber class]); > BOOL indicateEnabled = indicateEnabledNumber.boolValue; > >- unsigned targetIdentifier = targetIdentifierNumber.unsignedIntValue; >+ TargetID targetIdentifier = targetIdentifierNumber.unsignedIntValue; > if (!targetIdentifier) > return; > >@@ -672,7 +672,7 @@ void RemoteInspector::receivedAutomaticInspectionRejectMessage(NSDictionary *use > NSNumber *targetIdentifierNumber = userInfo[WIRTargetIdentifierKey]; > BAIL_IF_UNEXPECTED_TYPE(targetIdentifierNumber, [NSNumber class]); > >- unsigned targetIdentifier = targetIdentifierNumber.unsignedIntValue; >+ TargetID targetIdentifier = targetIdentifierNumber.unsignedIntValue; > if (!targetIdentifier) > return; > >diff --git a/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp b/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp >index 9924a7a39bd..5aff8b3e3fd 100644 >--- a/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp >+++ b/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp >@@ -245,7 +245,7 @@ void RemoteInspector::updateAutomaticInspectionCandidate(RemoteInspectionTarget* > LockHolder lock(m_mutex); > > ASSERT(target); >- unsigned targetIdentifier = target->targetIdentifier(); >+ auto targetIdentifier = target->targetIdentifier(); > if (!targetIdentifier) > return; > >@@ -272,7 +272,7 @@ void RemoteInspector::sendAutomaticInspectionCandidateMessage() > // FIXME: Implement automatic inspection. > } > >-void RemoteInspector::sendMessageToRemote(unsigned targetIdentifier, const String& message) >+void RemoteInspector::sendMessageToRemote(TargetID targetIdentifier, const String& message) > { > LockHolder lock(m_mutex); > if (!m_dbusConnection) >@@ -291,12 +291,12 @@ void RemoteInspector::receivedGetTargetListMessage() > pushListingsNow(); > } > >-void RemoteInspector::receivedSetupMessage(unsigned targetIdentifier) >+void RemoteInspector::receivedSetupMessage(TargetID targetIdentifier) > { > setup(targetIdentifier); > } > >-void RemoteInspector::receivedDataMessage(unsigned targetIdentifier, const char* message) >+void RemoteInspector::receivedDataMessage(TargetID targetIdentifier, const char* message) > { > RefPtr<RemoteConnectionToTarget> connectionToTarget; > { >@@ -308,7 +308,7 @@ void RemoteInspector::receivedDataMessage(unsigned targetIdentifier, const char* > connectionToTarget->sendMessageToTarget(String::fromUTF8(message)); > } > >-void RemoteInspector::receivedCloseMessage(unsigned targetIdentifier) >+void RemoteInspector::receivedCloseMessage(TargetID targetIdentifier) > { > RefPtr<RemoteConnectionToTarget> connectionToTarget; > { >@@ -325,7 +325,7 @@ void RemoteInspector::receivedCloseMessage(unsigned targetIdentifier) > connectionToTarget->close(); > } > >-void RemoteInspector::setup(unsigned targetIdentifier) >+void RemoteInspector::setup(TargetID targetIdentifier) > { > RemoteControllableTarget* target; > { >@@ -348,7 +348,7 @@ void RemoteInspector::setup(unsigned targetIdentifier) > updateHasActiveDebugSession(); > } > >-void RemoteInspector::sendMessageToTarget(unsigned targetIdentifier, const char* message) >+void RemoteInspector::sendMessageToTarget(TargetID targetIdentifier, const char* message) > { > if (auto connectionToTarget = m_targetConnectionMap.get(targetIdentifier)) > connectionToTarget->sendMessageToTarget(String::fromUTF8(message)); >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorConnectionClient.cpp b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorConnectionClient.cpp >index 765c7b40a23..0e90f18e72f 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorConnectionClient.cpp >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorConnectionClient.cpp >@@ -34,7 +34,7 @@ > > namespace Inspector { > >-void RemoteInspectorConnectionClient::didReceiveWebInspectorEvent(ClientID clientID, Vector<uint8_t>&& data) >+void RemoteInspectorConnectionClient::didReceiveWebInspectorEvent(ConnectionID clientID, Vector<uint8_t>&& data) > { > ASSERT(!isMainThread()); > >@@ -55,14 +55,14 @@ void RemoteInspectorConnectionClient::didReceiveWebInspectorEvent(ClientID clien > if (!messageObject->getString("event"_s, methodName)) > return; > >- struct Event event; >+ Event event; > event.clientID = clientID; > >- uint64_t connectionID; >+ ConnectionID connectionID; > if (messageObject->getInteger("connectionID"_s, connectionID)) > event.connectionID = connectionID; > >- uint64_t targetID; >+ TargetID targetID; > if (messageObject->getInteger("targetID"_s, targetID)) > event.targetID = targetID; > >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorConnectionClient.h b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorConnectionClient.h >index 7a6a02b00f2..348e3916bc3 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorConnectionClient.h >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorConnectionClient.h >@@ -35,18 +35,18 @@ namespace Inspector { > > class RemoteInspectorConnectionClient : public CanMakeWeakPtr<RemoteInspectorConnectionClient> { > public: >- void didReceiveWebInspectorEvent(ClientID, Vector<uint8_t>&&); >- virtual void didAccept(ClientID, Socket::Domain) { }; >- virtual void didClose(ClientID) = 0; >+ void didReceiveWebInspectorEvent(ConnectionID, Vector<uint8_t>&&); >+ virtual void didAccept(ConnectionID, Socket::Domain) { }; >+ virtual void didClose(ConnectionID) = 0; > > struct Event { >- ClientID clientID; >- Optional<uint64_t> connectionID; >- Optional<uint64_t> targetID; >+ ConnectionID clientID { }; >+ Optional<ConnectionID> connectionID; >+ Optional<TargetID> targetID; > Optional<String> message; > }; > >- using CallHandler = void (RemoteInspectorConnectionClient::*)(const struct Event&); >+ using CallHandler = void (RemoteInspectorConnectionClient::*)(const Event&); > virtual HashMap<String, CallHandler>& dispatchMap() = 0; > }; > >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorMessageParser.cpp b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorMessageParser.cpp >index 0509dcade9b..1bccf9de1a1 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorMessageParser.cpp >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorMessageParser.cpp >@@ -41,8 +41,8 @@ namespace Inspector { > | <------------ size ------------> | > */ > >-MessageParser::MessageParser(ClientID clientID, size_t bufferSize) >- : m_clientID(clientID) >+MessageParser::MessageParser(ConnectionID id, size_t bufferSize) >+ : m_connectionID(id) > { > m_buffer.reserveCapacity(bufferSize); > } >@@ -104,7 +104,7 @@ bool MessageParser::parse() > memcpy(&dataBuffer[0], &m_buffer[sizeof(uint32_t)], dataSize); > > if (m_didParseMessageListener) >- m_didParseMessageListener(m_clientID, WTFMove(dataBuffer)); >+ m_didParseMessageListener(m_connectionID, WTFMove(dataBuffer)); > > m_buffer.remove(0, messageSize); > } >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorMessageParser.h b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorMessageParser.h >index d5b198e253d..ae059fd8a93 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorMessageParser.h >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorMessageParser.h >@@ -36,18 +36,18 @@ class MessageParser { > public: > static Vector<uint8_t> createMessage(const uint8_t*, size_t); > >- MessageParser(ClientID, size_t); >+ MessageParser(ConnectionID, size_t); > void pushReceivedData(const uint8_t*, size_t); >- void setDidParseMessageListener(Function<void(ClientID, Vector<uint8_t>)>&& listener) { m_didParseMessageListener = WTFMove(listener); } >+ void setDidParseMessageListener(Function<void(ConnectionID, Vector<uint8_t>)>&& listener) { m_didParseMessageListener = WTFMove(listener); } > > void clearReceivedData(); > > private: > bool parse(); > >- Function<void(ClientID, Vector<uint8_t>&&)> m_didParseMessageListener; >+ Function<void(ConnectionID, Vector<uint8_t>&&)> m_didParseMessageListener; > Vector<uint8_t> m_buffer; >- ClientID m_clientID; >+ ConnectionID m_connectionID; > }; > > } // namespace Inspector >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp >index 3a450983c08..e60fc527706 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp >@@ -44,7 +44,7 @@ void RemoteInspectorServer::addServerConnection(PlatformSocketType identifier) > } > } > >-void RemoteInspectorServer::didAccept(ClientID clientID, Socket::Domain type) >+void RemoteInspectorServer::didAccept(ConnectionID id, Socket::Domain type) > { > ASSERT(!isMainThread()); > >@@ -53,18 +53,18 @@ void RemoteInspectorServer::didAccept(ClientID clientID, Socket::Domain type) > LOG_ERROR("Inspector server can accept only 1 client"); > return; > } >- m_clientConnection = clientID; >+ m_clientConnection = id; > } else if (type == Socket::Domain::Local) { > LockHolder lock(m_connectionsLock); >- m_inspectorConnections.append(clientID); >+ m_inspectorConnections.append(id); > } > } > >-void RemoteInspectorServer::didClose(ClientID clientID) >+void RemoteInspectorServer::didClose(ConnectionID id) > { > ASSERT(!isMainThread()); > >- if (clientID == m_clientConnection) { >+ if (id == m_clientConnection) { > // Connection from the remote client closed. > callOnMainThread([this] { > clientConnectionClosed(); >@@ -73,29 +73,29 @@ void RemoteInspectorServer::didClose(ClientID clientID) > } > > // Connection from WebProcess closed. >- callOnMainThread([this, clientID] { >- connectionClosed(clientID); >+ callOnMainThread([this, id] { >+ connectionClosed(id); > }); > } > > HashMap<String, RemoteInspectorConnectionClient::CallHandler>& RemoteInspectorServer::dispatchMap() > { > static NeverDestroyed<HashMap<String, CallHandler>> dispatchMap = HashMap<String, CallHandler>({ >- {"SetTargetList"_s, static_cast<CallHandler>(&RemoteInspectorServer::setTargetList)}, >- {"SetupInspectorClient"_s, static_cast<CallHandler>(&RemoteInspectorServer::setupInspectorClient)}, >- {"Setup"_s, static_cast<CallHandler>(&RemoteInspectorServer::setup)}, >- {"FrontendDidClose"_s, static_cast<CallHandler>(&RemoteInspectorServer::close)}, >- {"SendMessageToFrontend"_s, static_cast<CallHandler>(&RemoteInspectorServer::sendMessageToFrontend)}, >- {"SendMessageToBackend"_s, static_cast<CallHandler>(&RemoteInspectorServer::sendMessageToBackend)}, >+ {"SetTargetList"_s, &RemoteInspectorServer::setTargetList}, >+ {"SetupInspectorClient"_s, &RemoteInspectorServer::setupInspectorClient}, >+ {"Setup"_s, &RemoteInspectorServer::setup}, >+ {"FrontendDidClose"_s, &RemoteInspectorServer::close}, >+ {"SendMessageToFrontend"_s, &RemoteInspectorServer::sendMessageToFrontend}, >+ {"SendMessageToBackend"_s, &RemoteInspectorServer::sendMessageToBackend}, > }); > > return dispatchMap; > } > >-void RemoteInspectorServer::sendWebInspectorEvent(ClientID clientID, const String& event) >+void RemoteInspectorServer::sendWebInspectorEvent(ConnectionID id, const String& event) > { > const CString message = event.utf8(); >- m_server->send(clientID, reinterpret_cast<const uint8_t*>(message.data()), message.length()); >+ m_server->send(id, reinterpret_cast<const uint8_t*>(message.data()), message.length()); > } > > RemoteInspectorServer& RemoteInspectorServer::singleton() >@@ -157,7 +157,7 @@ void RemoteInspectorServer::setup(const Event& event) > sendWebInspectorEvent(event.connectionID.value(), setupEvent->toJSONString()); > } > >-void RemoteInspectorServer::sendCloseEvent(uint64_t connectionID, uint64_t targetID) >+void RemoteInspectorServer::sendCloseEvent(ConnectionID connectionID, TargetID targetID) > { > ASSERT(isMainThread()); > >@@ -186,7 +186,7 @@ void RemoteInspectorServer::clientConnectionClosed() > m_clientConnection = WTF::nullopt; > } > >-void RemoteInspectorServer::connectionClosed(uint64_t clientID) >+void RemoteInspectorServer::connectionClosed(ConnectionID clientID) > { > ASSERT(isMainThread()); > >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h >index e93f8ae95c5..b5080aed4e1 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h >@@ -46,34 +46,34 @@ public: > JS_EXPORT_PRIVATE void addServerConnection(PlatformSocketType); > > private: >- void connectionClosed(uint64_t connectionID); >+ void connectionClosed(ConnectionID); > >- void setTargetList(const struct Event&); >- void setupInspectorClient(const struct Event&); >- void setup(const struct Event&); >- void close(const struct Event&); >- void sendMessageToFrontend(const struct Event&); >- void sendMessageToBackend(const struct Event&); >+ void setTargetList(const Event&); >+ void setupInspectorClient(const Event&); >+ void setup(const Event&); >+ void close(const Event&); >+ void sendMessageToFrontend(const Event&); >+ void sendMessageToBackend(const Event&); > >- void sendCloseEvent(uint64_t connectionID, uint64_t targetID); >+ void sendCloseEvent(ConnectionID, TargetID); > void clientConnectionClosed(); > >- void didAccept(ClientID, Socket::Domain) override; >- void didClose(ClientID) override; >+ void didAccept(ConnectionID, Socket::Domain) override; >+ void didClose(ConnectionID) override; > >- void sendWebInspectorEvent(ClientID, const String&); >+ void sendWebInspectorEvent(ConnectionID, const String&); > >- HashMap<String, CallHandler>& dispatchMap(); >+ HashMap<String, CallHandler>& dispatchMap() override; > >- HashSet<std::pair<uint64_t, uint64_t>> m_inspectionTargets; >+ HashSet<std::pair<ConnectionID, TargetID>> m_inspectionTargets; > std::unique_ptr<RemoteInspectorSocketEndpoint> m_server; > > // Connections to the WebProcess. >- Vector<ClientID> m_inspectorConnections; >+ Vector<ConnectionID> m_inspectorConnections; > Lock m_connectionsLock; > > // Connections from RemoteInspectorClient. >- Optional<ClientID> m_clientConnection; >+ Optional<ConnectionID> m_clientConnection; > }; > > } // namespace Inspector >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp >index 75d2484677a..b431df0a7f4 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp >@@ -51,9 +51,9 @@ RemoteInspector::RemoteInspector() > start(); > } > >-void RemoteInspector::didClose(ClientID clientID) >+void RemoteInspector::didClose(ConnectionID id) > { >- if (clientID != m_clientID.value()) >+ if (id != m_clientID.value()) > return; > > RunLoop::current().dispatch([=] { >@@ -192,7 +192,7 @@ void RemoteInspector::sendAutomaticInspectionCandidateMessage() > { > } > >-void RemoteInspector::sendMessageToRemote(unsigned targetIdentifier, const String& message) >+void RemoteInspector::sendMessageToRemote(TargetID targetIdentifier, const String& message) > { > LockHolder lock(m_mutex); > if (!m_socketConnection) >@@ -261,7 +261,7 @@ void RemoteInspector::receivedCloseMessage(const Event& event) > connectionToTarget->close(); > } > >-void RemoteInspector::setup(unsigned targetIdentifier) >+void RemoteInspector::setup(TargetID targetIdentifier) > { > RemoteControllableTarget* target; > { >@@ -284,7 +284,7 @@ void RemoteInspector::setup(unsigned targetIdentifier) > updateHasActiveDebugSession(); > } > >-void RemoteInspector::sendMessageToTarget(unsigned targetIdentifier, const char* message) >+void RemoteInspector::sendMessageToTarget(TargetID targetIdentifier, const char* message) > { > if (auto connectionToTarget = m_targetConnectionMap.get(targetIdentifier)) > connectionToTarget->sendMessageToTarget(String::fromUTF8(message)); >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.h b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.h >index 7bb704e6d10..2f2dadb2676 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.h >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.h >@@ -41,16 +41,16 @@ > > namespace Inspector { > >+using ConnectionID = uint32_t; >+ > #if OS(WINDOWS) > >-using ClientID = unsigned; > using PlatformSocketType = SOCKET; > using PollingDescriptor = WSAPOLLFD; > constexpr PlatformSocketType INVALID_SOCKET_VALUE = INVALID_SOCKET; > > #else > >-using ClientID = unsigned; > using PlatformSocketType = int; > using PollingDescriptor = struct pollfd; > constexpr PlatformSocketType INVALID_SOCKET_VALUE = -1; >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp >index 4d339edb838..647ff69357a 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp >@@ -69,7 +69,7 @@ void RemoteInspectorSocketEndpoint::wakeupWorkerThread() > Socket::write(m_wakeupSendSocket, "1", 1); > } > >-Optional<ClientID> RemoteInspectorSocketEndpoint::connectInet(const char* serverAddress, uint16_t serverPort) >+Optional<ConnectionID> RemoteInspectorSocketEndpoint::connectInet(const char* serverAddress, uint16_t serverPort) > { > if (auto socket = Socket::connect(serverAddress, serverPort)) > return createClient(*socket); >@@ -86,7 +86,7 @@ bool RemoteInspectorSocketEndpoint::listenInet(uint16_t port) > return false; > } > >-bool RemoteInspectorSocketEndpoint::isListening(ClientID id) >+bool RemoteInspectorSocketEndpoint::isListening(ConnectionID id) > { > LockHolder lock(m_connectionsLock); > if (const auto& connection = m_connections.get(id)) >@@ -100,7 +100,7 @@ void RemoteInspectorSocketEndpoint::workerThread() > > while (!m_shouldAbortWorkerThread) { > Vector<PollingDescriptor> pollfds; >- Vector<ClientID> ids; >+ Vector<ConnectionID> ids; > { > LockHolder lock(m_connectionsLock); > for (const auto& connection : m_connections) { >@@ -132,14 +132,14 @@ void RemoteInspectorSocketEndpoint::workerThread() > } > } > >-Optional<ClientID> RemoteInspectorSocketEndpoint::createClient(PlatformSocketType socket) >+Optional<ConnectionID> RemoteInspectorSocketEndpoint::createClient(PlatformSocketType socket) > { > if (!Socket::isValid(socket)) > return WTF::nullopt; > > LockHolder lock(m_connectionsLock); > >- ClientID id; >+ ConnectionID id; > do { > id = cryptographicallyRandomNumber(); > } while (!id || m_connections.contains(id)); >@@ -151,7 +151,7 @@ Optional<ClientID> RemoteInspectorSocketEndpoint::createClient(PlatformSocketTyp > connection->poll = Socket::preparePolling(socket); > connection->socket = socket; > connection->parser = std::make_unique<MessageParser>(id, Socket::BufferSize); >- connection->parser->setDidParseMessageListener([this](ClientID id, Vector<uint8_t>&& data) { >+ connection->parser->setDidParseMessageListener([this](ConnectionID id, Vector<uint8_t>&& data) { > if (m_inspectorClient) > m_inspectorClient->didReceiveWebInspectorEvent(id, WTFMove(data)); > }); >@@ -161,10 +161,10 @@ Optional<ClientID> RemoteInspectorSocketEndpoint::createClient(PlatformSocketTyp > return id; > } > >-void RemoteInspectorSocketEndpoint::recvIfEnabled(ClientID clientID) >+void RemoteInspectorSocketEndpoint::recvIfEnabled(ConnectionID id) > { > LockHolder lock(m_connectionsLock); >- if (const auto& connection = m_connections.get(clientID)) { >+ if (const auto& connection = m_connections.get(id)) { > Vector<uint8_t> recvBuffer(Socket::BufferSize); > if (auto readSize = Socket::read(connection->socket, recvBuffer.data(), recvBuffer.size())) { > if (*readSize > 0) >@@ -173,18 +173,18 @@ void RemoteInspectorSocketEndpoint::recvIfEnabled(ClientID clientID) > } > > Socket::close(connection->socket); >- m_connections.remove(clientID); >+ m_connections.remove(id); > > lock.unlockEarly(); > if (m_inspectorClient) >- m_inspectorClient->didClose(clientID); >+ m_inspectorClient->didClose(id); > } > } > >-void RemoteInspectorSocketEndpoint::sendIfEnabled(ClientID clientID) >+void RemoteInspectorSocketEndpoint::sendIfEnabled(ConnectionID id) > { > LockHolder lock(m_connectionsLock); >- if (const auto& connection = m_connections.get(clientID)) { >+ if (const auto& connection = m_connections.get(id)) { > Socket::clearWaitingWritable(connection->poll); > > auto& buffer = connection->sendBuffer; >@@ -206,10 +206,10 @@ void RemoteInspectorSocketEndpoint::sendIfEnabled(ClientID clientID) > } > } > >-void RemoteInspectorSocketEndpoint::send(ClientID clientID, const uint8_t* data, size_t size) >+void RemoteInspectorSocketEndpoint::send(ConnectionID id, const uint8_t* data, size_t size) > { > LockHolder lock(m_connectionsLock); >- if (const auto& connection = m_connections.get(clientID)) { >+ if (const auto& connection = m_connections.get(id)) { > auto message = MessageParser::createMessage(data, size); > if (message.isEmpty()) > return; >@@ -234,7 +234,7 @@ void RemoteInspectorSocketEndpoint::send(ClientID clientID, const uint8_t* data, > } > } > >-void RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled(ClientID id) >+void RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled(ConnectionID id) > { > if (!isListening(id)) > return; >diff --git a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h >index 933ab9057fc..669a8487f73 100644 >--- a/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h >+++ b/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h >@@ -52,23 +52,23 @@ public: > RemoteInspectorSocketEndpoint(RemoteInspectorConnectionClient*, const char*); > ~RemoteInspectorSocketEndpoint(); > >- Optional<ClientID> connectInet(const char* serverAddr, uint16_t serverPort); >+ Optional<ConnectionID> connectInet(const char* serverAddr, uint16_t serverPort); > bool listenInet(uint16_t port); > >- void send(ClientID, const uint8_t* data, size_t); >+ void send(ConnectionID, const uint8_t* data, size_t); > >- Optional<ClientID> createClient(PlatformSocketType fd); >+ Optional<ConnectionID> createClient(PlatformSocketType fd); > > protected: >- void recvIfEnabled(ClientID); >- void sendIfEnabled(ClientID); >+ void recvIfEnabled(ConnectionID); >+ void sendIfEnabled(ConnectionID); > void workerThread(); > void wakeupWorkerThread(); >- void acceptInetSocketIfEnabled(ClientID); >- bool isListening(ClientID); >+ void acceptInetSocketIfEnabled(ConnectionID); >+ bool isListening(ConnectionID); > > Lock m_connectionsLock; >- HashMap<ClientID, std::unique_ptr<Socket::Connection>> m_connections; >+ HashMap<ConnectionID, std::unique_ptr<Socket::Connection>> m_connections; > > PlatformSocketType m_wakeupSendSocket { INVALID_SOCKET_VALUE }; > PlatformSocketType m_wakeupReceiveSocket { INVALID_SOCKET_VALUE };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197243
:
368174
|
368189
|
368193
| 368249