Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: net/http/http_auth_controller.cc

Issue 2910473005: Deprecate NonThreadSafe in net/ in favor of SequenceChecker/ThreadChecker. (Closed)
Patch Set: another compile nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/http/http_auth_controller.cc
diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc
index 6eaf02cad0b43bc7b2ff86f82366a60c78a95dd1..bf895932a65142e13fcd9c6737b34cf6cbdbf1e7 100644
--- a/net/http/http_auth_controller.cc
+++ b/net/http/http_auth_controller.cc
@@ -138,14 +138,14 @@ HttpAuthController::HttpAuthController(
}
HttpAuthController::~HttpAuthController() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
int HttpAuthController::MaybeGenerateAuthToken(
const HttpRequestInfo* request,
const CompletionCallback& callback,
const NetLogWithSource& net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!auth_info_);
bool needs_auth = HaveAuth() || SelectPreemptiveAuth(net_log);
if (!needs_auth)
@@ -170,7 +170,7 @@ int HttpAuthController::MaybeGenerateAuthToken(
}
bool HttpAuthController::SelectPreemptiveAuth(const NetLogWithSource& net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!HaveAuth());
DCHECK(identity_.invalid);
@@ -208,7 +208,7 @@ bool HttpAuthController::SelectPreemptiveAuth(const NetLogWithSource& net_log) {
void HttpAuthController::AddAuthorizationHeader(
HttpRequestHeaders* authorization_headers) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(HaveAuth());
// auth_token_ can be empty if we encountered a permanent error with
// the auth scheme and want to retry.
@@ -225,7 +225,7 @@ int HttpAuthController::HandleAuthChallenge(
bool do_not_send_server_auth,
bool establishing_tunnel,
const NetLogWithSource& net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(headers.get());
DCHECK(auth_origin_.is_valid());
DCHECK(!auth_info_);
@@ -339,7 +339,7 @@ int HttpAuthController::HandleAuthChallenge(
}
void HttpAuthController::ResetAuth(const AuthCredentials& credentials) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(identity_.invalid || credentials.Empty());
if (identity_.invalid) {
@@ -390,7 +390,7 @@ bool HttpAuthController::HaveAuth() const {
void HttpAuthController::InvalidateCurrentHandler(
InvalidateHandlerAction action) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(handler_.get());
if (action == INVALIDATE_HANDLER_AND_CACHED_CREDENTIALS)
@@ -402,7 +402,7 @@ void HttpAuthController::InvalidateCurrentHandler(
}
void HttpAuthController::InvalidateRejectedAuthFromCache() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(HaveAuth());
// Clear the cache entry for the identity we just failed on.
@@ -413,7 +413,7 @@ void HttpAuthController::InvalidateRejectedAuthFromCache() {
}
bool HttpAuthController::SelectNextAuthIdentityToTry() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(handler_.get());
DCHECK(identity_.invalid);
@@ -462,7 +462,7 @@ bool HttpAuthController::SelectNextAuthIdentityToTry() {
}
void HttpAuthController::PopulateAuthChallenge() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Populates response_.auth_challenge with the authentication challenge info.
// This info is consumed by URLRequestHttpJob::GetAuthChallengeInfo().
@@ -475,7 +475,7 @@ void HttpAuthController::PopulateAuthChallenge() {
}
int HttpAuthController::HandleGenerateTokenResult(int result) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
switch (result) {
// Occurs if the credential handle is found to be invalid at the point it is
// exercised (i.e. GenerateAuthToken stage). We are going to consider this
@@ -524,7 +524,7 @@ int HttpAuthController::HandleGenerateTokenResult(int result) {
}
void HttpAuthController::OnGenerateAuthTokenDone(int result) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
result = HandleGenerateTokenResult(result);
if (!callback_.is_null()) {
CompletionCallback c = callback_;
@@ -534,27 +534,27 @@ void HttpAuthController::OnGenerateAuthTokenDone(int result) {
}
scoped_refptr<AuthChallengeInfo> HttpAuthController::auth_info() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return auth_info_;
}
bool HttpAuthController::IsAuthSchemeDisabled(HttpAuth::Scheme scheme) const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return disabled_schemes_.find(scheme) != disabled_schemes_.end();
}
void HttpAuthController::DisableAuthScheme(HttpAuth::Scheme scheme) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
disabled_schemes_.insert(scheme);
}
void HttpAuthController::DisableEmbeddedIdentity() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
embedded_identity_used_ = true;
}
void HttpAuthController::OnConnectionClosed() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
InvalidateCurrentHandler(INVALIDATE_HANDLER);
}

Powered by Google App Engine
This is Rietveld 408576698