add isInspectable property

Reviewed By: Hypuk

Differential Revision: D6578737

fbshipit-source-id: 05143e4cf59b5be9e20ab79b83efbfaa7da059d8
This commit is contained in:
Ben Nham 2017-12-18 13:19:35 -08:00 committed by Facebook Github Bot
parent 2668dc8e1b
commit 3852c42ad8
3 changed files with 11 additions and 0 deletions

View File

@ -644,6 +644,10 @@ namespace facebook {
return m_context;
}
bool JSCExecutor::isInspectable() {
return canUseInspector(m_context);
}
#ifdef WITH_JSC_MEMORY_PRESSURE
void JSCExecutor::handleMemoryPressure(int pressureLevel) {
JSHandleMemoryPressure(this, m_context, static_cast<JSMemoryPressure>(pressureLevel));

View File

@ -93,6 +93,8 @@ public:
virtual void* getJavaScriptContext() override;
virtual bool isInspectable() override;
#ifdef WITH_JSC_MEMORY_PRESSURE
virtual void handleMemoryPressure(int pressureLevel) override;
#endif

View File

@ -75,10 +75,15 @@ public:
virtual void setGlobalVariable(std::string propName,
std::unique_ptr<const JSBigString> jsonValue) = 0;
virtual void* getJavaScriptContext() {
return nullptr;
}
virtual bool isInspectable() {
return false;
}
/**
* The description is displayed in the dev menu, if there is one in
* this build. There is a default, but if this method returns a