mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-21 10:34:31 +08:00
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
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "LegacyScriptDebugServer.h"
|
|
|
|
#include <JavaScriptCore/config.h>
|
|
#include <JavaScriptCore/InspectorDebuggerAgent.h>
|
|
#include <JavaScriptCore/InspectorConsoleAgent.h>
|
|
|
|
namespace JSC {
|
|
class JSGlobalObject;
|
|
}
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
class ConsoleAgent;
|
|
|
|
class LegacyDebuggerAgent : public Inspector::InspectorDebuggerAgent {
|
|
public:
|
|
LegacyDebuggerAgent(Inspector::InjectedScriptManager*, JSC::JSGlobalObject&, ConsoleAgent*);
|
|
|
|
virtual LegacyScriptDebugServer& scriptDebugServer() override { return scriptDebugServer_; }
|
|
|
|
virtual void startListeningScriptDebugServer() override;
|
|
virtual void stopListeningScriptDebugServer(bool isBeingDestroyed) override;
|
|
virtual Inspector::InjectedScript injectedScriptForEval(Inspector::ErrorString*, const int* executionContextId) override;
|
|
|
|
virtual void breakpointActionLog(JSC::ExecState*, const String&) override;
|
|
|
|
virtual void muteConsole() override { }
|
|
virtual void unmuteConsole() override { }
|
|
|
|
private:
|
|
LegacyScriptDebugServer scriptDebugServer_;
|
|
ConsoleAgent* consoleAgent_;
|
|
};
|
|
|
|
}
|
|
}
|