Skip to content

Commit

Permalink
Merge pull request #6 from paulocoutinhox/new-version
Browse files Browse the repository at this point in the history
update to cef version 121
  • Loading branch information
paulocoutinhox authored Feb 2, 2024
2 parents 4e7025b + af5fa9d commit 8c6f31d
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.9"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: sudo apt-get install build-essential libgtk2.0-dev libgtkglext1-dev

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.9"

Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: brew install create-dmg

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.9"

Expand All @@ -63,27 +63,28 @@ jobs:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCEF_PLATFORM=${{ matrix.config.cef_platform }} -DCMAKE_OSX_ARCHITECTURES=${{ matrix.config.osx_arch }} -DPROJECT_ARCH=${{ matrix.config.project_arch }} -G "Xcode"
cmake --build build --target MyApp --config Release -v
- name: "Import certificate"
uses: devbotsxyz/import-signing-certificate@main
- name: Install application certificate
uses: apple-actions/import-codesign-certs@v2
with:
certificate-data: ${{ secrets.MACOS_CERTIFICATE }}
certificate-passphrase: ${{ secrets.MACOS_CERTIFICATE_PWD }}
keychain-password: ${{ secrets.KEYCHAIN_PWD }}
keychain: ${{ github.run_id }}
keychain-password: ${{ github.run_id }}
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}

- name: Codesign application
run: |
security find-identity -v
python codesign.py "Developer ID Application: Paulo Coutinho (99AHAA343Q)" "build/Release/MyApp.app" "app/resources/macos/entitlements.plist" -v
python3 codesign.py "Developer ID Application: Paulo Coutinho (99AHAA343Q)" "build/Release/MyApp.app" "app/resources/macos/entitlements.plist" -v
- name: Create DMG
run: |
python make.py dmg-build
python3 make.py dmg-build
mv "MyApp.dmg" ${{ matrix.config.target }}-${{ matrix.config.cef_platform }}.dmg
- name: Codesign DMG
run: |
security find-identity -v
python codesign.py "Developer ID Application: Paulo Coutinho (99AHAA343Q)" "${{ matrix.config.target }}-${{ matrix.config.cef_platform }}.dmg" "app/resources/macos/entitlements.plist" -v
python3 codesign.py "Developer ID Application: Paulo Coutinho (99AHAA343Q)" "${{ matrix.config.target }}-${{ matrix.config.cef_platform }}.dmg" "app/resources/macos/entitlements.plist" -v
- name: Notarize build
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
arch: ${{ matrix.config.msvc_arch }}

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.9"

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project("MyApp")

# CEF configuration
set_property(GLOBAL PROPERTY OS_FOLDERS ON)
set(CEF_VERSION "114.2.10+g398e3c3+chromium-114.0.5735.110")
set(CEF_VERSION "120.2.7+g4bc6a59+chromium-120.0.6099.234")

# Determine the platform
if(NOT DEFINED CEF_PLATFORM)
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You can download a compiled version for your system on releases page or actions

You can change CEF_VERSION variable inside CMakeLists.txt.

Example of valid version: `114.2.10+g398e3c3+chromium-114.0.5735.110`.
Example of valid version: `120.2.7+g4bc6a59+chromium-120.0.6099.234`.

Visit https://cef-builds.spotifycdn.com/index.html for the list of supported platforms and versions.

Expand Down Expand Up @@ -83,3 +83,11 @@ Other option is publish your application on Microsoft Store. See some tutorials:
* https://docs.microsoft.com/windows/msix/packaging-tool/create-an-msix-overview
* https://docs.microsoft.com/windows/win32/win_cert/windows-certification-portal
* https://www.electronjs.org/docs/tutorial/windows-store-guide

## License

This license informations is about this personal project, not the CEF Library.

[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2021-2024, Paulo Coutinho
6 changes: 3 additions & 3 deletions app/include/main/binding/AppBinding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class AppBinding : public CefMessageRouterBrowserSide::Handler
virtual ~AppBinding() {}

// called due to cefQuery execution
virtual bool OnQuery(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64 queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback) override;
virtual bool OnQuery(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64_t queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback) override;

// called on AppClient
static void init(CefRefPtr<CefMessageRouterBrowserSide> router);

// tasks
bool onTaskReverseData(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64 queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback, const std::string &messageName, const std::string &requestMessage);
bool onTaskNetworkRequest(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64 queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback, const std::string &messageName, const std::string &requestMessage);
bool onTaskReverseData(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64_t queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback, const std::string &messageName, const std::string &requestMessage);
bool onTaskNetworkRequest(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64_t queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback, const std::string &messageName, const std::string &requestMessage);

// callback
void onRequestComplete(CefRefPtr<Callback> callback, CefURLRequest::ErrorCode errorCode, const std::string &downloadData);
Expand Down
8 changes: 4 additions & 4 deletions app/include/main/net/RequestClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class RequestClient : public CefURLRequestClient
virtual ~RequestClient();

void OnRequestComplete(CefRefPtr<CefURLRequest> request) override;
void OnUploadProgress(CefRefPtr<CefURLRequest> request, int64 current, int64 total) override;
void OnDownloadProgress(CefRefPtr<CefURLRequest> request, int64 current, int64 total) override;
void OnUploadProgress(CefRefPtr<CefURLRequest> request, int64_t current, int64_t total) override;
void OnDownloadProgress(CefRefPtr<CefURLRequest> request, int64_t current, int64_t total) override;
void OnDownloadData(CefRefPtr<CefURLRequest> request, const void *data, size_t dataLength) override;
bool GetAuthCredentials(bool isProxy, const CefString &host, int port, const CefString &realm, const CefString &scheme, CefRefPtr<CefAuthCallback> callback) override;

void detach();
const std::string &getDownloadData();

private:
int64 uploadTotal;
int64 downloadTotal;
int64_t uploadTotal;
int64_t downloadTotal;
std::string downloadData;

RequestCallback requestCallback;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/binding/AppBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace app
namespace binding
{

bool AppBinding::OnQuery(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64 queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback)
bool AppBinding::OnQuery(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64_t queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback)
{
// only handle messages from application url
const std::string &url = frame->GetURL();
Expand Down Expand Up @@ -42,7 +42,7 @@ bool AppBinding::OnQuery(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> fram
return false;
}

bool AppBinding::onTaskNetworkRequest(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64 queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback, const std::string &messageName, const std::string &requestMessage)
bool AppBinding::onTaskNetworkRequest(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64_t queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback, const std::string &messageName, const std::string &requestMessage)
{
// create a CefRequest object
CefRefPtr<CefRequest> httpRequest = CefRequest::Create();
Expand Down Expand Up @@ -79,7 +79,7 @@ bool AppBinding::onTaskNetworkRequest(CefRefPtr<CefBrowser> browser, CefRefPtr<C
return true;
}

bool AppBinding::onTaskReverseData(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64 queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback, const std::string &messageName, const std::string &requestMessage)
bool AppBinding::onTaskReverseData(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int64_t queryId, const CefString &request, bool persistent, CefRefPtr<Callback> callback, const std::string &messageName, const std::string &requestMessage)
{
std::string result = requestMessage.substr(messageName.size() + 1);
std::reverse(result.begin(), result.end());
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/net/RequestClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ void RequestClient::OnRequestComplete(CefRefPtr<CefURLRequest> request)
}
}

void RequestClient::OnUploadProgress(CefRefPtr<CefURLRequest> request, int64 current, int64 total)
void RequestClient::OnUploadProgress(CefRefPtr<CefURLRequest> request, int64_t current, int64_t total)
{
uploadTotal = total;
}

void RequestClient::OnDownloadProgress(CefRefPtr<CefURLRequest> request, int64 current, int64 total)
void RequestClient::OnDownloadProgress(CefRefPtr<CefURLRequest> request, int64_t current, int64_t total)
{
downloadTotal = total;
}
Expand Down
5 changes: 0 additions & 5 deletions modules/tasks/dmg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import subprocess

import modules.file as file
Expand All @@ -15,10 +14,6 @@ def run_task_build():
"create-dmg",
"--volname",
config.app_name,
"--icon",
"build/{0}/{1}.app".format(config.build_type, config.app_name),
"--hide-extension",
"build/{0}/{1}.app".format(config.build_type, config.app_name),
"--hdiutil-quiet",
"{0}.dmg".format(config.app_name),
"build/{0}/{1}.app".format(config.build_type, config.app_name),
Expand Down

0 comments on commit 8c6f31d

Please sign in to comment.