Skip to content

Commit 94d4bfe

Browse files
author
openkraken-bot
committed
Committing clang-format changes
1 parent c14831b commit 94d4bfe

14 files changed

+48
-56
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/executing_context.cc

-1
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

+2-2
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

+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/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
@@ -66,6 +66,6 @@ NativeValue Native_NewJSON(ExecutionContext* context, JSValue& value);
6666
NativeValue jsValueToNativeValue(JSContext* ctx, JSValue& value);
6767
JSValue nativeValueToJSValue(ExecutionContext* context, NativeValue& value);
6868

69-
} // namespace kraken::binding::qjs
69+
} // namespace kraken
7070

7171
#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.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
#ifndef KRAKENBRIDGE_FOUNDATION_UI_COMMAND_BUFFER_H_
77
#define KRAKENBRIDGE_FOUNDATION_UI_COMMAND_BUFFER_H_
88

9-
#include <vector>
109
#include <cinttypes>
11-
#include "native_value.h"
10+
#include <vector>
1211
#include "bindings/qjs/native_string.h"
12+
#include "native_value.h"
1313

1414
namespace kraken {
1515

@@ -31,15 +31,15 @@ enum UICommand {
3131

3232
struct UICommandItem {
3333
UICommandItem(int32_t id, int32_t type, NativeString args_01, NativeString args_02, void* nativePtr)
34-
: type(type),
35-
string_01(reinterpret_cast<int64_t>(args_01.string)),
36-
args_01_length(args_01.length),
37-
string_02(reinterpret_cast<int64_t>(args_02.string)),
38-
args_02_length(args_02.length),
39-
id(id),
40-
nativePtr(reinterpret_cast<int64_t>(nativePtr)){};
34+
: type(type),
35+
string_01(reinterpret_cast<int64_t>(args_01.string)),
36+
args_01_length(args_01.length),
37+
string_02(reinterpret_cast<int64_t>(args_02.string)),
38+
args_02_length(args_02.length),
39+
id(id),
40+
nativePtr(reinterpret_cast<int64_t>(nativePtr)){};
4141
UICommandItem(int32_t id, int32_t type, NativeString args_01, void* nativePtr)
42-
: type(type), string_01(reinterpret_cast<int64_t>(args_01.string)), args_01_length(args_01.length), id(id), nativePtr(reinterpret_cast<int64_t>(nativePtr)){};
42+
: type(type), string_01(reinterpret_cast<int64_t>(args_01.string)), args_01_length(args_01.length), id(id), nativePtr(reinterpret_cast<int64_t>(nativePtr)){};
4343
UICommandItem(int32_t id, int32_t type, void* nativePtr) : type(type), id(id), nativePtr(reinterpret_cast<int64_t>(nativePtr)){};
4444
int32_t type;
4545
int32_t id;

bridge/kraken_bridge.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
*/
55

66
#include <atomic>
7-
#include <thread>
87
#include <cassert>
8+
#include <thread>
99

10-
#include "include/kraken_bridge.h"
10+
#include "bindings/qjs/native_string.h"
1111
#include "foundation/inspector_task_queue.h"
1212
#include "foundation/logging.h"
13-
#include "foundation/ui_task_queue.h"
1413
#include "foundation/ui_command_buffer.h"
15-
#include "bindings/qjs/native_string.h"
14+
#include "foundation/ui_task_queue.h"
15+
#include "include/kraken_bridge.h"
1616
#include "page.h"
1717

1818
#if defined(_WIN32)
@@ -162,9 +162,9 @@ void registerDartMethods(int32_t contextId, uint64_t* methodBytes, int32_t lengt
162162
}
163163

164164
NativeScreen* createScreen(double width, double height) {
165-
// screen.width = width;
166-
// screen.height = height;
167-
// return &screen;
165+
// screen.width = width;
166+
// screen.height = height;
167+
// return &screen;
168168
}
169169

170170
static KrakenInfo* krakenInfo{nullptr};

bridge/page.cc

+11-8
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
#include <atomic>
77

8-
#include "foundation/logging.h"
9-
#include "polyfill.h"
108
#include "bindings/qjs/qjs_patch.h"
9+
#include "foundation/logging.h"
1110
#include "page.h"
11+
#include "polyfill.h"
1212

1313
#include "bindings/qjs/bom/blob.h"
1414
#include "bindings/qjs/bom/console.h"
@@ -57,12 +57,15 @@ KrakenPage::KrakenPage(int32_t contextId, const JSExceptionHandler& handler) : c
5757
#if ENABLE_PROFILE
5858
auto jsContextStartTime = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
5959
#endif
60-
m_context = new ExecutionContext(contextId, [this](int32_t contextId, const char* message) {
61-
if (m_context->dartMethodPtr()->onJsError != nullptr) {
62-
m_context->dartMethodPtr()->onJsError(contextId, message);
63-
}
64-
KRAKEN_LOG(ERROR) << message << std::endl;
65-
}, this);
60+
m_context = new ExecutionContext(
61+
contextId,
62+
[this](int32_t contextId, const char* message) {
63+
if (m_context->dartMethodPtr()->onJsError != nullptr) {
64+
m_context->dartMethodPtr()->onJsError(contextId, message);
65+
}
66+
KRAKEN_LOG(ERROR) << message << std::endl;
67+
},
68+
this);
6669

6770
#if ENABLE_PROFILE
6871
auto nativePerformance = Performance::instance(m_context)->m_nativePerformance;

bridge/page.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <quickjs/quickjs.h>
1010
#include <atomic>
1111
#include <deque>
12-
#include <vector>
1312
#include <thread>
13+
#include <vector>
1414

1515
#include "bindings/qjs/executing_context.h"
1616
#include "bindings/qjs/html_parser.h"

0 commit comments

Comments
 (0)