Skip to content

Commit

Permalink
fix(core): add log for check callUIFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
etkmao committed Sep 24, 2024
1 parent c9dd227 commit e58da7a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions driver/js/src/modules/ui_manager_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ void UIManagerModule::CallUIFunction(CallbackInfo& info, void* data) {
name = name_value->ToStringChecked();
}

FOOTSTONE_LOG(ERROR) << "xxx call fix, UIManagerModule::CallUIFunction, name: " << name;

std::unordered_map<std::string, std::shared_ptr<HippyValue>> param;
DomArgument param_value = *(hippy::ToDomArgument(context, info[2]));
hippy::CallFunctionCallback cb = nullptr;
Expand Down Expand Up @@ -96,6 +98,9 @@ void UIManagerModule::CallUIFunction(CallbackInfo& info, void* data) {
HippyValue value;
bool flag = argument->ToObject(value);
if (flag) {

FOOTSTONE_LOG(ERROR) << "xxx call fix, UIManagerModule::CallUIFunction, callback to js";

auto param = hippy::CreateCtxValue(
context, std::make_shared<HippyValue>(std::move(value)));
if (param) {
Expand All @@ -119,6 +124,8 @@ void UIManagerModule::CallUIFunction(CallbackInfo& info, void* data) {
if (!dom_manager) {
return;
}

FOOTSTONE_LOG(ERROR) << "xxx call fix, UIManagerModule::CallUIFunction, to dom_manager";
dom_manager->CallFunction(scope->GetRootNode(), static_cast<uint32_t>(id), name, param_value, cb);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,19 @@ private void measureInWindow(@NonNull View view, @NonNull Promise promise) {
outputBuffer[1] -= statusBarHeight;
}
} catch (Exception e) {
LogUtils.e(TAG, "xxx call fix, measureInWindow, exception: " + e.getMessage());

promise.resolve(
"An exception occurred when get view location on screen: " + e.getMessage());
return;
}

LogUtils.e(TAG, "xxx call fix, measureInWindow: x=" + outputBuffer[0]
+ ", y=" + outputBuffer[1]
+ ", width=" + view.getWidth()
+ ", height=" + view.getHeight()
+ ", statusBarHeight=" + statusBarHeight);

LogUtils.d(TAG, "measureInWindow: x=" + outputBuffer[0]
+ ", y=" + outputBuffer[1]
+ ", width=" + view.getWidth()
Expand Down

0 comments on commit e58da7a

Please sign in to comment.