Files
react-native/ReactCommon/hermes/inspector/RuntimeAdapter.cpp
T
Riley Dulin e6f3388541 Change HermesRuntime to jsi::Runtime in RuntimeAdapter
Summary:
Changelog: [Internal]

The inspector API doesn't really need a `HermesRuntime`, all it needs is a `jsi::Runtime` and a `Debugger &`.
Change the return type of `RuntimeAdapter::getRuntime` to be `jsi::Runtime`.
This will allow the inspector to use the tracing runtime instead of the direct hermes runtime.

Reviewed By: willholen

Differential Revision: D18973867

fbshipit-source-id: 6809e52452a35e62be9ca8143aeaba8964c98eaa
2020-01-23 13:16:47 -08:00

36 lines
828 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "RuntimeAdapter.h"
namespace facebook {
namespace hermes {
namespace inspector {
RuntimeAdapter::~RuntimeAdapter() = default;
void RuntimeAdapter::tickleJs() {}
SharedRuntimeAdapter::SharedRuntimeAdapter(
std::shared_ptr<jsi::Runtime> runtime,
debugger::Debugger &debugger)
: runtime_(std::move(runtime)), debugger_(debugger) {}
SharedRuntimeAdapter::~SharedRuntimeAdapter() = default;
jsi::Runtime &SharedRuntimeAdapter::getRuntime() {
return *runtime_;
}
debugger::Debugger &SharedRuntimeAdapter::getDebugger() {
return debugger_;
}
} // namespace inspector
} // namespace hermes
} // namespace facebook