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

Unified Diff: chrome/browser/sync/glue/local_device_info_provider.h

Issue 367153005: Sync: Refactoring of DEVICE_INFO syncable type - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed build issues in browser_tests Created 6 years, 5 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/sync/glue/local_device_info_provider.h
diff --git a/chrome/browser/sync/glue/local_device_info_provider.h b/chrome/browser/sync/glue/local_device_info_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..fb8d52eaa4add1b7a5793b886f79d57241d839ac
--- /dev/null
+++ b/chrome/browser/sync/glue/local_device_info_provider.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_H_
+#define CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_H_
+
+#include <string>
+#include "base/callback_list.h"
+
+namespace browser_sync {
+
+class DeviceInfo;
+
+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.
+ public:
+ typedef base::CallbackList<void(void)>::Subscription Subscription;
+
+ // Returns sync's representation of the local device info.
+ // Return value is an empty scoped_ptr if the device info is unavailable.
+ 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
+
+ // Used for creation of the machine tag for this local session.
+ 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.
+
+ // Specifies whether local device info is available
+ 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
+
+ // Registers a callback to be called when local device info becomes available
+ 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
+ const base::Closure& callback) = 0;
+};
+
+} // namespace browser_sync
+
+#endif // CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698