browser/client: more resource handling methods

This commit is contained in:
Adam
2023-06-05 20:14:08 +01:00
parent 3e49b6a320
commit 8e47804d2d
2 changed files with 141 additions and 16 deletions

View File

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,16 @@
#include "../browser.hxx"
#include "../native/native.hxx"
#include <vector>
#include <map>
#include <mutex>
#include <string>
#include <vector>
struct _InternalFile {
bool success;
std::vector<unsigned char> data;
CefString mime_type;
};
namespace Browser {
/// Implementation of CefClient, CefBrowserProcessHandler, CefLifeSpanHandler, CefRequestHandler.
@@ -66,6 +74,9 @@ namespace Browser {
Native::Native native;
std::string internal_url = "https://jaslaunch-internal/";
std::map<std::string, _InternalFile> internal_pages;
// Mutex-locked vector - may be accessed from either UI thread (most of the time) or IO thread (GetResourceRequestHandler)
std::vector<CefRefPtr<Browser::Window>> apps;
std::mutex apps_lock;