Skip to content

Commit

Permalink
Fix a typo in an OAuth2TokenService classname
Browse files Browse the repository at this point in the history
Also fix some linter errors.

BUG=none
TEST=compiles

Review URL: https://codereview.chromium.org/681483003

Cr-Commit-Position: refs/heads/master@{#301378}
  • Loading branch information
jamescook authored and Commit bot committed Oct 27, 2014
1 parent cca5cc1 commit a3ea7ac
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/signin/android_profile_oauth2_token_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void AndroidProfileOAuth2TokenService::ValidateAccounts(
curr_ids.clear();
}

ScopedBacthChange batch(this);
ScopedBatchChange batch(this);

JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobjectArray> java_accounts(
Expand Down Expand Up @@ -431,7 +431,7 @@ void AndroidProfileOAuth2TokenService::FireRefreshTokensLoaded() {

void AndroidProfileOAuth2TokenService::RevokeAllCredentials() {
VLOG(1) << "AndroidProfileOAuth2TokenService::RevokeAllCredentials";
ScopedBacthChange batch(this);
ScopedBatchChange batch(this);
std::vector<std::string> accounts = GetAccounts();
for (std::vector<std::string>::iterator it = accounts.begin();
it != accounts.end(); it++) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/signin/fake_profile_oauth2_token_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void FakeProfileOAuth2TokenService::IssueRefreshToken(
void FakeProfileOAuth2TokenService::IssueRefreshTokenForUser(
const std::string& account_id,
const std::string& token) {
ScopedBacthChange batch(this);
ScopedBatchChange batch(this);
if (token.empty()) {
refresh_tokens_.erase(account_id);
FireRefreshTokenRevoked(account_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void MutableProfileOAuth2TokenService::LoadAllCredentialsIntoMemory(
std::string old_login_token;

{
ScopedBacthChange batch(this);
ScopedBatchChange batch(this);

for (std::map<std::string, std::string>::const_iterator iter =
db_tokens.begin();
Expand Down Expand Up @@ -319,7 +319,7 @@ void MutableProfileOAuth2TokenService::UpdateCredentials(
bool refresh_token_present = refresh_tokens_.count(account_id) > 0;
if (!refresh_token_present ||
refresh_tokens_[account_id]->refresh_token() != refresh_token) {
ScopedBacthChange batch(this);
ScopedBatchChange batch(this);

// If token present, and different from the new one, cancel its requests,
// and clear the entries in cache related to that account.
Expand Down Expand Up @@ -351,7 +351,7 @@ void MutableProfileOAuth2TokenService::RevokeCredentials(
DCHECK(thread_checker_.CalledOnValidThread());

if (refresh_tokens_.count(account_id) > 0) {
ScopedBacthChange batch(this);
ScopedBatchChange batch(this);
RevokeCredentialsOnServer(refresh_tokens_[account_id]->refresh_token());
CancelRequestsForAccount(account_id);
ClearCacheForAccount(account_id);
Expand Down Expand Up @@ -383,7 +383,7 @@ void MutableProfileOAuth2TokenService::RevokeAllCredentials() {
return;
DCHECK(thread_checker_.CalledOnValidThread());

ScopedBacthChange batch(this);
ScopedBatchChange batch(this);

CancelWebTokenFetch();
CancelAllRequests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void OnAccessTokenResponse(NSString* token,
void ProfileOAuth2TokenServiceIOS::ReloadCredentials() {
DCHECK(thread_checker_.CalledOnValidThread());

ScopedBacthChange batch(this);
ScopedBatchChange batch(this);

// Remove all old accounts that do not appear in |new_accounts| and then
// load |new_accounts|.
Expand Down Expand Up @@ -242,7 +242,7 @@ void OnAccessTokenResponse(NSString* token,
void ProfileOAuth2TokenServiceIOS::RevokeAllCredentials() {
DCHECK(thread_checker_.CalledOnValidThread());

ScopedBacthChange batch(this);
ScopedBatchChange batch(this);
CancelAllRequests();
ClearCache();
AccountInfoMap toRemove = accounts_;
Expand Down
6 changes: 3 additions & 3 deletions google_apis/gaia/oauth2_token_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ void OAuth2TokenService::RequestImpl::InformConsumer(
consumer_->OnGetTokenFailure(this, error);
}

OAuth2TokenService::ScopedBacthChange::ScopedBacthChange(
OAuth2TokenService::ScopedBatchChange::ScopedBatchChange(
OAuth2TokenService* token_service) : token_service_(token_service) {
DCHECK(token_service_);
token_service_->StartBatchChanges();
}

OAuth2TokenService::ScopedBacthChange::~ScopedBacthChange() {
OAuth2TokenService::ScopedBatchChange::~ScopedBatchChange() {
token_service_->EndBatchChanges();
}

Expand Down Expand Up @@ -150,7 +150,7 @@ class OAuth2TokenService::Fetcher : public OAuth2AccessTokenConsumer {
const GoogleServiceAuthError& error() const { return error_; }

protected:
// OAuth2AccessTokenConsumer
// OAuth2AccessTokenConsumer
void OnGetTokenSuccess(const std::string& access_token,
const base::Time& expiration_date) override;
void OnGetTokenFailure(const GoogleServiceAuthError& error) override;
Expand Down
12 changes: 6 additions & 6 deletions google_apis/gaia/oauth2_token_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class OAuth2TokenService : public base::NonThreadSafe {
// which will be called back when the request completes.
class Consumer {
public:
Consumer(const std::string& id);
explicit Consumer(const std::string& id);
virtual ~Consumer();

std::string id() const { return id_; }
Expand Down Expand Up @@ -214,7 +214,7 @@ class OAuth2TokenService : public base::NonThreadSafe {
public Request {
public:
// |consumer| is required to outlive this.
explicit RequestImpl(const std::string& account_id, Consumer* consumer);
RequestImpl(const std::string& account_id, Consumer* consumer);
~RequestImpl() override;

// Overridden from Request:
Expand All @@ -234,13 +234,13 @@ class OAuth2TokenService : public base::NonThreadSafe {
};

// Helper class to scope batch changes.
class ScopedBacthChange {
class ScopedBatchChange {
public:
ScopedBacthChange(OAuth2TokenService* token_service);
~ScopedBacthChange();
explicit ScopedBatchChange(OAuth2TokenService* token_service);
~ScopedBatchChange();
private:
OAuth2TokenService* token_service_; // Weak.
DISALLOW_COPY_AND_ASSIGN(ScopedBacthChange);
DISALLOW_COPY_AND_ASSIGN(ScopedBatchChange);
};

// Subclasses can override if they want to report errors to the user.
Expand Down

0 comments on commit a3ea7ac

Please sign in to comment.