Skip to content

Commit

Permalink
Update documentation in oauth2_api_call_flow.h for change 2577004
Browse files Browse the repository at this point in the history
BUG=1154032

Change-Id: Idb1cfb620b41e6dfe7bed4ed316de76679e6e250
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2578056
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Reviewed-by: Alex 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}
  • Loading branch information
Alice Gong authored and Chromium LUCI CQ committed Dec 8, 2020
1 parent 9a52db5 commit 8cc902d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions google_apis/gaia/oauth2_api_call_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,22 @@ class OAuth2ApiCallFlow {
// with the request.
virtual std::string GetRequestTypeForBody(const std::string& body);

// Called when the API call ends to check whether it succeeded, and decide
// which of the following 2 process functions to call. Should be overriden by
// subclasses if the expected success response code is not 200 or 204.
// Called when the API call ends without network error to check whether the
// request succeeded, to decide which of the following 2 process functions to
// call. Should be overriden by subclasses if the expected success response
// code is not 200 or 204.
virtual bool IsExpectedSuccessCode(int code) const;

// Sub-classes can expose an appropriate observer interface by implementing
// 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(
const network::mojom::URLResponseHead* head,
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(
int net_error,
const network::mojom::URLResponseHead* head,
Expand Down

0 comments on commit 8cc902d

Please sign in to comment.