Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
openkraken-bot committed Jan 30, 2022
1 parent d55a199 commit 065ee27
Show file tree
Hide file tree
Showing 33 changed files with 467 additions and 475 deletions.
13 changes: 5 additions & 8 deletions bridge/bindings/qjs/binding_initializer.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* Copyright (C) 2019 Alibaba Inc. All rights reserved.
* Author: Kraken Team.
*/
* Copyright (C) 2019 Alibaba Inc. All rights reserved.
* Author: Kraken Team.
*/

#include "binding_initializer.h"


//#include "bindings/qjs/bom/blob.h"
//#include "bindings/qjs/bom/console.h"
//#include "bindings/qjs/bom/location.h"
Expand Down Expand Up @@ -42,8 +41,6 @@

namespace kraken {

void initBinding() {

}
void initBinding() {}

}
} // namespace kraken
9 changes: 4 additions & 5 deletions bridge/bindings/qjs/binding_initializer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2019 Alibaba Inc. All rights reserved.
* Author: Kraken Team.
*/
* Copyright (C) 2019 Alibaba Inc. All rights reserved.
* Author: Kraken Team.
*/

#ifndef KRAKENBRIDGE_BINDING_INITIALIZER_H
#define KRAKENBRIDGE_BINDING_INITIALIZER_H
Expand All @@ -10,7 +10,6 @@ namespace kraken {

void initBinding();


// bindConsole(m_context);
// bindTimer(m_context);
// bindScreen(m_context);
Expand Down Expand Up @@ -46,6 +45,6 @@ void initBinding();
// bindDocument(m_context);
// bindPerformance(m_context);

}
} // namespace kraken

#endif // KRAKENBRIDGE_BINDING_INITIALIZER_H
5 changes: 1 addition & 4 deletions bridge/bindings/qjs/native_string_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ std::unique_ptr<NativeString> jsValueToNativeString(JSContext* ctx, JSValue valu
return ptr;
}


std::unique_ptr<NativeString> stringToNativeString(const std::string& string) {
std::u16string utf16;
fromUTF8(string, utf16);
Expand Down Expand Up @@ -61,6 +60,4 @@ std::string jsAtomToStdString(JSContext* ctx, JSAtom atom) {
return str;
}



}
} // namespace kraken
8 changes: 4 additions & 4 deletions bridge/bindings/qjs/native_string_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#define KRAKENBRIDGE_NATIVE_STRING_UTILS_H

#include <quickjs/quickjs.h>
#include <string>
#include <memory>
#include <locale>
#include <codecvt>
#include <locale>
#include <memory>
#include <string>

#include "foundation/native_string.h"

Expand Down Expand Up @@ -47,6 +47,6 @@ void fromUTF8(const std::string& source, std::basic_string<T, std::char_traits<T
result = convertor.from_bytes(source);
}

}
} // namespace kraken

#endif // KRAKENBRIDGE_NATIVE_STRING_UTILS_H
2 changes: 1 addition & 1 deletion bridge/core/css/css_style_declaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#ifndef KRAKENBRIDGE_CSS_STYLE_DECLARATION_H
#define KRAKENBRIDGE_CSS_STYLE_DECLARATION_H

#include "bindings/qjs/macros.h"
#include "bindings/qjs/dom/event_target.h"
#include "bindings/qjs/garbage_collected.h"
#include "bindings/qjs/macros.h"

namespace kraken {

Expand Down
2 changes: 1 addition & 1 deletion bridge/core/dom/events/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef KRAKENBRIDGE_EVENT_H
#define KRAKENBRIDGE_EVENT_H

#include "bindings/qjs/macros.h"
#include "bindings/qjs/executing_context.h"
#include "bindings/qjs/macros.h"

namespace kraken {

Expand Down
6 changes: 3 additions & 3 deletions bridge/core/dom/events/event_target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

#include <utility>

#include "event_target.h"
#include "bindings/qjs/qjs_patch.h"
#include "custom_event.h"
#include "event.h"
#include "core/dom/node.h"
#include "core/frame/window.h"
#include "custom_event.h"
#include "event.h"
#include "event_target.h"

#if UNIT_TEST
#include "kraken_test_env.h"
Expand Down
4 changes: 2 additions & 2 deletions bridge/core/dom/events/event_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#ifndef KRAKENBRIDGE_EVENT_TARGET_H
#define KRAKENBRIDGE_EVENT_TARGET_H

#include "foundation/macros.h"
#include "bindings/qjs/macros.h"
#include "bindings/qjs/heap_hashmap.h"
#include "bindings/qjs/macros.h"
#include "core/executing_context.h"
#include "event_listener_map.h"
#include "foundation/macros.h"

#if UNIT_TEST
void TEST_callNativeMethod(void* nativePtr, void* returnValue, void* method, int32_t argc, void* argv);
Expand Down
53 changes: 26 additions & 27 deletions bridge/core/executing_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,32 @@ ExecutionContext::~ExecutionContext() {
ctxInvalid_ = true;

// Manual free nodes bound by each other.
// {
// struct list_head *el, *el1;
// list_for_each_safe(el, el1, &node_job_list) {
// auto* node = list_entry(el, NodeJob, link);
// JS_FreeValue(m_ctx, node->nodeInstance->jsObject);
// }
// }
//
// // Manual free moduleListener
// {
// struct list_head *el, *el1;
// list_for_each_safe(el, el1, &module_job_list) {
// auto* module = list_entry(el, ModuleContext, link);
// JS_FreeValue(m_ctx, module->callback);
// delete module;
// }
// }
//
// {
// struct list_head *el, *el1;
// list_for_each_safe(el, el1, &module_callback_job_list) {
// auto* module = list_entry(el, ModuleContext, link);
// JS_FreeValue(m_ctx, module->callback);
// delete module;
// }
// }
// {
// struct list_head *el, *el1;
// list_for_each_safe(el, el1, &node_job_list) {
// auto* node = list_entry(el, NodeJob, link);
// JS_FreeValue(m_ctx, node->nodeInstance->jsObject);
// }
// }
//
// // Manual free moduleListener
// {
// struct list_head *el, *el1;
// list_for_each_safe(el, el1, &module_job_list) {
// auto* module = list_entry(el, ModuleContext, link);
// JS_FreeValue(m_ctx, module->callback);
// delete module;
// }
// }
//
// {
// struct list_head *el, *el1;
// list_for_each_safe(el, el1, &module_callback_job_list) {
// auto* module = list_entry(el, ModuleContext, link);
// JS_FreeValue(m_ctx, module->callback);
// delete module;
// }
// }

// Free unresolved promise.
{
Expand Down Expand Up @@ -369,7 +369,6 @@ void buildUICommandArgs(JSContext* ctx, JSValue key, NativeString& args_01) {
args_01.length = length;
}


// An lock free context validator.
bool isContextValid(int32_t contextId) {
if (contextId > running_context_list)
Expand Down
4 changes: 2 additions & 2 deletions bridge/core/executing_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
#include <memory>
#include <mutex>
#include <unordered_map>
#include "bindings/qjs/garbage_collected.h"
#include "foundation/macros.h"
#include "foundation/ui_command_buffer.h"
#include "bindings/qjs/garbage_collected.h"

#include "dart_methods.h"
#include "executing_context_data.h"
#include "frame/dom_timer_coordinator.h"
#include "dart_methods.h"

using JSExceptionHandler = std::function<void(int32_t contextId, const char* message)>;

Expand Down
2 changes: 1 addition & 1 deletion bridge/core/executing_context_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef KRAKENBRIDGE_CONTEXT_DATA_H
#define KRAKENBRIDGE_CONTEXT_DATA_H

#include <unordered_map>
#include <quickjs/quickjs.h>
#include <unordered_map>
#include "bindings/qjs/wrapper_type_info.h"

namespace kraken {
Expand Down
2 changes: 1 addition & 1 deletion bridge/core/fileapi/blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef KRAKENBRIDGE_BLOB_H
#define KRAKENBRIDGE_BLOB_H

#include "bindings/qjs/macros.h"
#include "bindings/qjs/garbage_collected.h"
#include "bindings/qjs/macros.h"

namespace kraken {

Expand Down
12 changes: 6 additions & 6 deletions bridge/core/html/html_all_collection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
//
//#include "html_all_collection.h"
//
//namespace kraken {
// namespace kraken {
//
//JSValue AllCollection::item(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
// JSValue AllCollection::item(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
// if (argc < 1) {
// return JS_NULL;
// }
Expand All @@ -23,7 +23,7 @@
// auto node = collection->m_nodes[index];
// return node->jsObject;
//}
//JSValue AllCollection::add(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
// JSValue AllCollection::add(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
// if (argc < 1) {
// return JS_ThrowTypeError(ctx, "Failed to execute add() on HTMLAllCollection: 1 arguments required.");
// }
Expand All @@ -50,7 +50,7 @@
//
// return JS_NULL;
//}
//JSValue AllCollection::remove(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
// JSValue AllCollection::remove(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
// if (argc < 1) {
// return JS_ThrowTypeError(ctx, "Failed to execute remove() on HTMLAllCollection: 1 arguments required.");
// }
Expand All @@ -61,7 +61,7 @@
// collection->m_nodes.erase(collection->m_nodes.begin() + index);
// return JS_NULL;
//}
//void AllCollection::internalAdd(NodeInstance* node, NodeInstance* before) {
// void AllCollection::internalAdd(NodeInstance* node, NodeInstance* before) {
// if (before != nullptr) {
// auto it = std::find(m_nodes.begin(), m_nodes.end(), before);
// m_nodes.erase(it);
Expand All @@ -71,7 +71,7 @@
// }
//}
//
//IMPL_PROPERTY_GETTER(AllCollection, length)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
// IMPL_PROPERTY_GETTER(AllCollection, length)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
// auto* collection = static_cast<AllCollection*>(JS_GetOpaque(this_val, ExecutionContext::kHostObjectClassId));
// return JS_NewUint32(ctx, collection->m_nodes.size());
//}
Expand Down
4 changes: 2 additions & 2 deletions bridge/core/html/html_all_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
//
//#include "bindings/qjs/garbage_collected.h"
//
//namespace kraken {
// namespace kraken {
//
//class HTMLAllCollection : public HostObject {
// class HTMLAllCollection : public HostObject {
// public:
// AllCollection(ExecutionContext* context) : HostObject(context, "AllCollection"){};
//
Expand Down
Loading

0 comments on commit 065ee27

Please sign in to comment.