mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Add JS agent support
Summary: Adds the possibility to define agents in Javascript. Javascript agents are simple classes that extend `InspectorAgent` and pass down the given `EventSender` to the super constructor. The library will then call methods on the object for each received method call over the protocol. Reviewed By: davidaurelio Differential Revision: D4021508 fbshipit-source-id: bbe609e92ea726cbbbec833df81705ebd3346c77
This commit is contained in:
committed by
Facebook Github Bot
parent
27f504e9e3
commit
6a1783210b
@@ -8,6 +8,7 @@
|
||||
#include "InspectorAgent.h"
|
||||
#include "PageAgent.h"
|
||||
#include "ConsoleAgent.h"
|
||||
#include "JSDispatcher.h"
|
||||
#include "LegacyAgents.h"
|
||||
|
||||
#include <folly/Memory.h>
|
||||
@@ -142,6 +143,7 @@ InspectorController::InspectorController(JSC::JSGlobalObject& globalObject)
|
||||
dispatchers_.push_back(std::move(inspectorAgent));
|
||||
dispatchers_.push_back(folly::make_unique<SchemaAgent>());
|
||||
dispatchers_.push_back(folly::make_unique<PageAgent>());
|
||||
dispatchers_.push_back(folly::make_unique<JSDispatcher>(globalObject));
|
||||
|
||||
auto consoleAgent = folly::make_unique<ConsoleAgent>(globalObject, environment->injectedScriptManager());
|
||||
auto legacyAgents = folly::make_unique<LegacyAgents>(globalObject, std::move(environment), consoleAgent.get());
|
||||
|
||||
Reference in New Issue
Block a user