OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_H_ | |
6 #define CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_H_ | |
7 | |
8 #include <string> | |
9 #include "base/callback_list.h" | |
10 | |
11 namespace browser_sync { | |
12 | |
13 class DeviceInfo; | |
14 | |
15 class LocalDeviceInfoProvider { | |
maniscalco
2014/07/08 21:17:52
This would be a good place to describe the purpose
stanisc
2014/07/09 21:58:36
Done.
| |
16 public: | |
17 typedef base::CallbackList<void(void)>::Subscription Subscription; | |
18 | |
19 // Returns sync's representation of the local device info. | |
20 // Return value is an empty scoped_ptr if the device info is unavailable. | |
21 virtual const DeviceInfo* GetLocalDeviceInfo() const = 0; | |
maniscalco
2014/07/08 21:17:52
The comment mentions the returned value is a scope
stanisc
2014/07/09 21:58:36
Good catch. This comment was copied from the previ
| |
22 | |
23 // Used for creation of the machine tag for this local session. | |
24 virtual std::string GetLocalSyncCacheGUID() const = 0; | |
maniscalco
2014/07/08 21:17:52
Will this method return a non-empty string? Even
stanisc
2014/07/09 21:58:36
Added comment.
| |
25 | |
26 // Specifies whether local device info is available | |
27 virtual bool IsInitialized() const = 0; | |
maniscalco
2014/07/08 21:17:52
Is this method necessary? Given the description o
stanisc
2014/07/09 21:58:35
I guess you are right. It is somewhat redundant an
| |
28 | |
29 // Registers a callback to be called when local device info becomes available | |
30 virtual scoped_ptr<Subscription> RegisterOnInitializedCallback( | |
maniscalco
2014/07/08 21:17:52
What's the return value for? Does the lifetime of
stanisc
2014/07/09 21:58:36
This follows the callback subscription pattern des
| |
31 const base::Closure& callback) = 0; | |
32 }; | |
33 | |
34 } // namespace browser_sync | |
35 | |
36 #endif // CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_H_ | |
OLD | NEW |