From 3afe4c64f3fdc245386ca02f92ad541810213683 Mon Sep 17 00:00:00 2001 From: Matt Blagden Date: Thu, 4 Aug 2022 14:50:45 -0700 Subject: [PATCH] Use HermesRuntime to disable debugging Summary: Changelog: [Internal] Debugging is enabled via `enableDebugging` with a `RuntimeAdapter` that provides a `HermesRuntime`. This same `HermesRuntime` should be passed to `disableDebugging`, not a decorated version. Change the argument type of `disableDebugging` to steer callers in the right direction. Reviewed By: jpporto Differential Revision: D38051662 fbshipit-source-id: ae436a4af12fa01143bfbcdb97e65e4fca90154d --- ReactCommon/hermes/inspector/chrome/ConnectionDemux.cpp | 2 +- ReactCommon/hermes/inspector/chrome/ConnectionDemux.h | 2 +- ReactCommon/hermes/inspector/chrome/Registration.cpp | 2 +- ReactCommon/hermes/inspector/chrome/Registration.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ReactCommon/hermes/inspector/chrome/ConnectionDemux.cpp b/ReactCommon/hermes/inspector/chrome/ConnectionDemux.cpp index 7b35662eec8..9aaee2ca13a 100644 --- a/ReactCommon/hermes/inspector/chrome/ConnectionDemux.cpp +++ b/ReactCommon/hermes/inspector/chrome/ConnectionDemux.cpp @@ -94,7 +94,7 @@ int ConnectionDemux::enableDebugging( std::make_shared(std::move(adapter), title, waitForDebugger)); } -void ConnectionDemux::disableDebugging(jsi::Runtime &runtime) { +void ConnectionDemux::disableDebugging(HermesRuntime &runtime) { std::lock_guard lock(mutex_); for (auto &it : conns_) { diff --git a/ReactCommon/hermes/inspector/chrome/ConnectionDemux.h b/ReactCommon/hermes/inspector/chrome/ConnectionDemux.h index 7ade9eb89c3..d7697bc6b4f 100644 --- a/ReactCommon/hermes/inspector/chrome/ConnectionDemux.h +++ b/ReactCommon/hermes/inspector/chrome/ConnectionDemux.h @@ -39,7 +39,7 @@ class ConnectionDemux { int enableDebugging( std::unique_ptr adapter, const std::string &title); - void disableDebugging(jsi::Runtime &runtime); + void disableDebugging(HermesRuntime &runtime); private: int addPage(std::shared_ptr conn); diff --git a/ReactCommon/hermes/inspector/chrome/Registration.cpp b/ReactCommon/hermes/inspector/chrome/Registration.cpp index 4f0baf27eae..d64a08ebbfc 100644 --- a/ReactCommon/hermes/inspector/chrome/Registration.cpp +++ b/ReactCommon/hermes/inspector/chrome/Registration.cpp @@ -28,7 +28,7 @@ void enableDebugging( demux().enableDebugging(std::move(adapter), title); } -void disableDebugging(jsi::Runtime &runtime) { +void disableDebugging(HermesRuntime &runtime) { demux().disableDebugging(runtime); } diff --git a/ReactCommon/hermes/inspector/chrome/Registration.h b/ReactCommon/hermes/inspector/chrome/Registration.h index f14ac7f3192..9acff574df8 100644 --- a/ReactCommon/hermes/inspector/chrome/Registration.h +++ b/ReactCommon/hermes/inspector/chrome/Registration.h @@ -31,7 +31,7 @@ extern void enableDebugging( * disableDebugging removes this runtime from the list of debuggable JS targets * in this process. */ -extern void disableDebugging(jsi::Runtime &runtime); +extern void disableDebugging(HermesRuntime &runtime); } // namespace chrome } // namespace inspector