Skip to content

Commit 206f48e

Browse files
author
openkraken-bot
committed
Committing clang-format changes
1 parent ace4002 commit 206f48e

20 files changed

+144
-152
lines changed

bridge/bindings/qjs/dart_methods.cc

+5-10
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
*/
55

66
#include "dart_methods.h"
7-
#include "foundation/macros.h"
87
#include <memory>
8+
#include "foundation/macros.h"
99

1010
namespace kraken {
1111

12-
//std::shared_ptr<DartMethodPointer> methodPointer = std::make_shared<DartMethodPointer>()
13-
12+
// std::shared_ptr<DartMethodPointer> methodPointer = std::make_shared<DartMethodPointer>()
1413

1514
std::shared_ptr<DartMethodPointer> getDartMethod() {
1615
std::thread::id currentThread = std::this_thread::get_id();
@@ -24,16 +23,12 @@ std::shared_ptr<DartMethodPointer> getDartMethod() {
2423
return std::make_shared<DartMethodPointer>();
2524
}
2625
#endif
27-
// return methodPointer;
26+
// return methodPointer;
2827
}
2928

30-
void registerDartMethods(std::shared_ptr<DartMethodPointer> methodPointer, uint64_t* methodBytes, int32_t length) {
29+
void registerDartMethods(std::shared_ptr<DartMethodPointer> methodPointer, uint64_t* methodBytes, int32_t length) {}
3130

32-
}
33-
34-
void registerTestEnvDartMethods(std::shared_ptr<DartMethodPointer> methodPointer, uint64_t* methodBytes, int32_t length) {
35-
36-
}
31+
void registerTestEnvDartMethods(std::shared_ptr<DartMethodPointer> methodPointer, uint64_t* methodBytes, int32_t length) {}
3732

3833
#if ENABLE_PROFILE
3934
void registerGetPerformanceEntries(GetPerformanceEntries getPerformanceEntries) {

bridge/bindings/qjs/native_string.cc

+1-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
namespace kraken {
1010

11-
1211
NativeString* NativeString::clone() {
1312
auto* newNativeString = new NativeString();
1413
auto* newString = new uint16_t[length];
@@ -45,7 +44,6 @@ std::unique_ptr<NativeString> jsValueToNativeString(JSContext* ctx, JSValue valu
4544
return ptr;
4645
}
4746

48-
4947
std::unique_ptr<NativeString> stringToNativeString(const std::string& string) {
5048
std::u16string utf16;
5149
fromUTF8(string, utf16);
@@ -76,6 +74,4 @@ std::string jsAtomToStdString(JSContext* ctx, JSAtom atom) {
7674
return str;
7775
}
7876

79-
80-
81-
}
77+
} // namespace kraken

bridge/bindings/qjs/native_string.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
#include <quickjs/quickjs.h>
1010
#include <cinttypes>
11-
#include <string>
12-
#include <memory>
13-
#include <locale>
1411
#include <codecvt>
12+
#include <locale>
13+
#include <memory>
14+
#include <string>
1515

1616
namespace kraken {
1717

@@ -54,7 +54,7 @@ void fromUTF8(const std::string& source, std::basic_string<T, std::char_traits<T
5454
result = convertor.from_bytes(source);
5555
}
5656

57-
}
57+
} // namespace kraken
5858

5959
class native_string {};
6060

bridge/core/executing_context.cc

-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ void buildUICommandArgs(JSContext* ctx, JSValue key, NativeString& args_01) {
376376
args_01.length = length;
377377
}
378378

379-
380379
// An lock free context validator.
381380
bool isContextValid(int32_t contextId) {
382381
if (contextId > running_context_list)

bridge/core/executing_context.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
#include <memory>
1717
#include <mutex>
1818
#include <unordered_map>
19-
#include "foundation/macros.h"
19+
#include "bindings/qjs/garbage_collected.h"
2020
#include "executing_context_data.h"
21+
#include "foundation/macros.h"
2122
#include "foundation/ui_command_buffer.h"
22-
#include "bindings/qjs/garbage_collected.h"
2323
//#include "garbage_collected.h"
2424
//#include "qjs_patch.h"
2525
//#include "dart_methods.h"

bridge/core/executing_context_data.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#ifndef KRAKENBRIDGE_CONTEXT_DATA_H
77
#define KRAKENBRIDGE_CONTEXT_DATA_H
88

9-
#include <unordered_map>
109
#include <quickjs/quickjs.h>
10+
#include <unordered_map>
1111
#include "bindings/qjs/wrapper_type_info.h"
1212

1313
namespace kraken {

bridge/core/html/html_all_collection.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
//
66
//#include "html_all_collection.h"
77
//
8-
//namespace kraken {
8+
// namespace kraken {
99
//
10-
//JSValue AllCollection::item(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
10+
// JSValue AllCollection::item(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
1111
// if (argc < 1) {
1212
// return JS_NULL;
1313
// }
@@ -23,7 +23,7 @@
2323
// auto node = collection->m_nodes[index];
2424
// return node->jsObject;
2525
//}
26-
//JSValue AllCollection::add(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
26+
// JSValue AllCollection::add(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
2727
// if (argc < 1) {
2828
// return JS_ThrowTypeError(ctx, "Failed to execute add() on HTMLAllCollection: 1 arguments required.");
2929
// }
@@ -50,7 +50,7 @@
5050
//
5151
// return JS_NULL;
5252
//}
53-
//JSValue AllCollection::remove(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
53+
// JSValue AllCollection::remove(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
5454
// if (argc < 1) {
5555
// return JS_ThrowTypeError(ctx, "Failed to execute remove() on HTMLAllCollection: 1 arguments required.");
5656
// }
@@ -61,7 +61,7 @@
6161
// collection->m_nodes.erase(collection->m_nodes.begin() + index);
6262
// return JS_NULL;
6363
//}
64-
//void AllCollection::internalAdd(NodeInstance* node, NodeInstance* before) {
64+
// void AllCollection::internalAdd(NodeInstance* node, NodeInstance* before) {
6565
// if (before != nullptr) {
6666
// auto it = std::find(m_nodes.begin(), m_nodes.end(), before);
6767
// m_nodes.erase(it);
@@ -71,7 +71,7 @@
7171
// }
7272
//}
7373
//
74-
//IMPL_PROPERTY_GETTER(AllCollection, length)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
74+
// IMPL_PROPERTY_GETTER(AllCollection, length)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
7575
// auto* collection = static_cast<AllCollection*>(JS_GetOpaque(this_val, ExecutionContext::kHostObjectClassId));
7676
// return JS_NewUint32(ctx, collection->m_nodes.size());
7777
//}

bridge/core/html/html_all_collection.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
//
99
//#include "bindings/qjs/garbage_collected.h"
1010
//
11-
//namespace kraken {
11+
// namespace kraken {
1212
//
13-
//class HTMLAllCollection : public HostObject {
13+
// class HTMLAllCollection : public HostObject {
1414
// public:
1515
// AllCollection(ExecutionContext* context) : HostObject(context, "AllCollection"){};
1616
//

bridge/core/html/html_image_element.cc

+16-16
Original file line numberDiff line numberDiff line change
@@ -7,77 +7,77 @@
77
//#include "bindings/qjs/qjs_patch.h"
88
//#include "page.h"
99
//
10-
//namespace kraken {
10+
// namespace kraken {
1111
//
12-
//ImageElement::ImageElement(ExecutionContext* context) : Element(context) {
12+
// ImageElement::ImageElement(ExecutionContext* context) : Element(context) {
1313
// JS_SetPrototype(m_ctx, m_prototypeObject, Element::instance(m_context)->prototype());
1414
//}
1515
//
16-
//void bindImageElement(ExecutionContext* context) {
16+
// void bindImageElement(ExecutionContext* context) {
1717
// auto* constructor = ImageElement::instance(context);
1818
// context->defineGlobalProperty("HTMLImageElement", constructor->jsObject);
1919
// context->defineGlobalProperty("Image", JS_DupValue(context->ctx(), constructor->jsObject));
2020
//}
2121
//
22-
//JSValue ImageElement::instanceConstructor(JSContext* ctx, JSValue func_obj, JSValue this_val, int argc, JSValue* argv) {
22+
// JSValue ImageElement::instanceConstructor(JSContext* ctx, JSValue func_obj, JSValue this_val, int argc, JSValue* argv) {
2323
// auto instance = new ImageElementInstance(this);
2424
// return instance->jsObject;
2525
//}
26-
//IMPL_PROPERTY_GETTER(ImageElement, width)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
26+
// IMPL_PROPERTY_GETTER(ImageElement, width)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
2727
// getDartMethod()->flushUICommand();
2828
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
2929
// return element->getNativeProperty("width");
3030
//}
31-
//IMPL_PROPERTY_SETTER(ImageElement, width)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
31+
// IMPL_PROPERTY_SETTER(ImageElement, width)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
3232
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
3333
// std::string key = "width";
3434
// std::unique_ptr<NativeString> args_01 = stringToNativeString(key);
3535
// std::unique_ptr<NativeString> args_02 = jsValueToNativeString(ctx, argv[0]);
3636
// element->m_context->uiCommandBuffer()->addCommand(element->m_eventTargetId, UICommand::setProperty, *args_01, *args_02, nullptr);
3737
// return JS_NULL;
3838
//}
39-
//IMPL_PROPERTY_GETTER(ImageElement, height)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
39+
// IMPL_PROPERTY_GETTER(ImageElement, height)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
4040
// getDartMethod()->flushUICommand();
4141
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
4242
// return element->getNativeProperty("height");
4343
//}
44-
//IMPL_PROPERTY_SETTER(ImageElement, height)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
44+
// IMPL_PROPERTY_SETTER(ImageElement, height)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
4545
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
4646
// std::string key = "height";
4747
// std::unique_ptr<NativeString> args_01 = stringToNativeString(key);
4848
// std::unique_ptr<NativeString> args_02 = jsValueToNativeString(ctx, argv[0]);
4949
// element->m_context->uiCommandBuffer()->addCommand(element->m_eventTargetId, UICommand::setProperty, *args_01, *args_02, nullptr);
5050
// return JS_NULL;
5151
//}
52-
//IMPL_PROPERTY_GETTER(ImageElement, naturalWidth)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
52+
// IMPL_PROPERTY_GETTER(ImageElement, naturalWidth)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
5353
// getDartMethod()->flushUICommand();
5454
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
5555
// return element->getNativeProperty("naturalWidth");
5656
//}
57-
//IMPL_PROPERTY_GETTER(ImageElement, naturalHeight)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
57+
// IMPL_PROPERTY_GETTER(ImageElement, naturalHeight)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
5858
// getDartMethod()->flushUICommand();
5959
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
6060
// return element->getNativeProperty("naturalHeight");
6161
//}
62-
//IMPL_PROPERTY_GETTER(ImageElement, src)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
62+
// IMPL_PROPERTY_GETTER(ImageElement, src)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
6363
// getDartMethod()->flushUICommand();
6464
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
6565
// return element->getNativeProperty("src");
6666
//}
67-
//IMPL_PROPERTY_SETTER(ImageElement, src)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
67+
// IMPL_PROPERTY_SETTER(ImageElement, src)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
6868
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
6969
// std::string key = "src";
7070
// std::unique_ptr<NativeString> args_01 = stringToNativeString(key);
7171
// std::unique_ptr<NativeString> args_02 = jsValueToNativeString(ctx, argv[0]);
7272
// element->m_context->uiCommandBuffer()->addCommand(element->m_eventTargetId, UICommand::setProperty, *args_01, *args_02, nullptr);
7373
// return JS_NULL;
7474
//}
75-
//IMPL_PROPERTY_GETTER(ImageElement, loading)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
75+
// IMPL_PROPERTY_GETTER(ImageElement, loading)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
7676
// getDartMethod()->flushUICommand();
7777
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
7878
// return element->getNativeProperty("loading");
7979
//}
80-
//IMPL_PROPERTY_SETTER(ImageElement, loading)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
80+
// IMPL_PROPERTY_SETTER(ImageElement, loading)(JSContext* ctx, JSValue this_val, int argc, JSValue* argv) {
8181
// auto* element = static_cast<ImageElementInstance*>(JS_GetOpaque(this_val, Element::classId()));
8282
// std::string key = "loading";
8383
// std::unique_ptr<NativeString> args_01 = stringToNativeString(key);
@@ -86,12 +86,12 @@
8686
// return JS_NULL;
8787
//}
8888
//
89-
//ImageElementInstance::ImageElementInstance(ImageElement* element) : ElementInstance(element, "img", true) {
89+
// ImageElementInstance::ImageElementInstance(ImageElement* element) : ElementInstance(element, "img", true) {
9090
// // Protect image instance util load or error event triggered.
9191
// refer();
9292
//}
9393
//
94-
//bool ImageElementInstance::dispatchEvent(EventInstance* event) {
94+
// bool ImageElementInstance::dispatchEvent(EventInstance* event) {
9595
// std::u16string u16EventType = std::u16string(reinterpret_cast<const char16_t*>(event->nativeEvent->type->string), event->nativeEvent->type->length);
9696
// std::string eventType = toUTF8(u16EventType);
9797
// bool result = EventTargetInstance::dispatchEvent(event);

bridge/core/html/html_image_element.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
//
99
//#include "bindings/qjs/dom/element.h"
1010
//
11-
//namespace kraken {
11+
// namespace kraken {
1212
//
13-
//void bindImageElement(ExecutionContext* context);
13+
// void bindImageElement(ExecutionContext* context);
1414
//
15-
//class ImageElementInstance;
16-
//class ImageElement : public Element {
15+
// class ImageElementInstance;
16+
// class ImageElement : public Element {
1717
// public:
1818
// ImageElement() = delete;
1919
// explicit ImageElement(ExecutionContext* context);
@@ -32,7 +32,7 @@
3232
// friend ImageElementInstance;
3333
//};
3434
//
35-
//class ImageElementInstance : public ElementInstance {
35+
// class ImageElementInstance : public ElementInstance {
3636
// public:
3737
// ImageElementInstance() = delete;
3838
// explicit ImageElementInstance(ImageElement* element);

bridge/foundation/logging.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ constexpr LogSeverity LOG_NUM_SEVERITIES = 5;
3333
constexpr LogSeverity LOG_FATAL = 6;
3434

3535
class LogMessageVoidify {
36-
public:
36+
public:
3737
void operator&(std::ostream&) {}
3838
};
3939

4040
class LogMessage {
41-
public:
41+
public:
4242
LogMessage(LogSeverity severity, const char* file, int line, const char* condition);
4343
~LogMessage();
4444

4545
std::ostream& stream() { return stream_; }
4646

47-
private:
47+
private:
4848
std::ostringstream stream_;
4949
const LogSeverity severity_;
5050
const char* file_;

bridge/foundation/macros.h

-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@
4040
TypeName() = delete; \
4141
KRAKEN_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName)
4242

43-
4443
#endif // KRAKENBRIDGE_MACROS_H

bridge/foundation/native_value.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
*/
55

66
#include "native_value.h"
7+
#include "bindings/qjs/dom/event_target.h"
78
#include "bindings/qjs/executing_context.h"
89
#include "bindings/qjs/qjs_patch.h"
9-
#include "bindings/qjs/dom/event_target.h"
1010

1111
namespace kraken {
1212

@@ -272,4 +272,4 @@ JSValue nativeValueToJSValue(ExecutionContext* context, NativeValue& value) {
272272
return JS_NULL;
273273
}
274274

275-
} // namespace kraken::binding::qjs
275+
} // namespace kraken

bridge/foundation/native_value.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ NativeValue Native_NewJSON(ExecutionContext* context, JSValue& value);
6767
NativeValue jsValueToNativeValue(JSContext* ctx, JSValue& value);
6868
JSValue nativeValueToJSValue(ExecutionContext* context, NativeValue& value);
6969

70-
} // namespace kraken::binding::qjs
70+
} // namespace kraken
7171

7272
#endif // KRAKENBRIDGE_NATIVE_VALUE_H

bridge/foundation/ref_ptr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include <utility>
1414

1515
#include "logging.h"
16-
#include "ref_ptr_internal.h"
1716
#include "macros.h"
17+
#include "ref_ptr_internal.h"
1818

1919
namespace fml {
2020

bridge/foundation/ui_command_buffer.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace kraken {
1111

12-
UICommandBuffer::UICommandBuffer(ExecutionContext *context) : m_context(context) {}
12+
UICommandBuffer::UICommandBuffer(ExecutionContext* context) : m_context(context) {}
1313

1414
void UICommandBuffer::addCommand(int32_t id, int32_t type, void* nativePtr, bool batchedUpdate) {
1515
if (batchedUpdate) {

0 commit comments

Comments
 (0)