Loading...
Searching...
No Matches
Session.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * This file is a part of Ultralight. *
3 * *
4 * See <https://ultralig.ht> for licensing and more. *
5 * *
6 * (C) 2024 Ultralight, Inc. *
7 **************************************************************************************************/
8#pragma once
10#include <Ultralight/RefPtr.h>
11#include <Ultralight/String.h>
12
13namespace ultralight {
14
15///
16/// Storage for a browsing session (cookies, local storage, etc.).
17///
18/// This class stores data for a unique browsing session (cookies, local storage, application cache,
19/// indexed db. etc.). You can create multiple sessions to isolate data between different browsing
20/// contexts.
21///
22/// ## Default Session
23///
24/// The Renderer has a default session named "default" that is used if no session is specified when
25/// when creating a View.
26///
27/// ## Session Lifetime
28///
29/// Sessions can be either temporary (in-memory only) or persistent (backed to disk).
30///
31/// @see Renderer::CreateSession
32///
33class UExport Session : public RefCounted {
34 public:
35 ///
36 /// Whether or not this session is written to disk.
37 ///
38 virtual bool is_persistent() const = 0;
39
40 ///
41 /// A unique name identifying this session.
42 ///
43 virtual String name() const = 0;
44
45 ///
46 /// A unique numeric ID identifying this session.
47 ///
48 virtual uint64_t id() const = 0;
49
50 ///
51 /// The disk path of this session (only valid for persistent sessions).
52 ///
53 virtual String disk_path() const = 0;
54
55 protected:
56 virtual ~Session();
57};
58
59} // namespace ultralight
#define UExport
Definition Exports.h:25
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition RefPtr.h:47
Storage for a browsing session (cookies, local storage, etc.).
Definition Session.h:33
virtual String disk_path() const =0
The disk path of this session (only valid for persistent sessions).
virtual String name() const =0
A unique name identifying this session.
virtual uint64_t id() const =0
A unique numeric ID identifying this session.
virtual bool is_persistent() const =0
Whether or not this session is written to disk.
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition String.h:34
Definition App.h:14