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

Side by Side Diff: chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h

Issue 34523003: settings: Make DeviceOAuth2TokenServiceFactory::Get() async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
9 10
10 namespace chromeos { 11 namespace chromeos {
11 12
12 class DeviceOAuth2TokenService; 13 class DeviceOAuth2TokenService;
13 14
14 class DeviceOAuth2TokenServiceFactory { 15 class DeviceOAuth2TokenServiceFactory {
15 public: 16 public:
16 // Returns the instance of the DeviceOAuth2TokenService singleton. 17 // Callback type used for Get() function.
17 // May return null during browser startup and shutdown. Do not hold 18 typedef base::Callback<void(DeviceOAuth2TokenService*)> GetCallback;
18 // the pointer returned by this method; call this method every time 19
19 // and check for null to handle the case where this instance is destroyed 20 // Returns the instance of the DeviceOAuth2TokenService singleton via the
20 // during shutdown. 21 // given callback. This function is asynchronous as initializing
21 static DeviceOAuth2TokenService* Get(); 22 // DeviceOAuth2TokenService involves asynchronous D-Bus method calls.
23 //
24 // May return null during browser startup and shutdown. Do not hold the
pneubeck (no reviews) 2013/10/22 09:05:03 nit: null -> NULL
satorux1 2013/10/22 09:56:43 will fix.
satorux1 2013/10/23 06:35:44 Done.
25 // pointer returned by this method; call this method every time and check
26 // for null to handle the case where this instance is destroyed during
pneubeck (no reviews) 2013/10/22 09:05:03 dito
satorux1 2013/10/22 09:56:43 will fix.
satorux1 2013/10/23 06:35:44 Done.
27 // shutdown.
28 static void Get(const GetCallback& callback);
22 29
23 // Called by ChromeBrowserMainPartsChromeOS in order to bootstrap the 30 // Called by ChromeBrowserMainPartsChromeOS in order to bootstrap the
24 // DeviceOAuth2TokenService instance after the required global data is 31 // DeviceOAuth2TokenService instance after the required global data is
25 // available (local state and request context getter). 32 // available (local state and request context getter).
26 static void Initialize(); 33 static void Initialize();
27 34
28 // Called by ChromeBrowserMainPartsChromeOS in order to shutdown the 35 // Called by ChromeBrowserMainPartsChromeOS in order to shutdown the
29 // DeviceOAuth2TokenService instance and cancel all in-flight requests 36 // DeviceOAuth2TokenService instance and cancel all in-flight requests
30 // before the required global data is destroyed (local state and request 37 // before the required global data is destroyed (local state and request
31 // context getter). 38 // context getter).
32 static void Shutdown(); 39 static void Shutdown();
33 40
34 private: 41 private:
35 DeviceOAuth2TokenServiceFactory(); 42 DeviceOAuth2TokenServiceFactory();
43 ~DeviceOAuth2TokenServiceFactory();
44
45 DeviceOAuth2TokenService* token_service_;
36 46
37 DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenServiceFactory); 47 DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenServiceFactory);
38 }; 48 };
39 49
40 } // namespace chromeos 50 } // namespace chromeos
41 51
42 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_ H_ 52 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_OAUTH2_TOKEN_SERVICE_FACTORY_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698