mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Sync v3.4 to develop (#270)
* [ci] compile ios verbose (#3978) * [v3.4.0] [ci] compile ios verbose (#3974 * Merge the code of v3.3.1 platform adaptation layer into the development branch (#3958) * 1、Merge platform adaptation layer code into the development branch 2、It passed the test in windows and ohos system * 1、Merge platform adaptation layer code into the development branch 2、It passed the test in windows and ohos system * 1、Fix github compile windows error * 1、Fix github compile windows error * 1. Adjust the code format; 2. Fix js automatic generation binding 3. Adjust github CI compilation * 1. Adjust the code format; 2. Fix js automatic generation binding 3. Adjust github CI compilation * Solve mac and ios compilation failure * Fix the problem of compilation of Windows-side simulator * 1. Adapt the simulator to a new adaptation layer; 2. Fix the compilation warning of ios, and the implicit conversion failed; 3. Fix the mac compilation error, due to the problem of adding the link identification -all_load; * 1.Add the isDisplayStats and setDisplayStats method to the screen interface * Fix clang-tidy compilation warning * Fix clang-tidy compilation warning * Repair the emulator, compatible with mac and win * 1、Repair detailed errors, including name modification and calling method modification 2、Delete redundant files in the template directory 3、Change the vibrate interface to vibrator 4、Fix word spelling errors * Rename interfaces to modules * Replace CC_ASSERT with CCASSERT * Replace CC_ASSERT with CCASSERT Co-authored-by: qiuguohua <> * Remove all_flag in IOS (#4014) * gfx: onAcquire callback (#4038) * Solve the conflict between cocos/platform and template Co-authored-by: minggo <nudtzxm@gmail.com> Co-authored-by: 江战 <40414978+PatriceJiang@users.noreply.github.com> Co-authored-by: Yun Hsiao Wu <yunhsiaow@gmail.com>
This commit is contained in:
@@ -32,8 +32,7 @@
|
||||
#include <cstdio>
|
||||
#include <queue>
|
||||
#include <sstream>
|
||||
|
||||
#include "platform/Application.h"
|
||||
#include "application/ApplicationManager.h"
|
||||
#include "platform/FileUtils.h"
|
||||
#include "platform/java/jni/JniHelper.h"
|
||||
|
||||
@@ -95,7 +94,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void setRequestMethod(const char *method) {
|
||||
void setRequestMethod(const char *method) { // NOLINT
|
||||
_requestmethod = method;
|
||||
|
||||
JniMethodInfo methodInfo;
|
||||
@@ -139,7 +138,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
int connect() {
|
||||
int connect() { // NOLINT
|
||||
int suc = 0;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
@@ -156,7 +155,7 @@ public:
|
||||
return suc;
|
||||
}
|
||||
|
||||
void disconnect() {
|
||||
void disconnect() { // NOLINT
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
JCLS_HTTPCLIENT,
|
||||
@@ -170,7 +169,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
int getResponseCode() {
|
||||
int getResponseCode() { // NOLINT
|
||||
int responseCode = 0;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
@@ -187,7 +186,7 @@ public:
|
||||
return responseCode;
|
||||
}
|
||||
|
||||
char *getResponseMessage() {
|
||||
char *getResponseMessage() { // NOLINT
|
||||
char * message = nullptr;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
@@ -208,7 +207,7 @@ public:
|
||||
return message;
|
||||
}
|
||||
|
||||
void sendRequest(HttpRequest *request) {
|
||||
void sendRequest(HttpRequest *request) { // NOLINT
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
JCLS_HTTPCLIENT,
|
||||
@@ -227,7 +226,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
size_t saveResponseCookies(const char *responseCookies, size_t count) {
|
||||
size_t saveResponseCookies(const char *responseCookies, size_t count) { // NOLINT
|
||||
if (nullptr == responseCookies || strlen(responseCookies) == 0 || count == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -249,7 +248,7 @@ public:
|
||||
return count;
|
||||
}
|
||||
|
||||
char *getResponseHeaders() {
|
||||
char *getResponseHeaders() { // NOLINT
|
||||
char * headers = nullptr;
|
||||
JniMethodInfo methodInfo;
|
||||
if (JniHelper::getStaticMethodInfo(methodInfo,
|
||||
@@ -270,7 +269,7 @@ public:
|
||||
return headers;
|
||||
}
|
||||
|
||||
char *getResponseContent(HttpResponse *response) {
|
||||
char *getResponseContent(HttpResponse *response) { // NOLINT
|
||||
if (nullptr == response) {
|
||||
return nullptr;
|
||||
}
|
||||
@@ -573,6 +572,7 @@ private:
|
||||
return _responseCookies;
|
||||
}
|
||||
|
||||
private: // NOLINT(readability-redundant-access-specifiers)
|
||||
HttpClient *_client;
|
||||
jobject _httpURLConnection;
|
||||
std::string _requestmethod;
|
||||
@@ -730,7 +730,7 @@ void HttpClient::networkThread() {
|
||||
|
||||
_schedulerMutex.lock();
|
||||
if (auto sche = _scheduler.lock()) {
|
||||
sche->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); //NOLINT
|
||||
sche->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this)); // NOLINT
|
||||
}
|
||||
_schedulerMutex.unlock();
|
||||
}
|
||||
@@ -832,7 +832,7 @@ HttpClient::HttpClient()
|
||||
_requestSentinel(new HttpRequest()) {
|
||||
CC_LOG_DEBUG("In the constructor of HttpClient!");
|
||||
increaseThreadCount();
|
||||
_scheduler = Application::getInstance()->getScheduler();
|
||||
_scheduler = CC_CURRENT_ENGINE()->getScheduler();
|
||||
}
|
||||
|
||||
HttpClient::~HttpClient() {
|
||||
@@ -846,7 +846,7 @@ bool HttpClient::lazyInitThreadSemaphore() {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this)); //NOLINT
|
||||
auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this)); // NOLINT
|
||||
t.detach();
|
||||
_isInited = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user