修复client编译错误

Signed-off-by: lu <zhaolu2@huawei.com>
Change-Id: I6b8b88127ad1a5669f4fede64d6c073070f5a09c
This commit is contained in:
lu 2022-04-01 18:08:25 +08:00 committed by dubj
parent 5477b13de7
commit 891bbcd86a
3 changed files with 2146 additions and 15 deletions

View File

@ -26,14 +26,15 @@
namespace OHOS {
namespace Rosen {
class JsWindowExtensionContext : public AbilityRuntime::AbilityConnectCallback {
class JsWindowExtensionContext;
class JsAbilityConnectCallback : public AbilityRuntime::AbilityConnectCallback {
public:
explicit JsWindowExtensionContext(const std::shared_ptr<JsWindowExtensionContext>& context);
~JsWindowExtensionContext() = default;
static void Finalizer(NativeEngine* engine, void* data, void* hint);
void OnWindowCreate(sptr<Window> window);
private:
std::shared_ptr<JsWindowExtensionContext> context_;
explicit JsAbilityConnectCallback() = default;
~JsAbilityConnectCallback() = default;
// void OnWindowCreate(sptr<Window> window); //TODO
virtual void OnAbilityConnectDone(const AppExecFwk::ElementName &element,
const sptr<IRemoteObject> &remoteObject, int resultCode) override;
virtual void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override;
};
NativeValue* CreateJsWindowExtensionContext(NativeEngine& engine,

View File

@ -28,22 +28,38 @@ namespace {
std::shared_ptr<AppExecFwk::EventHandler> handler_;
}
JsWindowExtensionContext::JsWindowExtensionContext(const std::shared_ptr<JsWindowExtensionContext>& context)
: context_(context) {}
class JsWindowExtensionContext final {
public:
explicit JsWindowExtensionContext(
const std::shared_ptr<WindowExtensionContext>& context) : context_(context) {}
~JsWindowExtensionContext() = default;
void JsWindowExtensionContext::Finalizer(NativeEngine* engine, void* data, void* hint)
static void Finalizer(NativeEngine* engine, void* data, void* hint)
{
WLOGI("JsWindowExtensionContext::Finalizer is called");
std::unique_ptr<JsWindowExtensionContext>(static_cast<JsWindowExtensionContext*>(data));
}
private:
std::shared_ptr<WindowExtensionContext> context_;
};
// void JsAbilityConnectCallback::OnWindowCreate(sptr<Window> window)
// {
// // call js api
// }
void JsAbilityConnectCallback::OnAbilityConnectDone(const AppExecFwk::ElementName &element,
const sptr<IRemoteObject> &remoteObject, int resultCode)
{
WLOGFI("Finalizer is called");
std::unique_ptr<JsWindowExtensionContext>(static_cast<JsWindowExtensionContext*>(data));
}
void JsWindowExtensionContext::OnWindowCreate(sptr<Window> window)
void JsAbilityConnectCallback::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode)
{
// call js api
}
NativeValue* CreateJsWindowExtensionContext(NativeEngine& engine,
std::shared_ptr<AbilityRuntime::ServiceExtensionContext> context)
std::shared_ptr<WindowExtensionContext> context)
{
WLOGFI("CreateJsWindowExtensionContext begin");
NativeValue* objValue = CreateJsExtensionContext(engine, context); // TODO CreateJsBaseContext?

2114
q Normal file

File diff suppressed because it is too large Load Diff