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

Unified Diff: google_apis/gaia/oauth2_token_service_request.cc

Issue 1873663002: Convert //google_apis from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: google_apis/gaia/oauth2_token_service_request.cc
diff --git a/google_apis/gaia/oauth2_token_service_request.cc b/google_apis/gaia/oauth2_token_service_request.cc
index 819e3cab22b41529fbcb996914dac654b07c8790..2b90c0af5a3056003651a523dd112ada82c1cec2 100644
--- a/google_apis/gaia/oauth2_token_service_request.cc
+++ b/google_apis/gaia/oauth2_token_service_request.cc
@@ -4,11 +4,12 @@
#include "google_apis/gaia/oauth2_token_service_request.h"
+#include <memory>
+
#include "base/bind.h"
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "google_apis/gaia/google_service_auth_error.h"
@@ -192,7 +193,7 @@ class RequestCore : public OAuth2TokenServiceRequest::Core,
// OAuth2TokenService request for fetching OAuth2 access token; it should be
// created, reset and accessed only on the token service thread.
- scoped_ptr<OAuth2TokenService::Request> request_;
+ std::unique_ptr<OAuth2TokenService::Request> request_;
DISALLOW_COPY_AND_ASSIGN(RequestCore);
};
@@ -326,12 +327,13 @@ void InvalidateCore::StopOnTokenServiceThread() {
} // namespace
// static
-scoped_ptr<OAuth2TokenServiceRequest> OAuth2TokenServiceRequest::CreateAndStart(
+std::unique_ptr<OAuth2TokenServiceRequest>
+OAuth2TokenServiceRequest::CreateAndStart(
const scoped_refptr<TokenServiceProvider>& provider,
const std::string& account_id,
const OAuth2TokenService::ScopeSet& scopes,
OAuth2TokenService::Consumer* consumer) {
- scoped_ptr<OAuth2TokenServiceRequest> request(
+ std::unique_ptr<OAuth2TokenServiceRequest> request(
new OAuth2TokenServiceRequest(account_id));
scoped_refptr<Core> core(
new RequestCore(request.get(), provider, consumer, account_id, scopes));
@@ -345,7 +347,7 @@ void OAuth2TokenServiceRequest::InvalidateToken(
const std::string& account_id,
const OAuth2TokenService::ScopeSet& scopes,
const std::string& access_token) {
- scoped_ptr<OAuth2TokenServiceRequest> request(
+ std::unique_ptr<OAuth2TokenServiceRequest> request(
new OAuth2TokenServiceRequest(account_id));
scoped_refptr<Core> core(new InvalidateCore(
request.get(), provider, access_token, account_id, scopes));

Powered by Google App Engine
This is Rietveld 408576698