add isInspectable property
Reviewed By: Hypuk Differential Revision: D6578736 fbshipit-source-id: a4229c3766125ff55cff50a49893b2385f9c8a6a
This commit is contained in:
parent
3852c42ad8
commit
15cd98b782
|
@ -1094,4 +1094,10 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - Inspector
|
||||||
|
|
||||||
|
- (BOOL)isInspectable {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -168,6 +168,12 @@ RCT_EXTERN void RCTVerifyAllModulesExported(NSArray *extraModules);
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface RCTBridge (Inspector)
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, getter=isInspectable) BOOL inspectable;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@interface RCTBatchedBridge : RCTBridge <RCTInvalidating>
|
@interface RCTBatchedBridge : RCTBridge <RCTInvalidating>
|
||||||
|
|
||||||
@property (nonatomic, weak, readonly) RCTBridge *parentBridge;
|
@property (nonatomic, weak, readonly) RCTBridge *parentBridge;
|
||||||
|
|
|
@ -194,6 +194,10 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||||
return (JSGlobalContextRef)(self->_reactInstance ? self->_reactInstance->getJavaScriptContext() : nullptr);
|
return (JSGlobalContextRef)(self->_reactInstance ? self->_reactInstance->getJavaScriptContext() : nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isInspectable {
|
||||||
|
return self->_reactInstance->isInspectable();
|
||||||
|
}
|
||||||
|
|
||||||
- (instancetype)initWithParentBridge:(RCTBridge *)bridge
|
- (instancetype)initWithParentBridge:(RCTBridge *)bridge
|
||||||
{
|
{
|
||||||
RCTAssertParam(bridge);
|
RCTAssertParam(bridge);
|
||||||
|
|
|
@ -143,6 +143,10 @@ void *Instance::getJavaScriptContext() {
|
||||||
: nullptr;
|
: nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Instance::isInspectable() {
|
||||||
|
return nativeToJsBridge_ ? nativeToJsBridge_->isInspectable() : false;
|
||||||
|
}
|
||||||
|
|
||||||
void Instance::callJSFunction(std::string &&module, std::string &&method,
|
void Instance::callJSFunction(std::string &&module, std::string &&method,
|
||||||
folly::dynamic &¶ms) {
|
folly::dynamic &¶ms) {
|
||||||
callback_->incrementPendingJSCalls();
|
callback_->incrementPendingJSCalls();
|
||||||
|
|
|
@ -55,6 +55,7 @@ public:
|
||||||
void setGlobalVariable(std::string propName,
|
void setGlobalVariable(std::string propName,
|
||||||
std::unique_ptr<const JSBigString> jsonValue);
|
std::unique_ptr<const JSBigString> jsonValue);
|
||||||
void *getJavaScriptContext();
|
void *getJavaScriptContext();
|
||||||
|
bool isInspectable();
|
||||||
void callJSFunction(std::string &&module, std::string &&method,
|
void callJSFunction(std::string &&module, std::string &&method,
|
||||||
folly::dynamic &¶ms);
|
folly::dynamic &¶ms);
|
||||||
void callJSCallback(uint64_t callbackId, folly::dynamic &¶ms);
|
void callJSCallback(uint64_t callbackId, folly::dynamic &¶ms);
|
||||||
|
|
|
@ -190,6 +190,10 @@ void* NativeToJsBridge::getJavaScriptContext() {
|
||||||
return m_executor->getJavaScriptContext();
|
return m_executor->getJavaScriptContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NativeToJsBridge::isInspectable() {
|
||||||
|
return m_executor->isInspectable();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WITH_JSC_MEMORY_PRESSURE
|
#ifdef WITH_JSC_MEMORY_PRESSURE
|
||||||
void NativeToJsBridge::handleMemoryPressure(int pressureLevel) {
|
void NativeToJsBridge::handleMemoryPressure(int pressureLevel) {
|
||||||
runOnExecutorQueue([=] (JSExecutor* executor) {
|
runOnExecutorQueue([=] (JSExecutor* executor) {
|
||||||
|
|
|
@ -101,6 +101,7 @@ public:
|
||||||
void registerBundle(uint32_t bundleId, const std::string& bundlePath);
|
void registerBundle(uint32_t bundleId, const std::string& bundlePath);
|
||||||
void setGlobalVariable(std::string propName, std::unique_ptr<const JSBigString> jsonValue);
|
void setGlobalVariable(std::string propName, std::unique_ptr<const JSBigString> jsonValue);
|
||||||
void* getJavaScriptContext();
|
void* getJavaScriptContext();
|
||||||
|
bool isInspectable();
|
||||||
|
|
||||||
#ifdef WITH_JSC_MEMORY_PRESSURE
|
#ifdef WITH_JSC_MEMORY_PRESSURE
|
||||||
void handleMemoryPressure(int pressureLevel);
|
void handleMemoryPressure(int pressureLevel);
|
||||||
|
|
Loading…
Reference in New Issue