Molybden API
Loading...
Searching...
No Matches
url_request.hpp
1// Copyright (c) 2000-2023 TeamDev Ltd. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_URL_REQUEST_HPP
6#define MOLYBDEN_URL_REQUEST_HPP
7
8#include <memory>
9#include <string>
10
11#include "molybden/network/http_header.hpp"
12#include "molybden/network/http_status_code.hpp"
13
14namespace molybden {
15
16class Browser;
17
21enum class ConnectionType {
22 kUnspecified,
23 kType2g,
24 kType3g,
25 kType4g,
26 kType5g,
27 kTypeBluetooth,
28 kTypeEthernet,
29 kTypeWifi,
30
34 kTypeNone,
35
39 kTypeUnknown
40};
41
45enum class ResourceType {
46 kUnspecified,
47
51 kMainFrame,
52
56 kSubFrame,
57
61 kStylesheet,
62
66 kScript,
67
71 kImage,
72
76 kFontResource,
77
81 kSubResource,
82
86 kObject,
87
91 kMedia,
92
96 kWorker,
97
101 kSharedWorker,
102
106 kPrefetch,
107
111 kFavicon,
112
116 kXhr,
117
121 kPing,
122
126 kServiceWorker,
127
131 kCspReport,
132
136 kPluginResource
137};
138
142enum class SslVersion {
143 kUnspecified,
144 kSslVersionUnknown,
145 kSslVersionSsl2,
146 kSslVersionSsl3,
147 kSslVersionTls1,
148 kSslVersionTls11,
149 kSslVersionTls12,
150 kSslVersionTls13,
151 kSslVersionQuic
152};
153
157enum class UrlRequestStatus {
158 kUnspecified,
159
163 kUrlRequestStatusSuccess,
164
169 kUrlRequestStatusIoPending,
170
174 kUrlRequestStatusCanceled,
175
179 kUrlRequestStatusFailed
180};
181
189 uint64_t id;
190
194 std::string url;
195
199 std::string method;
200
204 ResourceType resource_type;
205
211
216 uint64_t sent_bytes;
217
222 std::shared_ptr<Browser> browser;
223
227 SslVersion ssl_version;
228};
229
233struct HostPort {
237 std::string host;
238
242 uint32_t port;
243};
244
245} // namespace molybden
246
247#endif // MOLYBDEN_URL_REQUEST_HPP
A host/port pair of the URI.
Definition url_request.hpp:233
std::string host
The host of the URI.
Definition url_request.hpp:237
uint32_t port
The port of the URI.
Definition url_request.hpp:242
The details about a URL request.
Definition url_request.hpp:185
std::shared_ptr< Browser > browser
The browser instance initiated this request or nullptr if it has not been determined or not available...
Definition url_request.hpp:222
SslVersion ssl_version
The SSL connection version used to make this request.
Definition url_request.hpp:227
ResourceType resource_type
The type of the resource the request is loading.
Definition url_request.hpp:204
uint64_t sent_bytes
The total amount of data sent over the network before SSL encoding and proxy handling.
Definition url_request.hpp:216
std::string method
The request method name.
Definition url_request.hpp:199
uint64_t received_bytes
The total amount of data received from network after SSL decoding and proxy handling.
Definition url_request.hpp:210
std::string url
The URL address of this request.
Definition url_request.hpp:194
uint64_t id
The identifier of this URL request.
Definition url_request.hpp:189