react-native/ReactCommon/inspector/LegacyInspectorEnvironment.h
Alexander Blom 0ac7bf29af Add Page, Runtime, Debugger agents
Summary: Runtime and Debugger agents are shipped with JSC so we reuse them. Messages are routed to them through the `LegacyDispatcher` which also handles translating their events. The Page agent emits the `Page.getResourceTree` method that the Chrome inspector expects.

Reviewed By: michalgr

Differential Revision: D4021499

fbshipit-source-id: a93d0add01cee732401f8e8db1d43205bfbd4cd4
2016-11-02 12:29:14 -07:00

36 lines
1.1 KiB
C++

// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include <JavaScriptCore/config.h>
#include <JavaScriptCore/InspectorEnvironment.h>
namespace Inspector {
class InjectedScriptManager;
}
namespace facebook {
namespace react {
class LegacyInspectorEnvironment : public Inspector::InspectorEnvironment {
public:
LegacyInspectorEnvironment();
~LegacyInspectorEnvironment();
Inspector::InjectedScriptManager* injectedScriptManager() const {
return injectedScriptManager_.get();
}
private:
std::unique_ptr<Inspector::InjectedScriptManager> injectedScriptManager_;
bool developerExtrasEnabled() const override { return true; }
bool canAccessInspectedScriptState(JSC::ExecState*) const override { return true; }
Inspector::InspectorFunctionCallHandler functionCallHandler() const override;
Inspector::InspectorEvaluateHandler evaluateHandler() const override;
void willCallInjectedScriptFunction(JSC::ExecState*, const WTF::String& scriptName, int scriptLine) override {};
void didCallInjectedScriptFunction(JSC::ExecState*) override {}
};
}
}