mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 09:12:02 +00:00
156e5d9837
Summary: Introduces the inspector library supporting the Chrome Debugging Protocol for JavaScriptCore. Eventually this will mean that it is possible to attach the Chrome inspector directly to the JSC instance running on the device. This library doesn't define the actual transport but leaves that up to the platform layer. The main entry point (and the only exported header) is `Inspector.h`. This diff only introduces the basics supporting the `Schema` and `Inspector` domains meaning it doesn't have any features yet. These will come in following diffs. Reviewed By: michalgr Differential Revision: D4021490 fbshipit-source-id: 517fd9033051c11ba97d312b16382445ae85d3f3
43 lines
846 B
C++
43 lines
846 B
C++
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Dispatcher.h"
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
|
|
namespace JSC {
|
|
class JSGlobalObject;
|
|
}
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
class ConcreteChannel;
|
|
class InspectorAgent;
|
|
|
|
using Receiver = std::function<void(std::string)>;
|
|
|
|
class InspectorController {
|
|
public:
|
|
InspectorController(JSC::JSGlobalObject& globalObject);
|
|
~InspectorController();
|
|
|
|
JSC::JSGlobalObject& getGlobalObject() const { return globalObject_; }
|
|
|
|
void onConnect(Receiver receiver);
|
|
void onMessage(std::string message);
|
|
void onGoingAway();
|
|
void onDisconnect();
|
|
private:
|
|
JSC::JSGlobalObject& globalObject_;
|
|
std::shared_ptr<ConcreteChannel> channel_;
|
|
std::vector<std::unique_ptr<Dispatcher>> dispatchers_;
|
|
InspectorAgent* inspectorAgent_;
|
|
};
|
|
|
|
}
|
|
}
|