Skip to content

Commit

Permalink
feat(ohos): refactor devtool snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
zealotchen0 committed Sep 26, 2024
1 parent 7912261 commit d2f680d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <string>
#include <sys/types.h>
#include "footstone/serializer.h"
#include "oh_napi/ark_ts.h"
#include "renderer/arkui/arkui_node.h"
#include "renderer/native_render_context.h"
#include "footstone/hippy_value.h"
Expand Down Expand Up @@ -62,7 +61,6 @@ class BaseView : public ArkUINodeDelegate, public std::enable_shared_from_this<B
virtual void OnSetPropsEnd();
virtual void Call(const std::string &method, const std::vector<HippyValue> params,
std::function<void(const HippyValue &result)> callback);

void AddSubRenderView(std::shared_ptr<BaseView> &subView, int32_t index);
void RemoveSubView(std::shared_ptr<BaseView> &subView);
void RemoveFromParentView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include <js_native_api_types.h>
#include "footstone/string_view.h"
#include "footstone/task_runner.h"
#include "oh_napi/ark_ts.h"
#include "renderer/components/base_view.h"

namespace hippy {
inline namespace framework {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "oh_napi/ark_ts.h"
#include "oh_napi/oh_napi_object.h"
#include "oh_napi/oh_napi_object_builder.h"
#include "oh_napi/oh_napi_task_runner.h"
#include "oh_napi/oh_napi_utils.h"
#include "renderer/dom_node/hr_node_props.h"
#include "renderer/native_render_params.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "oh_napi/oh_napi_task_runner.h"
#include "oh_napi/oh_napi_invocation.h"
#include "oh_napi/oh_napi_register.h"
#include "oh_napi/oh_napi_utils.h"
#include "oh_napi/oh_measure_text.h"
#include "footstone/deserializer.h"
#include "footstone/hippy_value.h"
Expand Down Expand Up @@ -57,7 +56,7 @@ void CallRenderDelegateSetIdMethod(napi_env env, napi_ref render_provider_ref,
auto delegateObject = arkTs.GetObject(render_provider_ref);
delegateObject.Call(method.c_str(), args);
}

void CallRenderDelegateMethod(napi_env env, napi_ref render_provider_ref,
const std::string& method, uint32_t root_id, const std::pair<uint8_t*, size_t>& buffer) {
OhNapiTaskRunner *taskRunner = OhNapiTaskRunner::Instance(env);
Expand Down
7 changes: 3 additions & 4 deletions modules/ohos/oh_napi/include/oh_napi/ark_ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <string>
#include <functional>
#include <variant>
#include "footstone/hippy_value.h"
#include "footstone/string_view.h"

using string_view = footstone::string_view;
Expand Down Expand Up @@ -116,7 +115,7 @@ class ArkTS {
napi_value GetArrayElement(napi_value array, uint32_t index);

uint32_t GetArrayLength(napi_value array);

std::vector<std::pair<napi_value, napi_value>> GetObjectProperties(napi_value object);

std::string GetString(napi_value value);
Expand All @@ -130,9 +129,9 @@ class ArkTS {
napi_env GetEnv();

void ThrowError(const char *message);

void PrintValue(napi_value value);

private:
napi_env env_;

Expand Down
4 changes: 2 additions & 2 deletions modules/ohos/oh_napi/include/oh_napi/oh_napi_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ using HippyValue = footstone::HippyValue;

class OhNapiUtils {
public:
static HippyValue NapiValue2HippyValue(napi_env env, napi_value value);
static napi_value HippyValue2NapiValue(napi_env env, const HippyValue &value);
static HippyValue NapiValue2HippyValue(napi_env env, napi_value value);
static napi_value HippyValue2NapiValue(napi_env env, const HippyValue &value);
};
2 changes: 1 addition & 1 deletion modules/ohos/oh_napi/src/ark_ts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ bool ArkTS::IsPromise(napi_value value) {
}

void ArkTS::PrintValue(napi_value value) {
napi_valuetype type;
napi_valuetype type;
auto type_status = napi_typeof(env_, value, &type);
this->MaybeThrowFromStatus(type_status, "Failed to get value type");
switch(type) {
Expand Down

0 comments on commit d2f680d

Please sign in to comment.