Commit 8cc902d8 authored by Alice Gong's avatar Alice Gong Committed by Chromium LUCI CQ

Update documentation in oauth2_api_call_flow.h for change 2577004

BUG=1154032

Change-Id: Idb1cfb620b41e6dfe7bed4ed316de76679e6e250
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2578056Reviewed-by: default avatarRoger Tawa <rogerta@chromium.org>
Reviewed-by: default avatarAlex Ilin <alexilin@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Auto-Submit: Alice Gong <alicego@google.com>
Cr-Commit-Position: refs/heads/master@{#834652}
parent 9a52db56
...@@ -51,19 +51,22 @@ class OAuth2ApiCallFlow { ...@@ -51,19 +51,22 @@ class OAuth2ApiCallFlow {
// with the request. // with the request.
virtual std::string GetRequestTypeForBody(const std::string& body); virtual std::string GetRequestTypeForBody(const std::string& body);
// Called when the API call ends to check whether it succeeded, and decide // Called when the API call ends without network error to check whether the
// which of the following 2 process functions to call. Should be overriden by // request succeeded, to decide which of the following 2 process functions to
// subclasses if the expected success response code is not 200 or 204. // call. Should be overriden by subclasses if the expected success response
// code is not 200 or 204.
virtual bool IsExpectedSuccessCode(int code) const; virtual bool IsExpectedSuccessCode(int code) const;
// Sub-classes can expose an appropriate observer interface by implementing // Sub-classes can expose an appropriate observer interface by implementing
// these template methods. // these template methods.
// Called when the API call finished successfully. |body| may be null. // Called when there is no network error and IsExpectedSuccessCode() returns
// true. |body| may be null.
virtual void ProcessApiCallSuccess( virtual void ProcessApiCallSuccess(
const network::mojom::URLResponseHead* head, const network::mojom::URLResponseHead* head,
std::unique_ptr<std::string> body) = 0; std::unique_ptr<std::string> body) = 0;
// Called when the API call failed. |head| or |body| might be null. // Called when there is a network error or IsExpectedSuccessCode() returns
// false. |head| or |body| might be null.
virtual void ProcessApiCallFailure( virtual void ProcessApiCallFailure(
int net_error, int net_error,
const network::mojom::URLResponseHead* head, const network::mojom::URLResponseHead* head,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment