Skip to content

Commit 68777ae

Browse files
author
openkraken-bot
committed
Committing clang-format changes
1 parent 5c1dd1b commit 68777ae

18 files changed

+77
-85
lines changed

bridge/bindings/qjs/dart_methods.cc

Lines changed: 5 additions & 10 deletions
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/executing_context.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ void buildUICommandArgs(JSContext* ctx, JSValue key, NativeString& args_01) {
381381
args_01.length = length;
382382
}
383383

384-
385384
// An lock free context validator.
386385
bool isContextValid(int32_t contextId) {
387386
if (contextId > running_context_list)

bridge/bindings/qjs/executing_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
#include <memory>
1717
#include <mutex>
1818
#include <unordered_map>
19-
#include "foundation/macros.h"
2019
#include "bindings/qjs/bom/dom_timer_coordinator.h"
20+
#include "dart_methods.h"
2121
#include "executing_context_data.h"
22+
#include "foundation/macros.h"
2223
#include "foundation/ui_command_buffer.h"
2324
#include "garbage_collected.h"
2425
#include "kraken_foundation.h"
2526
#include "qjs_patch.h"
26-
#include "dart_methods.h"
2727
#include "wrapper_type_info.h"
2828

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

bridge/bindings/qjs/native_string.cc

Lines changed: 1 addition & 5 deletions
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

Lines changed: 4 additions & 4 deletions
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/html/html_all_collection.cc

Lines changed: 6 additions & 6 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 16 additions & 16 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 3 additions & 3 deletions
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_;

0 commit comments

Comments
 (0)