Skip to content

Commit 36e1c0a

Browse files
lavenzgmeta-codesync[bot]
authored andcommitted
Remove old CDPHandler (#53983)
Summary: Pull Request resolved: #53983 Changelog: [Internal] Reviewed By: huntie Differential Revision: D83525759 fbshipit-source-id: 0a223a54339496e4e85ecb173b3c7e0012c4fba8
1 parent b3341d3 commit 36e1c0a

File tree

10 files changed

+16
-496
lines changed

10 files changed

+16
-496
lines changed

packages/react-native/ReactCommon/hermes/executor/HermesExecutorFactory.cpp

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,55 +15,13 @@
1515

1616
#include <hermes/inspector-modern/chrome/HermesRuntimeTargetDelegate.h>
1717

18-
#if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
19-
#include <hermes/inspector-modern/chrome/Registration.h>
20-
#include <hermes/inspector/RuntimeAdapter.h>
21-
#endif
22-
2318
using namespace facebook::hermes;
2419
using namespace facebook::jsi;
2520

2621
namespace facebook::react {
2722

2823
namespace {
2924

30-
#if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
31-
32-
class HermesExecutorRuntimeAdapter
33-
: public facebook::hermes::inspector_modern::RuntimeAdapter {
34-
public:
35-
HermesExecutorRuntimeAdapter(
36-
std::shared_ptr<HermesRuntime> runtime,
37-
std::shared_ptr<MessageQueueThread> thread)
38-
: runtime_(runtime), thread_(std::move(thread)) {}
39-
40-
virtual ~HermesExecutorRuntimeAdapter() = default;
41-
42-
HermesRuntime& getRuntime() override {
43-
return *runtime_;
44-
}
45-
46-
void tickleJs() override {
47-
thread_->runOnQueue(
48-
[weakRuntime = std::weak_ptr<HermesRuntime>(runtime_)]() {
49-
auto runtime = weakRuntime.lock();
50-
if (!runtime) {
51-
return;
52-
}
53-
jsi::Function func =
54-
runtime->global().getPropertyAsFunction(*runtime, "__tickleJs");
55-
func.call(*runtime);
56-
});
57-
}
58-
59-
private:
60-
std::shared_ptr<HermesRuntime> runtime_;
61-
62-
std::shared_ptr<MessageQueueThread> thread_;
63-
};
64-
65-
#endif // defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
66-
6725
struct ReentrancyCheck {
6826
// This is effectively a very subtle and complex assert, so only
6927
// include it in builds which would include asserts.
@@ -147,42 +105,17 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator<ReentrancyCheck> {
147105
const std::string& debuggerName)
148106
: jsi::WithRuntimeDecorator<ReentrancyCheck>(*runtime, reentrancyCheck_),
149107
runtime_(std::move(runtime)) {
150-
#if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
151-
enableDebugger_ = enableDebugger;
152-
if (enableDebugger_) {
153-
std::shared_ptr<HermesRuntime> rt(runtime_, &hermesRuntime);
154-
auto adapter =
155-
std::make_unique<HermesExecutorRuntimeAdapter>(rt, jsQueue);
156-
debugToken_ = facebook::hermes::inspector_modern::chrome::enableDebugging(
157-
std::move(adapter), debuggerName);
158-
}
159-
#else
160108
(void)jsQueue;
161-
#endif // HERMES_ENABLE_DEBUGGER
162109
}
163110

164-
~DecoratedRuntime() {
165-
#if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
166-
if (enableDebugger_) {
167-
facebook::hermes::inspector_modern::chrome::disableDebugging(debugToken_);
168-
}
169-
#endif // HERMES_ENABLE_DEBUGGER
170-
}
111+
~DecoratedRuntime() {}
171112

172113
private:
173114
// runtime_ is a potentially decorated Runtime.
174115
// hermesRuntime is a reference to a HermesRuntime managed by runtime_.
175-
//
176-
// HermesExecutorRuntimeAdapter requirements are kept, because the
177-
// dtor will disable debugging on the HermesRuntime before the
178-
// member managing it is destroyed.
179116

180117
std::shared_ptr<Runtime> runtime_;
181118
ReentrancyCheck reentrancyCheck_;
182-
#if defined(HERMES_ENABLE_DEBUGGER) && !defined(HERMES_V1_ENABLED)
183-
bool enableDebugger_;
184-
facebook::hermes::inspector_modern::chrome::DebugSessionToken debugToken_;
185-
#endif // HERMES_ENABLE_DEBUGGER
186119
};
187120

188121
} // namespace

packages/react-native/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp

Lines changed: 0 additions & 142 deletions
This file was deleted.

packages/react-native/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

packages/react-native/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp

Lines changed: 0 additions & 37 deletions
This file was deleted.

packages/react-native/ReactCommon/hermes/inspector-modern/chrome/Registration.h

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)