mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 13:56:27 -05:00
0af182baa2
The URL string was being deleted before being used, leading to a use-after-free occurring when it is used afterwards. Fix this by taking the string by const ref to extend its lifetime, ensuring it doesn't get deleted before use.
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
// Copyright 2018 yuzu emulator team
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <functional>
|
|
#include <string_view>
|
|
|
|
#include "core/hle/service/am/applets/web_types.h"
|
|
|
|
namespace Core::Frontend {
|
|
|
|
class WebBrowserApplet {
|
|
public:
|
|
virtual ~WebBrowserApplet();
|
|
|
|
virtual void OpenLocalWebPage(
|
|
const std::string& local_url, std::function<void()> extract_romfs_callback,
|
|
std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0;
|
|
|
|
virtual void OpenExternalWebPage(
|
|
const std::string& external_url,
|
|
std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0;
|
|
};
|
|
|
|
class DefaultWebBrowserApplet final : public WebBrowserApplet {
|
|
public:
|
|
~DefaultWebBrowserApplet() override;
|
|
|
|
void OpenLocalWebPage(const std::string& local_url,
|
|
std::function<void()> extract_romfs_callback,
|
|
std::function<void(Service::AM::Applets::WebExitReason, std::string)>
|
|
callback) const override;
|
|
|
|
void OpenExternalWebPage(const std::string& external_url,
|
|
std::function<void(Service::AM::Applets::WebExitReason, std::string)>
|
|
callback) const override;
|
|
};
|
|
|
|
} // namespace Core::Frontend
|