Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 68 additions & 48 deletions CefSharp/Enums/CefErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ public enum CefErrorCode
/// </summary>
BlockedByFingerprintingProtection = -34,

/// <summary>
/// The request was blocked by the Incognito Mode URL block list configured by
/// the domain administrator.
/// </summary>
BlockedInIncognitoByAdministrator = -35,

/// <summary>
/// A connection was closed (corresponding to a TCP FIN).
/// </summary>
Expand Down Expand Up @@ -269,10 +275,8 @@ public enum CefErrorCode
/// </summary>
TunnelConnectionFailed = -111,

/// <summary>
/// No SSL protocol versions are enabled.
/// </summary>
NoSslVersionsEnabled = -112,
// Obsolete:
// NET_ERROR(NO_SSL_VERSIONS_ENABLED, -112)

/// <summary>
/// The client and server don't support a common SSL protocol version or
Expand Down Expand Up @@ -410,15 +414,9 @@ public enum CefErrorCode
/// </summary>
TemporarilyThrottled = -139,

/// <summary>
/// A request to create an SSL tunnel connection through the HTTPS proxy
/// received a 302 (temporary redirect) response. The response body might
/// include a description of why the request failed.
///
/// TODO(crbug.com/40093955): This is deprecated and should not be used by
/// new code.
/// </summary>
HttpsProxyTunnelResponseRedirect = -140,
// Obsolete, since we now use the catch-all ERR_TUNNEL_CONNECTION_FAILED when a
// proxy tried to redirect a request.
// NET_ERROR(HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT, -140)

/// <summary>
/// We were unable to sign the CertificateVerify data of an SSL client auth
Expand Down Expand Up @@ -454,15 +452,9 @@ public enum CefErrorCode
/// </summary>
AddressInUse = -147,

/// <summary>
/// An operation failed because the SSL handshake has not completed.
/// </summary>
SslHandshakeNotCompleted = -148,

/// <summary>
/// SSL peer's public key is invalid.
/// </summary>
SslBadPeerPublicKey = -149,
// Obsolete:
// NET_ERROR(SSL_HANDSHAKE_NOT_COMPLETED, -148)
// NET_ERROR(SSL_BAD_PEER_PUBLIC_KEY, -149)

/// <summary>
/// The certificate didn't match the built-in public key pins for the host name.
Expand Down Expand Up @@ -954,22 +946,14 @@ public enum CefErrorCode
/// </summary>
NetworkIoSuspended = -331,

/// <summary>
/// FLIP data received without receiving a SYN_REPLY on the stream.
/// </summary>
SynReplyNotReceived = -332,

/// <summary>
/// Converting the response to target encoding failed.
/// </summary>
EncodingConversionFailed = -333,
// Obsolete. This was in earlier SPDY implementations.
// NET_ERROR(SYN_REPLY_NOT_RECEIVED, -332)

/// <summary>
/// The server sent an FTP directory listing in a format we do not understand.
/// </summary>
UnrecognizedFtpDirectoryListingFormat = -334,
// Obsolete. These were both used for FTP, which is no longer supported.
// NET_ERROR(ENCODING_CONVERSION_FAILED, -333)
// NET_ERROR(UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT, -334)

// Obsolete. Was only logged in NetLog when an HTTP/2 pushed stream expired.
// Obsolete. Was only logged in NetLog when an HTTP/2 pushed stream expired.
// NET_ERROR(INVALID_SPDY_STREAM, -335)

/// <summary>
Expand Down Expand Up @@ -1377,6 +1361,20 @@ public enum CefErrorCode
/// </summary>
TrustTokenOperationSuccessWithoutSendingRequest = -507,

/// <summary>
/// This is a placeholder value that should never be used within //net.
///
/// When Cronet APIs are being backed by HttpEngine (i.e., HttpEngineProvider is
/// being used), org.chromium.net.NetworkException#getCronetInternalErrorCode is
/// not supported (android.net.http.NetworkException#getCronetInternalErrorCode
/// does not exist). In this scenario, getCronetInternalErrorCode will always
/// return this error. This is a first step towards the deprecation of
/// getCronetInternalErrorCode.
///
/// Temporarily terminate, then restart, ITTT to avoid unsupported nesting.
/// </summary>
HttpengineProviderInUse = -508,
Comment on lines +1364 to +1376
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Search for Http2* and Http11* enum values in the CefErrorCode.cs file to understand the naming pattern
cat CefSharp/Enums/CefErrorCode.cs | grep -E "(Http2|Http11)" | head -20

Repository: cefsharp/CefSharp

Length of output: 515


🌐 Web query:

Chromium error code -508 net_error_list.h constant name

💡 Result:

Chromium net error code -508 corresponds to:

  • Constant in net_error_list.h: HTTPENGINE_PROVIDER_IN_USE
  • Enum / error name used in code: net::ERR_HTTPENGINE_PROVIDER_IN_USE [1]

🏁 Script executed:

# Also search for other HttpEngine references in the file to understand context
rg "HttpEngine" CefSharp/Enums/CefErrorCode.cs

Repository: cefsharp/CefSharp

Length of output: 149


Rename to HttpEngineProviderInUse for PascalCase consistency.
The enum violates the established naming pattern used throughout the file (e.g., Http2ProtocolError, Http11Required). The acronym "Engine" should be capitalized as part of the compound term.

🔧 Proposed fix
-        HttpengineProviderInUse = -508,
+        HttpEngineProviderInUse = -508,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// <summary>
/// This is a placeholder value that should never be used within //net.
///
/// When Cronet APIs are being backed by HttpEngine (i.e., HttpEngineProvider is
/// being used), org.chromium.net.NetworkException#getCronetInternalErrorCode is
/// not supported (android.net.http.NetworkException#getCronetInternalErrorCode
/// does not exist). In this scenario, getCronetInternalErrorCode will always
/// return this error. This is a first step towards the deprecation of
/// getCronetInternalErrorCode.
///
/// Temporarily terminate, then restart, ITTT to avoid unsupported nesting.
/// </summary>
HttpengineProviderInUse = -508,
/// <summary>
/// This is a placeholder value that should never be used within //net.
///
/// When Cronet APIs are being backed by HttpEngine (i.e., HttpEngineProvider is
/// being used), org.chromium.net.NetworkException#getCronetInternalErrorCode is
/// not supported (android.net.http.NetworkException#getCronetInternalErrorCode
/// does not exist). In this scenario, getCronetInternalErrorCode will always
/// return this error. This is a first step towards the deprecation of
/// getCronetInternalErrorCode.
///
/// Temporarily terminate, then restart, ITTT to avoid unsupported nesting.
/// </summary>
HttpEngineProviderInUse = -508,
🤖 Prompt for AI Agents
In `@CefSharp/Enums/CefErrorCode.cs` around lines 1364 - 1376, The enum member
name HttpengineProviderInUse in the CefErrorCode enum uses incorrect PascalCase;
rename it to HttpEngineProviderInUse to match the file's naming conventions
(e.g., Http2ProtocolError, Http11Required) and keep the same underlying value
(-508) and existing XML doc comment unchanged; update any references/usages of
CefErrorCode.HttpengineProviderInUse throughout the codebase to
CefErrorCode.HttpEngineProviderInUse to avoid build errors.


// *** Code -600 is reserved (was FTP_PASV_COMMAND_FAILED). ***
// *** Code -601 is reserved (was FTP_FAILED). ***
// *** Code -602 is reserved (was FTP_SERVICE_UNAVAILABLE). ***
Expand Down Expand Up @@ -1474,18 +1472,7 @@ public enum CefErrorCode
/// </summary>
DnsServerRequiresTcp = -801,

/// <summary>
/// DNS server failed. This error is returned for all of the following
/// error conditions:
/// 1 - Format error - The name server was unable to interpret the query.
/// 2 - Server failure - The name server was unable to process this query
/// due to a problem with the name server.
/// 4 - Not Implemented - The name server does not support the requested
/// kind of query.
/// 5 - Refused - The name server refuses to perform the specified
/// operation for policy reasons.
/// </summary>
DnsServerFailed = -802,
// Error -802 was removed (DNS_SERVER_FAILED)

/// <summary>
/// DNS transaction timed out.
Expand Down Expand Up @@ -1550,6 +1537,39 @@ public enum CefErrorCode
/// </summary>
DnsCacheInvalidationInProgress = -815,

/// <summary>
/// The DNS server responded with a format error response code.
/// </summary>
DnsFormatError = -816,

/// <summary>
/// The DNS server responded with a server failure response code.
/// </summary>
DnsServerFailure = -817,

/// <summary>
/// The DNS server responded that the query type is not implemented.
/// </summary>
DnsNotImplemented = -818,

/// <summary>
/// The DNS server responded that the request was refused.
/// </summary>
DnsRefused = -819,

/// <summary>
/// The DNS server responded with an rcode indicating that the request failed,
/// but the rcode is not one that we have a specific error code for. In other
/// words, the rcode was not one of the following:
/// - NOERR
/// - FORMERR
/// - SERVFAIL
/// - NXDOMAIN
/// - NOTIMP
/// - REFUSED
/// </summary>
DnsOtherFailure = -820,

// The following errors are for mapped from a subset of invalid
// storage::BlobStatus.

Expand Down
2 changes: 2 additions & 0 deletions CefSharp/Enums/PermissionRequestType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ public enum PermissionRequestType : uint
WindowManagement = 1 << 23,
FileSystemAccess = 1 << 24,
LocalNetworkAccess = 1 << 25,
LocalNetwork = 1 << 26,
LoopbackNetwork = 1 << 27,
}
}