Alexander Blom 156e5d9837 Add on-device JSC inspector
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
2016-11-02 12:29:14 -07:00

34 lines
719 B
C++

// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include <memory>
#include <folly/dynamic.h>
// Both double-conversions and WTF define the ASSERT macro
#undef ASSERT
namespace facebook {
namespace react {
class Channel {
public:
using MessageHandler = std::function<void(std::string message, int callId, const std::string& methodName, folly::dynamic args)>;
virtual ~Channel() = default;
virtual void sendMessage(std::string message) = 0;
virtual void registerDomain(std::string domain, MessageHandler handler) = 0;
};
class Dispatcher {
public:
virtual ~Dispatcher() {}
virtual void onConnect(std::shared_ptr<Channel> channel) = 0;
virtual void onDisconnect() = 0;
};
}
}