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

Unified Diff: chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc

Issue 2767893002: Remove ScopedVector from chrome/browser/. (Closed)
Patch Set: Address comments from zea@ Created 3 years, 9 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: chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc
diff --git a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc
index acc89315592ea77ae1fc652cbcca4a2efae70ae5..9528395967148be3d1225a10958de5ddc75668ea 100644
--- a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc
+++ b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/profiler/scoped_tracker.h"
#include "components/signin/core/browser/signin_client.h"
#include "components/signin/core/browser/signin_metrics.h"
@@ -100,9 +101,13 @@ void MutableProfileOAuth2TokenServiceDelegate::RevokeServerRefreshToken::
OnOAuth2RevokeTokenCompleted() {
// |this| pointer will be deleted when removed from the vector, so don't
// access any members after call to erase().
- token_service_delegate_->server_revokes_.erase(
- std::find(token_service_delegate_->server_revokes_.begin(),
- token_service_delegate_->server_revokes_.end(), this));
+ token_service_delegate_->server_revokes_.erase(std::find_if(
+ token_service_delegate_->server_revokes_.begin(),
+ token_service_delegate_->server_revokes_.end(),
+ [this](const std::unique_ptr<MutableProfileOAuth2TokenServiceDelegate::
+ RevokeServerRefreshToken>& item) {
+ return item.get() == this;
+ }));
}
MutableProfileOAuth2TokenServiceDelegate::AccountStatus::AccountStatus(
@@ -542,7 +547,8 @@ void MutableProfileOAuth2TokenServiceDelegate::RevokeCredentialsOnServer(
const std::string& refresh_token) {
// Keep track or all server revoke requests. This way they can be deleted
// before the token service is shutdown and won't outlive the profile.
- server_revokes_.push_back(new RevokeServerRefreshToken(this, refresh_token));
+ server_revokes_.push_back(
+ base::MakeUnique<RevokeServerRefreshToken>(this, refresh_token));
}
void MutableProfileOAuth2TokenServiceDelegate::CancelWebTokenFetch() {
« no previous file with comments | « chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h ('k') | chrome/browser/site_details_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698