Skip to content

Commit 8784e81

Browse files
authored
refactor(client): add root namespace 'endor' and fix android build (#397)
1 parent 3f4dab1 commit 8784e81

File tree

703 files changed

+78536
-76481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

703 files changed

+78536
-76481
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup clang-format
2626
uses: aminya/setup-cpp@v1
2727
with:
28-
clangformat: 20
28+
clangformat: 16
2929

3030
- name: Install dependencies
3131
run: npm ci

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
"span": "cpp",
100100
"execution": "cpp",
101101
"cassert": "cpp",
102-
"print": "cpp"
102+
"print": "cpp",
103+
"version": "cpp"
103104
},
104105
"cmake.buildDirectory": "${workspaceFolder}/build/targets/darwin",
105106
"C_Cpp.default.cppStandard": "c++17",

src/bindings/dom/browsing_context.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "./browsing_context.hpp"
33

44
using namespace std;
5+
using namespace endor;
56

67
namespace dombinding
78
{
@@ -23,7 +24,7 @@ namespace dombinding
2324

2425
BrowsingContext::BrowsingContext(const Napi::CallbackInfo &info)
2526
: RuntimeContextBase<BrowsingContext, dom::BrowsingContext>(info)
26-
, client_context_(TrClientContextPerProcess::Get())
27+
, client_context_(endor::TrClientContextPerProcess::Get())
2728
{
2829
assert(this->contextImpl != nullptr && "contextImpl should not be null");
2930
client_context_->browsingContext = this->contextImpl;

src/bindings/dom/browsing_context.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace dombinding
1010
{
11-
class BrowsingContext : public RuntimeContextBase<BrowsingContext, dom::BrowsingContext>
11+
class BrowsingContext : public RuntimeContextBase<BrowsingContext, endor::dom::BrowsingContext>
1212
{
1313
public:
1414
static void Init(Napi::Env env, Napi::Object exports);
@@ -20,7 +20,7 @@ namespace dombinding
2020
Napi::Value Start(const Napi::CallbackInfo &info);
2121

2222
private:
23-
TrClientContextPerProcess *client_context_;
23+
endor::TrClientContextPerProcess *client_context_;
2424
static thread_local Napi::FunctionReference *constructor;
2525
};
2626
}

src/bindings/dom/worker_context.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "./worker_context.hpp"
33

44
using namespace std;
5+
using namespace endor;
56

67
namespace dombinding
78
{

src/bindings/dom/worker_context.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace dombinding
99
{
10-
class WorkerContext : public RuntimeContextBase<WorkerContext, dom::WorkerContext>
10+
class WorkerContext : public RuntimeContextBase<WorkerContext, endor::dom::WorkerContext>
1111
{
1212
public:
1313
static void Init(Napi::Env env, Napi::Object exports);

src/bindings/env/client_context.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include "client_context.hpp"
22
#include "common/xr/types.hpp"
33

4+
using namespace std;
5+
using namespace endor;
6+
47
namespace bindings
58
{
69
thread_local Napi::FunctionReference *ClientContext::constructor;

src/bindings/env/client_context.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <napi.h>
4-
#include "client/per_process.hpp"
4+
#include <client/per_process.hpp>
55

66
using namespace std;
77

@@ -18,7 +18,7 @@ namespace bindings
1818
Napi::Value FastPerformanceNow(const Napi::CallbackInfo &info);
1919

2020
private:
21-
TrClientContextPerProcess *clientContext = nullptr;
21+
endor::TrClientContextPerProcess *clientContext = nullptr;
2222

2323
private:
2424
static thread_local Napi::FunctionReference *constructor;

src/bindings/messaging/event_target.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "./event_target.hpp"
22

3+
using namespace endor;
4+
35
namespace bindings
46
{
57
namespace messaging
@@ -45,7 +47,7 @@ namespace bindings
4547
Napi::Env env = info.Env();
4648
Napi::HandleScope scope(env);
4749

48-
clientContext = TrClientContextPerProcess::Get();
50+
clientContext = endor::TrClientContextPerProcess::Get();
4951
if (clientContext == nullptr)
5052
{
5153
Napi::Error::New(env, "The client context is not initialized.").ThrowAsJavaScriptException();

src/bindings/messaging/event_target.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace bindings
2121
Napi::Value DispatchEvent(const Napi::CallbackInfo &info);
2222

2323
private:
24-
TrClientContextPerProcess *clientContext;
24+
endor::TrClientContextPerProcess *clientContext;
2525
Napi::ThreadSafeFunction eventListener;
2626
thread eventRecvThread;
2727
bool recvingEvents = false;

0 commit comments

Comments
 (0)