Rename Instance::getNativeCallinvoker to Instance::getDecoratedNativeCallInvoker

Summary:
Now, instead of accepting a `std::function` that schedules work, and returning a `CallInvoker`, `Instance::getDecoratedNativeCallInvoker`  will accept a `CallInvoker` that schedules work, and return a decorated `CallInvoker`.

I think this change will help with readability. It also clarifies that the bridge is adding additional behaviour to the native `CallInvoker`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20826885

fbshipit-source-id: a2c5681d10a4544ee3d2a0d1f1cbd386ef06d0e6
This commit is contained in:
Ramanpreet Nara
2020-04-03 09:47:41 -07:00
committed by Facebook GitHub Bot
parent 83fee73ae6
commit eb4e2baaa9
5 changed files with 38 additions and 25 deletions
+3 -3
View File
@@ -228,9 +228,9 @@ std::shared_ptr<CallInvoker> Instance::getJSCallInvoker() {
return std::static_pointer_cast<CallInvoker>(jsCallInvoker_);
}
std::shared_ptr<CallInvoker> Instance::getNativeCallInvoker(
std::function<void(std::function<void()> &&work)> &&scheduleWork) {
return nativeToJsBridge_->getNativeCallInvoker(std::move(scheduleWork));
std::shared_ptr<CallInvoker> Instance::getDecoratedNativeCallInvoker(
std::shared_ptr<CallInvoker> nativeInvoker) {
return nativeToJsBridge_->getDecoratedNativeCallInvoker(nativeInvoker);
}
void Instance::JSCallInvoker::setNativeToJsBridgeAndFlushCalls(