-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add native function callback support for toBlob
- Loading branch information
Showing
7 changed files
with
234 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
/* | ||
* Copyright (C) 2022-present The WebF authors. All rights reserved. | ||
*/ | ||
|
||
#include "plugin_api/element.h" | ||
#include "core/dom/container_node.h" | ||
|
||
namespace webf {} // namespace webf | ||
/* | ||
* Copyright (C) 2022-present The WebF authors. All rights reserved. | ||
*/ | ||
|
||
#include "plugin_api/element.h" | ||
#include "core/api/exception_state.h" | ||
#include "core/dom/container_node.h" | ||
#include "core/dom/element.h" | ||
|
||
namespace webf { | ||
|
||
void ElementPublicMethods::ToBlob(Element* ptr, | ||
WebFNativeFunctionContext* callback_context, | ||
SharedExceptionState* shared_exception_state) { | ||
auto* element = static_cast<webf::Element*>(ptr); | ||
auto callback_impl = WebFNativeFunction::Create(callback_context, shared_exception_state); | ||
return element->toBlob(callback_impl, shared_exception_state->exception_state); | ||
} | ||
|
||
void ElementPublicMethods::ToBlobWithDevicePixelRatio(Element* ptr, | ||
double device_pixel_ratio, | ||
WebFNativeFunctionContext* callback_context, | ||
SharedExceptionState* shared_exception_state) { | ||
auto* element = static_cast<webf::Element*>(ptr); | ||
auto callback_impl = WebFNativeFunction::Create(callback_context, shared_exception_state); | ||
return element->toBlob(device_pixel_ratio, callback_impl, shared_exception_state->exception_state); | ||
} | ||
|
||
} // namespace webf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.