5#ifndef MOLYBDEN_NETWORK_DELEGATES_HPP
6#define MOLYBDEN_NETWORK_DELEGATES_HPP
11#include "molybden/base/delegate.hpp"
12#include "molybden/base/delegate_action.hpp"
13#include "molybden/cookie/cookie.hpp"
14#include "molybden/network/http_header.hpp"
15#include "molybden/network/url_request.hpp"
22class UrlRequestJobFactory;
55 std::unique_ptr<rpc::internal::Callback> callback);
60 void override(
const std::shared_ptr<UploadData>& upload_data);
94 std::unique_ptr<rpc::internal::Callback> callback);
133 std::unique_ptr<rpc::internal::Callback> callback);
170 std::unique_ptr<rpc::internal::Callback> callback);
253 std::unique_ptr<rpc::internal::Callback> callback);
258 void override(
const std::vector<HttpHeader>& headers);
293 std::unique_ptr<rpc::internal::Callback> callback);
298 void override(
const std::vector<HttpHeader>& headers);
327 std::unique_ptr<rpc::internal::Callback> callback);
382 std::unique_ptr<rpc::internal::Callback> callback);
392 void intercept(std::shared_ptr<UrlRequestJob> url_request_job);
The base API that implements classes which represent delegate's action.
Definition delegate_action.hpp:18
The NetworkDelegates::onBeforeSendUploadData action.
Definition network_delegates.hpp:52
void proceed()
Continue with the original upload data.
The NetworkDelegates::onBeforeStartTransaction action arguments.
Definition network_delegates.hpp:290
void proceed()
Continue with the original HTTP headers.
The NetworkDelegates::onBeforeUrlRequest action arguments.
Definition network_delegates.hpp:324
void redirect(const std::string &url)
Redirect the URL request to the given URL.
void proceed()
Continue loading the URL request without redirecting.
void cancel()
Cancel the URL request.
The NetworkDelegates::onCanAccessFile action.
Definition network_delegates.hpp:167
void can()
Allow access to the requested file.
void cannot()
Deny access to the requested file.
The NetworkDelegates::onCanGetCookies action.
Definition network_delegates.hpp:130
void cannot()
Do not send the cookies to a web server.
void can()
Send the cookies to a web server.
The NetworkDelegates::onCanSetCookie action.
Definition network_delegates.hpp:91
void can()
Set the received cookie.
void cannot()
Do not set the received cookie.
Delegates allow you to make decisions that affect the application behavior.
Definition delegate.hpp:30
The NetworkDelegates::onInterceptUrlRequest action arguments.
Definition network_delegates.hpp:379
void intercept(std::shared_ptr< UrlRequestJob > url_request_job)
Intercept the URL request with the given URL request job.
void proceed()
Do not intercept the URL request and proceed normally.
A class that contains all network delegates.
Definition network_delegates.hpp:398
Delegate< CanAccessFileArgs, CanAccessFileAction > onCanAccessFile
Invoked to check if the engine can access a file on the local file system.
Definition network_delegates.hpp:468
Delegate< CanSetCookieArgs, CanSetCookieAction > onCanSetCookie
Invoked to check if the given cookie can be set or not.
Definition network_delegates.hpp:434
Delegate< ReceiveHeadersArgs, ReceiveHeadersAction > onReceiveHeaders
Invoked when the response headers have been received for a URL request.
Definition network_delegates.hpp:488
Delegate< InterceptUrlRequestArgs, InterceptUrlRequestAction > onInterceptUrlRequest
Invoked when a URL request is about to be sent out.
Definition network_delegates.hpp:548
Delegate< CanGetCookiesArgs, CanGetCookiesAction > onCanGetCookies
Invoked to check if the engine can access the given cookie or not.
Definition network_delegates.hpp:451
Delegate< BeforeSendUploadDataArgs, BeforeSendUploadDataAction > onBeforeSendUploadData
Invoked before the upload data is sent to the web server.
Definition network_delegates.hpp:417
Delegate< BeforeUrlRequestArgs, BeforeUrlRequestAction > onBeforeUrlRequest
Invoked when an HTTP request is about to occur.
Definition network_delegates.hpp:526
Delegate< BeforeStartTransactionArgs, BeforeStartTransactionAction > onBeforeStartTransaction
Invoked before the network transaction starts.
Definition network_delegates.hpp:509
The NetworkDelegates::onBeforeSendUploadData action arguments.
Definition network_delegates.hpp:27
std::shared_ptr< UploadData > upload_data
The upload data retrieved from the URL request.
Definition network_delegates.hpp:41
std::shared_ptr< Network > network
The network instance initiated this action.
Definition network_delegates.hpp:31
std::vector< HttpHeader > http_headers
The HTTP headers of the URL request.
Definition network_delegates.hpp:46
UrlRequest url_request
The URL request.
Definition network_delegates.hpp:36
The NetworkDelegates::onBeforeStartTransaction arguments.
Definition network_delegates.hpp:269
std::vector< HttpHeader > http_headers
The list of the HTTP headers of the request or an empty list if the request does not have any HTTP he...
Definition network_delegates.hpp:284
std::shared_ptr< Network > network
The network instance initiated this action.
Definition network_delegates.hpp:273
UrlRequest request
The URL request.
Definition network_delegates.hpp:278
The NetworkDelegates::onBeforeUrlRequest arguments.
Definition network_delegates.hpp:309
UrlRequest request
The URL request.
Definition network_delegates.hpp:318
std::shared_ptr< Network > network
The network instance initiated this action.
Definition network_delegates.hpp:313
The NetworkDelegates::onCanAccessFile action arguments.
Definition network_delegates.hpp:149
std::shared_ptr< Network > network
The network instance initiated this action.
Definition network_delegates.hpp:153
std::string absolute_file_path
Returns the absolute path to the file the request would like to access.
Definition network_delegates.hpp:161
The NetworkDelegates::onCanGetCookie action arguments.
Definition network_delegates.hpp:110
std::vector< Cookie > cookies
A list of cookies that are going to be sent with the URL request.
Definition network_delegates.hpp:124
std::string url
The URL of the request.
Definition network_delegates.hpp:119
std::shared_ptr< Network > network
The network instance initiated this action.
Definition network_delegates.hpp:114
The NetworkDelegates::onCanSetCookie action arguments.
Definition network_delegates.hpp:71
std::shared_ptr< Network > network
The network instance initiated this action.
Definition network_delegates.hpp:75
std::string url
The URL of the request.
Definition network_delegates.hpp:80
Cookie cookie
The cookie received from a web server.
Definition network_delegates.hpp:85
An HTTP cookie.
Definition cookie.hpp:48
The NetworkDelegates::onInterceptUrlRequest arguments.
Definition network_delegates.hpp:348
std::shared_ptr< Network > network
The network instance initiated this action.
Definition network_delegates.hpp:352
UrlRequest request
The URL request.
Definition network_delegates.hpp:357
std::shared_ptr< UploadData > upload_data
The upload data retrieved from the URL request.
Definition network_delegates.hpp:362
std::unique_ptr< UrlRequestJobFactory > job_factory
The factory for creating UrlRequestJob instances for the url request.
Definition network_delegates.hpp:373
std::vector< HttpHeader > http_headers
The list of the HTTP headers of the request or an empty list if the request does not have any HTTP he...
Definition network_delegates.hpp:368
The details about a URL request.
Definition url_request.hpp:185