summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/fs/archive.cpp1
-rw-r--r--src/core/hle/service/fs/archive.h6
-rw-r--r--src/core/hle/service/fs/fs_user.cpp1
-rw-r--r--src/core/hle/service/service.cpp13
-rw-r--r--src/core/hle/service/service.h45
5 files changed, 8 insertions, 58 deletions
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp
index 21929e966..d6128d6a7 100644
--- a/src/core/hle/service/fs/archive.cpp
+++ b/src/core/hle/service/fs/archive.cpp
@@ -25,6 +25,7 @@
#include "core/file_sys/errors.h"
#include "core/file_sys/file_backend.h"
#include "core/hle/kernel/client_session.h"
+#include "core/hle/kernel/server_session.h"
#include "core/hle/result.h"
#include "core/hle/service/fs/archive.h"
#include "core/hle/service/fs/fs_user.h"
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h
index 2ea956e0b..28e33caaa 100644
--- a/src/core/hle/service/fs/archive.h
+++ b/src/core/hle/service/fs/archive.h
@@ -8,7 +8,7 @@
#include <string>
#include "common/common_types.h"
#include "core/file_sys/archive_backend.h"
-#include "core/hle/kernel/server_session.h"
+#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/result.h"
namespace FileSys {
@@ -43,7 +43,7 @@ enum class MediaType : u32 { NAND = 0, SDMC = 1, GameCard = 2 };
typedef u64 ArchiveHandle;
-class File final : public SessionRequestHandler, public std::enable_shared_from_this<File> {
+class File final : public Kernel::SessionRequestHandler, public std::enable_shared_from_this<File> {
public:
File(std::unique_ptr<FileSys::FileBackend>&& backend, const FileSys::Path& path);
~File();
@@ -60,7 +60,7 @@ protected:
void HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) override;
};
-class Directory final : public SessionRequestHandler {
+class Directory final : public Kernel::SessionRequestHandler {
public:
Directory(std::unique_ptr<FileSys::DirectoryBackend>&& backend, const FileSys::Path& path);
~Directory();
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp
index c1825e9c8..fafdd3cc8 100644
--- a/src/core/hle/service/fs/fs_user.cpp
+++ b/src/core/hle/service/fs/fs_user.cpp
@@ -11,6 +11,7 @@
#include "core/core.h"
#include "core/file_sys/errors.h"
#include "core/hle/kernel/client_session.h"
+#include "core/hle/kernel/server_session.h"
#include "core/hle/result.h"
#include "core/hle/service/fs/archive.h"
#include "core/hle/service/fs/fs_user.h"
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 0672ac2e3..bb22e25be 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -2,11 +2,10 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include <boost/range/algorithm_ext/erase.hpp>
-
#include "common/logging/log.h"
#include "common/string_util.h"
#include "core/hle/kernel/server_port.h"
+#include "core/hle/kernel/server_session.h"
#include "core/hle/service/ac/ac.h"
#include "core/hle/service/act/act.h"
#include "core/hle/service/am/am.h"
@@ -66,16 +65,6 @@ static std::string MakeFunctionString(const char* name, const char* port_name,
return function_string;
}
-void SessionRequestHandler::ClientConnected(
- Kernel::SharedPtr<Kernel::ServerSession> server_session) {
- connected_sessions.push_back(server_session);
-}
-
-void SessionRequestHandler::ClientDisconnected(
- Kernel::SharedPtr<Kernel::ServerSession> server_session) {
- boost::range::remove_erase(connected_sessions, server_session);
-}
-
Interface::Interface(u32 max_sessions) : max_sessions(max_sessions) {}
Interface::~Interface() = default;
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index ffabc24a4..a5fe843f6 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -12,13 +12,10 @@
#include "core/hle/ipc.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/client_port.h"
+#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/result.h"
#include "core/memory.h"
-namespace Kernel {
-class ServerSession;
-}
-
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace Service
@@ -29,48 +26,10 @@ static const int kMaxPortSize = 8; ///< Maximum size of a port name (8 character
static const u32 DefaultMaxSessions = 10;
/**
- * Interface implemented by HLE Session handlers.
- * This can be provided to a ServerSession in order to hook into several relevant events
- * (such as a new connection or a SyncRequest) so they can be implemented in the emulator.
- */
-class SessionRequestHandler {
-public:
- /**
- * Handles a sync request from the emulated application.
- * @param server_session The ServerSession that was triggered for this sync request,
- * it should be used to differentiate which client (As in ClientSession) we're answering to.
- * TODO(Subv): Use a wrapper structure to hold all the information relevant to
- * this request (ServerSession, Originator thread, Translated command buffer, etc).
- * @returns ResultCode the result code of the translate operation.
- */
- virtual void HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) = 0;
-
- /**
- * Signals that a client has just connected to this HLE handler and keeps the
- * associated ServerSession alive for the duration of the connection.
- * @param server_session Owning pointer to the ServerSession associated with the connection.
- */
- void ClientConnected(Kernel::SharedPtr<Kernel::ServerSession> server_session);
-
- /**
- * Signals that a client has just disconnected from this HLE handler and releases the
- * associated ServerSession.
- * @param server_session ServerSession associated with the connection.
- */
- void ClientDisconnected(Kernel::SharedPtr<Kernel::ServerSession> server_session);
-
-protected:
- /// List of sessions that are connected to this handler.
- /// A ServerSession whose server endpoint is an HLE implementation is kept alive by this list
- // for the duration of the connection.
- std::vector<Kernel::SharedPtr<Kernel::ServerSession>> connected_sessions;
-};
-
-/**
* Framework for implementing HLE service handlers which dispatch incoming SyncRequests based on a
* table mapping header ids to handler functions.
*/
-class Interface : public SessionRequestHandler {
+class Interface : public Kernel::SessionRequestHandler {
public:
/**
* Creates an HLE interface with the specified max sessions.