Add support for GetAuthCredentials (fixes issue #2718, see issue #2622).

When NetworkService is enabled requests created using CefFrame::CreateURLRequest
will call CefRequestHandler::GetAuthCredentials for the associated browser after
calling CefURLRequestClient::GetAuthCredentials if that call returns false.
This commit is contained in:
Marshall Greenblatt
2019-07-12 16:44:43 -04:00
parent ac2cc54e13
commit 3f1ebebde5
30 changed files with 859 additions and 77 deletions

View File

@ -9,10 +9,28 @@
#include "include/cef_urlrequest.h"
#include "base/optional.h"
namespace content {
struct GlobalRequestID;
}
class CefBrowserURLRequest : public CefURLRequest {
public:
class Context;
// TODO(network): After the old network code path is deleted move the
// CefURLRequestClient::GetAuthCredentials callback to the context thread and
// return just the CefBrowserURLRequest object here. The *Client object can
// then be retrieved by calling GetClient() from the required thread.
using RequestInfo = std::pair<CefRefPtr<CefBrowserURLRequest>,
CefRefPtr<CefURLRequestClient>>;
// Retrieve the request objects, if any, associated with |request_id|.
static base::Optional<RequestInfo> FromRequestID(int32_t request_id);
static base::Optional<RequestInfo> FromRequestID(
const content::GlobalRequestID& request_id);
// If |frame| is nullptr requests can still be intercepted but no
// browser/frame will be associated with them.
CefBrowserURLRequest(CefRefPtr<CefFrame> frame,