forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android: Fix many WrongConstant errors
Add WebviewErrorCode @IntDef. Bug: 1116130 Change-Id: I740ad5b03eb2c03effd16413b57640d872b00a0a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401813 Reviewed-by: Theresa <twellington@chromium.org> Reviewed-by: Xi Han <hanxi@chromium.org> Reviewed-by: Bo <boliu@chromium.org> Reviewed-by: Andrew Grieve <agrieve@chromium.org> Commit-Queue: Peter Wen <wnwen@chromium.org> Auto-Submit: Peter Wen <wnwen@chromium.org> Cr-Commit-Position: refs/heads/master@{#806706}
- Loading branch information
Peter Wen
authored and
Commit Bot
committed
Sep 14, 2020
1 parent
0ebf5c2
commit 4f91a35
Showing
31 changed files
with
204 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
android_webview/java/src/org/chromium/android_webview/WebviewErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package org.chromium.android_webview; | ||
|
||
import android.webkit.WebViewClient; | ||
|
||
import androidx.annotation.IntDef; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
@Retention(RetentionPolicy.SOURCE) | ||
@IntDef({WebviewErrorCode.ERROR_OK, WebviewErrorCode.ERROR_UNKNOWN, | ||
WebviewErrorCode.ERROR_HOST_LOOKUP, WebviewErrorCode.ERROR_UNSUPPORTED_AUTH_SCHEME, | ||
WebviewErrorCode.ERROR_AUTHENTICATION, WebviewErrorCode.ERROR_PROXY_AUTHENTICATION, | ||
WebviewErrorCode.ERROR_CONNECT, WebviewErrorCode.ERROR_IO, WebviewErrorCode.ERROR_TIMEOUT, | ||
WebviewErrorCode.ERROR_REDIRECT_LOOP, WebviewErrorCode.ERROR_UNSUPPORTED_SCHEME, | ||
WebviewErrorCode.ERROR_FAILED_SSL_HANDSHAKE, WebviewErrorCode.ERROR_BAD_URL, | ||
WebviewErrorCode.ERROR_FILE, WebviewErrorCode.ERROR_FILE_NOT_FOUND, | ||
WebviewErrorCode.ERROR_TOO_MANY_REQUESTS, WebviewErrorCode.ERROR_UNSAFE_RESOURCE}) | ||
public @interface WebviewErrorCode { | ||
// Success | ||
int ERROR_OK = 0; | ||
// Generic error | ||
int ERROR_UNKNOWN = WebViewClient.ERROR_UNKNOWN; | ||
// Server or proxy hostname lookup failed | ||
int ERROR_HOST_LOOKUP = WebViewClient.ERROR_HOST_LOOKUP; | ||
// Unsupported authentication scheme (not basic or digest) | ||
int ERROR_UNSUPPORTED_AUTH_SCHEME = WebViewClient.ERROR_UNSUPPORTED_AUTH_SCHEME; | ||
// User authentication failed on server | ||
int ERROR_AUTHENTICATION = WebViewClient.ERROR_AUTHENTICATION; | ||
// User authentication failed on proxy | ||
int ERROR_PROXY_AUTHENTICATION = WebViewClient.ERROR_PROXY_AUTHENTICATION; | ||
// Failed to connect to the server | ||
int ERROR_CONNECT = WebViewClient.ERROR_CONNECT; | ||
// Failed to read or write to the server | ||
int ERROR_IO = WebViewClient.ERROR_IO; | ||
// Connection timed out | ||
int ERROR_TIMEOUT = WebViewClient.ERROR_TIMEOUT; | ||
// Too many redirects | ||
int ERROR_REDIRECT_LOOP = WebViewClient.ERROR_REDIRECT_LOOP; | ||
// Unsupported URI scheme | ||
int ERROR_UNSUPPORTED_SCHEME = WebViewClient.ERROR_UNSUPPORTED_SCHEME; | ||
// Failed to perform SSL handshake | ||
int ERROR_FAILED_SSL_HANDSHAKE = WebViewClient.ERROR_FAILED_SSL_HANDSHAKE; | ||
// Malformed URL | ||
int ERROR_BAD_URL = WebViewClient.ERROR_BAD_URL; | ||
// Generic file error | ||
int ERROR_FILE = WebViewClient.ERROR_FILE; | ||
// File not found | ||
int ERROR_FILE_NOT_FOUND = WebViewClient.ERROR_FILE_NOT_FOUND; | ||
// Too many requests during this load | ||
int ERROR_TOO_MANY_REQUESTS = WebViewClient.ERROR_TOO_MANY_REQUESTS; | ||
// Request was identified as a bad url by safebrowsing. | ||
int ERROR_UNSAFE_RESOURCE = WebViewClient.ERROR_UNSAFE_RESOURCE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.