mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 08:58:48 +00:00
d350cad52a
* Upgrade to CEF 93.1.7+g9117d6a+chromium-93.0.4577.42 / Chromium 93.0.4577.42
- Core - Add basic ref counting implementation
IMPLEMENT_REFCOUNTING implementation uses atomic which
forces the VC++ compiler to compile as native which doesn't work for our managed ref classes.
- Use InterlockedCompareExchange for custom ref count reads
- Use InterlockedIncrement/InterlockedDecrement directly
- There's no memory barrier for HasOneRef/HasAtLeastOneRef as the read of a LONG should happen in one operation
on 32/64 bit architectures (at least that's my understanding at this point in time).
References:
https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_x86_msvc.h#L125
https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_arm64_msvc.h#L107
https://github.com/chromiumembedded/cef/blob/4472/include/base/cef_atomic_ref_count.h#L114
https://github.com/chromiumembedded/cef/blob/4472/include/cef_base.h#L91
- Remove Microsoft.Net.Compilers package from projects
Now that we require a min of VS2019 to build there's no need for a custom compiler package
- Start removing VS2015/VC++2015 references
- Remove RegisterWidevineCdm
This is a breaking change. CEF will now automatically download the Widevine CDM component
Resolves #3767
- RequestContext.LoadExtension now uses managed to code spawn on CEF UI Thread
Avoid having to use cef_callback.h which was causing problems for x86 builds
98 lines
3.1 KiB
C++
98 lines
3.1 KiB
C++
// Copyright © 2019 The CefSharp Authors. All rights reserved.
|
|
//
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
#pragma once
|
|
|
|
#include "Stdafx.h"
|
|
|
|
#include "include\cef_urlrequest.h"
|
|
|
|
#include "Request.h"
|
|
#include "RequestContext.h"
|
|
#include "Internals\CefUrlRequestClientAdapter.h"
|
|
#include "Internals\CefWrapper.h"
|
|
|
|
namespace CefSharp
|
|
{
|
|
namespace Core
|
|
{
|
|
// Class used to make a URL request. URL requests are not associated with
|
|
// a browser instance so no CefClient callbacks will be executed.
|
|
// URL requests can be created on any valid CEF thread in either the browser
|
|
// or render process. Once created the methods of the URL request object must
|
|
// be accessed on the same thread that created it.
|
|
[System::ComponentModel::EditorBrowsableAttribute(System::ComponentModel::EditorBrowsableState::Never)]
|
|
public ref class UrlRequest : public IUrlRequest, public CefWrapper
|
|
{
|
|
private:
|
|
MCefRefPtr<CefURLRequest> _urlRequest;
|
|
internal:
|
|
UrlRequest(CefRefPtr<CefURLRequest> &urlRequest)
|
|
: _urlRequest(urlRequest)
|
|
{
|
|
}
|
|
|
|
!UrlRequest()
|
|
{
|
|
_urlRequest = nullptr;
|
|
}
|
|
|
|
~UrlRequest()
|
|
{
|
|
this->!UrlRequest();
|
|
}
|
|
|
|
public:
|
|
UrlRequest(IRequest^ request, IUrlRequestClient^ urlRequestClient)
|
|
: UrlRequest(request, urlRequestClient, nullptr)
|
|
{
|
|
}
|
|
|
|
UrlRequest(IRequest^ request, IUrlRequestClient^ urlRequestClient, IRequestContext^ requestContext)
|
|
{
|
|
if (request == nullptr)
|
|
{
|
|
throw gcnew ArgumentNullException("request");
|
|
}
|
|
if (urlRequestClient == nullptr)
|
|
{
|
|
throw gcnew ArgumentNullException("urlRequestClient");
|
|
}
|
|
|
|
_urlRequest = CefURLRequest::Create((Request^)request, new CefUrlRequestClientAdapter(urlRequestClient), (RequestContext^)requestContext).get();
|
|
}
|
|
|
|
///
|
|
// Returns true if the response body was served from the cache. This includes
|
|
// responses for which revalidation was required.
|
|
///
|
|
/*--cef()--*/
|
|
virtual property bool ResponseWasCached
|
|
{
|
|
bool get();
|
|
}
|
|
|
|
///
|
|
// Returns the response, or NULL if no response information is available.
|
|
// Response information will only be available after the upload has completed.
|
|
// The returned object is read-only and should not be modified.
|
|
///
|
|
/*--cef()--*/
|
|
virtual property IResponse^ Response
|
|
{
|
|
IResponse^ get();
|
|
}
|
|
|
|
///
|
|
// Returns the request status.
|
|
///
|
|
/*--cef(default_retval=UR_UNKNOWN)--*/
|
|
virtual property UrlRequestStatus RequestStatus
|
|
{
|
|
UrlRequestStatus get();
|
|
}
|
|
};
|
|
}
|
|
}
|