Skip to content

Commit

Permalink
Commit from GitHub Actions (Run Code Linter)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 2, 2024
1 parent eb93069 commit e9de1b6
Show file tree
Hide file tree
Showing 20 changed files with 156 additions and 153 deletions.
2 changes: 1 addition & 1 deletion bridge/bindings/qjs/binding_initializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "qjs_bounding_client_rect.h"
#include "qjs_canvas_gradient.h"
#include "qjs_canvas_pattern.h"
#include "qjs_path_2d.h"
#include "qjs_canvas_rendering_context.h"
#include "qjs_canvas_rendering_context_2d.h"
#include "qjs_character_data.h"
Expand Down Expand Up @@ -72,6 +71,7 @@
#include "qjs_native_loader.h"
#include "qjs_node.h"
#include "qjs_node_list.h"
#include "qjs_path_2d.h"
#include "qjs_performance.h"
#include "qjs_performance_entry.h"
#include "qjs_performance_mark.h"
Expand Down
48 changes: 27 additions & 21 deletions bridge/core/api/executing_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include "core/api/exception_state.h"
#include "core/dom/document.h"
#include "core/executing_context.h"
#include "core/frame/module_manager.h"
#include "core/frame/window.h"
#include "core/frame/window_or_worker_global_scope.h"
#include "core/frame/module_manager.h"
#include "foundation/native_value_converter.h"

namespace webf {
Expand Down Expand Up @@ -41,7 +41,8 @@ NativeValue ExecutingContextWebFMethods::WebFInvokeModule(ExecutingContext* cont
AtomicString module_name_atomic = AtomicString(context->ctx(), module_name);
AtomicString method_atomic = webf::AtomicString(context->ctx(), method);

ScriptValue result = ModuleManager::__webf_invoke_module__(context, module_name_atomic, method_atomic, shared_exception_state->exception_state);
ScriptValue result = ModuleManager::__webf_invoke_module__(context, module_name_atomic, method_atomic,
shared_exception_state->exception_state);
NativeValue return_result = result.ToNative(context->ctx(), shared_exception_state->exception_state);

if (shared_exception_state->exception_state.HasException()) {
Expand All @@ -52,14 +53,15 @@ NativeValue ExecutingContextWebFMethods::WebFInvokeModule(ExecutingContext* cont
}

NativeValue ExecutingContextWebFMethods::WebFInvokeModuleWithParams(ExecutingContext* context,
const char* module_name,
const char* method,
NativeValue* params,
SharedExceptionState* shared_exception_state) {
const char* module_name,
const char* method,
NativeValue* params,
SharedExceptionState* shared_exception_state) {
AtomicString module_name_atomic = AtomicString(context->ctx(), module_name);
AtomicString method_atomic = webf::AtomicString(context->ctx(), method);

const NativeValue* result = ModuleManager::__webf_invoke_module__(context, module_name_atomic, method_atomic, *params, nullptr, shared_exception_state->exception_state);
const NativeValue* result = ModuleManager::__webf_invoke_module__(context, module_name_atomic, method_atomic, *params,
nullptr, shared_exception_state->exception_state);

if (shared_exception_state->exception_state.HasException()) {
return Native_NewNull();
Expand All @@ -69,18 +71,20 @@ NativeValue ExecutingContextWebFMethods::WebFInvokeModuleWithParams(ExecutingCon
return return_result;
}

NativeValue ExecutingContextWebFMethods::WebFInvokeModuleWithParamsAndCallback(ExecutingContext* context,
const char* module_name,
const char* method,
NativeValue* params,
WebFNativeFunctionContext* callback_context,
SharedExceptionState* shared_exception_state) {
NativeValue ExecutingContextWebFMethods::WebFInvokeModuleWithParamsAndCallback(
ExecutingContext* context,
const char* module_name,
const char* method,
NativeValue* params,
WebFNativeFunctionContext* callback_context,
SharedExceptionState* shared_exception_state) {
AtomicString module_name_atomic = AtomicString(context->ctx(), module_name);
AtomicString method_atomic = webf::AtomicString(context->ctx(), method);

auto callback_impl = WebFNativeFunction::Create(callback_context, shared_exception_state);

const NativeValue* result = ModuleManager::__webf_invoke_module__(context, module_name_atomic, method_atomic, *params, callback_impl, shared_exception_state->exception_state);
const NativeValue* result = ModuleManager::__webf_invoke_module__(
context, module_name_atomic, method_atomic, *params, callback_impl, shared_exception_state->exception_state);

if (shared_exception_state->exception_state.HasException()) {
return Native_NewNull();
Expand All @@ -101,22 +105,24 @@ int32_t ExecutingContextWebFMethods::SetTimeout(ExecutingContext* context,
}

int32_t ExecutingContextWebFMethods::SetInterval(ExecutingContext* context,
WebFNativeFunctionContext* callback_context,
int32_t timeout,
SharedExceptionState* shared_exception_state) {
WebFNativeFunctionContext* callback_context,
int32_t timeout,
SharedExceptionState* shared_exception_state) {
auto callback_impl = WebFNativeFunction::Create(callback_context, shared_exception_state);

return WindowOrWorkerGlobalScope::setInterval(context, callback_impl, timeout,
shared_exception_state->exception_state);
}

void ExecutingContextWebFMethods::ClearTimeout(ExecutingContext* context, int32_t timeout_id,
SharedExceptionState* shared_exception_state) {
void ExecutingContextWebFMethods::ClearTimeout(ExecutingContext* context,
int32_t timeout_id,
SharedExceptionState* shared_exception_state) {
WindowOrWorkerGlobalScope::clearTimeout(context, timeout_id, shared_exception_state->exception_state);
}

void ExecutingContextWebFMethods::ClearInterval(ExecutingContext* context, int32_t interval_id,
SharedExceptionState* shared_exception_state) {
void ExecutingContextWebFMethods::ClearInterval(ExecutingContext* context,
int32_t interval_id,
SharedExceptionState* shared_exception_state) {
WindowOrWorkerGlobalScope::clearInterval(context, interval_id, shared_exception_state->exception_state);
}

Expand Down
2 changes: 1 addition & 1 deletion bridge/core/binding_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ enum BindingMethodCallOperations {
kAsyncAnonymousFunction,
};

enum CreateBindingObjectType {
enum CreateBindingObjectType {
kCreateDOMMatrix = 0,
kCreatePath2D = 1,
kCreateDOMPoint = 2,
Expand Down
5 changes: 3 additions & 2 deletions bridge/core/dom/element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,9 @@ ScriptValue Element::___testGlobalToLocal__(double x, double y, webf::ExceptionS
NativeValueConverter<NativeTypeDouble>::ToNativeValue(y),
};

NativeValue result = InvokeBindingMethod(binding_call_methods::k__test_global_to_local__, 2, args,
FlushUICommandReason::kDependentsOnElement | FlushUICommandReason::kDependentsOnLayout, exception_state);
NativeValue result = InvokeBindingMethod(
binding_call_methods::k__test_global_to_local__, 2, args,
FlushUICommandReason::kDependentsOnElement | FlushUICommandReason::kDependentsOnLayout, exception_state);

return ScriptValue(ctx(), result);
}
Expand Down
4 changes: 3 additions & 1 deletion bridge/core/executing_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,9 @@ void ExecutingContext::FlushUICommand(const webf::BindingObject* self,
}
}

bool ExecutingContext::SyncUICommandBuffer(const BindingObject* self, uint32_t reason, std::vector<NativeBindingObject*>& deps) {
bool ExecutingContext::SyncUICommandBuffer(const BindingObject* self,
uint32_t reason,
std::vector<NativeBindingObject*>& deps) {
if (!uiCommandBuffer()->empty()) {
if (is_dedicated_) {
bool should_swap_ui_commands = false;
Expand Down
11 changes: 5 additions & 6 deletions bridge/core/frame/module_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ NativeValue* handleInvokeModuleTransientCallback(void* ptr,
callback->Invoke(context, 2, params);
}
}

}

static void ReturnResultToDart(Dart_PersistentHandle persistent_handle,
Expand Down Expand Up @@ -163,11 +162,11 @@ ScriptValue ModuleManager::__webf_invoke_module__(ExecutingContext* context,
return return_value;
}
NativeValue* ModuleManager::__webf_invoke_module__(ExecutingContext* context,
const AtomicString& module_name,
const AtomicString& method,
NativeValue& params,
const std::shared_ptr<Function>& callback,
ExceptionState& exception) {
const AtomicString& module_name,
const AtomicString& method,
NativeValue& params,
const std::shared_ptr<Function>& callback,
ExceptionState& exception) {
if (exception.HasException()) {
return nullptr;
}
Expand Down
9 changes: 4 additions & 5 deletions bridge/core/geometry/dom_matrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ DOMMatrix* DOMMatrix::Create(webf::ExecutingContext* context, webf::ExceptionSta
return MakeGarbageCollected<DOMMatrix>(context, exception_state);
}

DOMMatrix::DOMMatrix(webf::ExecutingContext* context, webf::ExceptionState& exception_state):
DOMMatrixReadOnly(context, exception_state) {}
DOMMatrix::DOMMatrix(webf::ExecutingContext* context, webf::ExceptionState& exception_state)
: DOMMatrixReadOnly(context, exception_state) {}

DOMMatrix::DOMMatrix(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
ExceptionState& exception_state)
: DOMMatrixReadOnly(context, init, exception_state) {}

DOMMatrix::DOMMatrix(webf::ExecutingContext* context, webf::NativeBindingObject* native_binding_object): DOMMatrixReadOnly(context, native_binding_object) {

}
DOMMatrix::DOMMatrix(webf::ExecutingContext* context, webf::NativeBindingObject* native_binding_object)
: DOMMatrixReadOnly(context, native_binding_object) {}

} // namespace webf
12 changes: 4 additions & 8 deletions bridge/core/geometry/dom_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@ class DOMMatrix : public DOMMatrixReadOnly {
static DOMMatrix* Create(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
ExceptionState& exception_state);
static DOMMatrix* Create(ExecutingContext* context,
ExceptionState& exception_state);
static DOMMatrix* Create(ExecutingContext* context, ExceptionState& exception_state);

DOMMatrix() = delete;
explicit DOMMatrix(ExecutingContext* context,
ExceptionState& exception_state);
explicit DOMMatrix(ExecutingContext* context, ExceptionState& exception_state);
explicit DOMMatrix(ExecutingContext* context,
const std::shared_ptr<QJSUnionSequenceDoubleDOMMatrixInit>& init,
ExceptionState& exception_state);
explicit DOMMatrix(ExecutingContext* context,
NativeBindingObject* native_binding_object);
explicit DOMMatrix(ExecutingContext* context, NativeBindingObject* native_binding_object);

[[nodiscard]]
bool IsDOMMatrix() const override { return true; }
[[nodiscard]] bool IsDOMMatrix() const override { return true; }

private:
};
Expand Down
Loading

0 comments on commit e9de1b6

Please sign in to comment.