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

Side by Side Diff: components/sync_driver/profile_sync_auth_provider.h

Issue 1907683003: Convert //components/sync_driver from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix, address feedback 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SYNC_DRIVER_PROFILE_SYNC_AUTH_PROVIDER_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_PROFILE_SYNC_AUTH_PROVIDER_H_
6 #define COMPONENTS_SYNC_DRIVER_PROFILE_SYNC_AUTH_PROVIDER_H_ 6 #define COMPONENTS_SYNC_DRIVER_PROFILE_SYNC_AUTH_PROVIDER_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "google_apis/gaia/oauth2_token_service.h" 13 #include "google_apis/gaia/oauth2_token_service.h"
14 #include "sync/internal_api/public/sync_auth_provider.h" 14 #include "sync/internal_api/public/sync_auth_provider.h"
15 15
16 class ProfileOAuth2TokenService; 16 class ProfileOAuth2TokenService;
17 17
18 namespace base { 18 namespace base {
19 class SingleThreadTaskRunner; 19 class SingleThreadTaskRunner;
20 } // namespace base 20 } // namespace base
21 21
(...skipping 17 matching lines...) Expand all
39 const GoogleServiceAuthError& error) override; 39 const GoogleServiceAuthError& error) override;
40 40
41 // Request access token from OAuth2TokenService. Once access token is received 41 // Request access token from OAuth2TokenService. Once access token is received
42 // result should be posted to callback on task_runner thread. 42 // result should be posted to callback on task_runner thread.
43 void RequestAccessToken( 43 void RequestAccessToken(
44 const syncer::SyncAuthProvider::RequestTokenCallback& callback, 44 const syncer::SyncAuthProvider::RequestTokenCallback& callback,
45 scoped_refptr<base::SingleThreadTaskRunner> task_runner); 45 scoped_refptr<base::SingleThreadTaskRunner> task_runner);
46 46
47 void InvalidateAccessToken(const std::string& token); 47 void InvalidateAccessToken(const std::string& token);
48 48
49 scoped_ptr<syncer::SyncAuthProvider> CreateProviderForSyncThread(); 49 std::unique_ptr<syncer::SyncAuthProvider> CreateProviderForSyncThread();
50 50
51 private: 51 private:
52 class SyncThreadProxy; 52 class SyncThreadProxy;
53 53
54 void RespondToTokenRequest(const GoogleServiceAuthError& error, 54 void RespondToTokenRequest(const GoogleServiceAuthError& error,
55 const std::string& token); 55 const std::string& token);
56 56
57 ProfileOAuth2TokenService* token_service_; 57 ProfileOAuth2TokenService* token_service_;
58 std::string account_id_; 58 std::string account_id_;
59 OAuth2TokenService::ScopeSet oauth2_scope_; 59 OAuth2TokenService::ScopeSet oauth2_scope_;
60 60
61 // Only one outstanding request is allowed. Previous request is reported 61 // Only one outstanding request is allowed. Previous request is reported
62 // cancelled if new one arrives. 62 // cancelled if new one arrives.
63 scoped_ptr<OAuth2TokenService::Request> access_token_request_; 63 std::unique_ptr<OAuth2TokenService::Request> access_token_request_;
64 syncer::SyncAuthProvider::RequestTokenCallback request_token_callback_; 64 syncer::SyncAuthProvider::RequestTokenCallback request_token_callback_;
65 scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner_; 65 scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner_;
66 66
67 base::WeakPtrFactory<ProfileSyncAuthProvider> weak_factory_; 67 base::WeakPtrFactory<ProfileSyncAuthProvider> weak_factory_;
68 68
69 DISALLOW_COPY_AND_ASSIGN(ProfileSyncAuthProvider); 69 DISALLOW_COPY_AND_ASSIGN(ProfileSyncAuthProvider);
70 }; 70 };
71 71
72 #endif // COMPONENTS_SYNC_DRIVER_PROFILE_SYNC_AUTH_PROVIDER_H_ 72 #endif // COMPONENTS_SYNC_DRIVER_PROFILE_SYNC_AUTH_PROVIDER_H_
OLDNEW
« no previous file with comments | « components/sync_driver/non_ui_model_type_controller_unittest.cc ('k') | components/sync_driver/profile_sync_auth_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698