Introduce ConfigureContext struct

This struct allows easy plumbing of fields that are representative of
why a datatype is running. This avoids the need to inject SyncClient
in multiple places, which is undesirable because it carries over a long
list of dependencies, including a subtle dependency cycle in some cases
(DeviceInfo) that needs a workaround (the controller's delegate must be
obtained lazily).

We plan to extend this struct with new state information in follow-up
patches.

Bug: 866814,867801
Change-Id: I35142c3a04f2f5abba22a5ec23d475c8da8bd292
Reviewed-on: https://chromium-review.googlesource.com/1154532
Reviewed-by: Vasilii Sukhanov <[email protected]>
Reviewed-by: Sebastien Seguin-Gagnon <[email protected]>
Reviewed-by: Marc Treib <[email protected]>
Commit-Queue: Mikel Astiz <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579705}
diff --git a/components/sync/driver/configure_context.h b/components/sync/driver/configure_context.h
new file mode 100644
index 0000000..16e403a
--- /dev/null
+++ b/components/sync/driver/configure_context.h
@@ -0,0 +1,31 @@
+// Copyright 2018 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 COMPONENTS_SYNC_DRIVER_CONFIGURE_CONTEXT_H_
+#define COMPONENTS_SYNC_DRIVER_CONFIGURE_CONTEXT_H_
+
+#include <string>
+
+#include "components/sync/engine/configure_reason.h"
+
+namespace syncer {
+
+// Struct describing in which context sync was enabled, including state that can
+// be assumed to be fixed while sync is enabled (or, more precisely, is
+// representative of the last (re)configuration request). It's built by
+// ProfileSyncService and plumbed through DataTypeManager until datatype
+// controllers, which for USS datatypes propagate analogous information to the
+// processor/bridge via DataTypeActivationRequest.
+struct ConfigureContext {
+  std::string authenticated_account_id;
+  std::string cache_guid;
+  ConfigureReason reason = CONFIGURE_REASON_UNKNOWN;
+  // TODO(mastiz): Consider adding |requested_types| here, but currently there
+  // are subtle differences across layers (e.g. where control types are
+  // enforced).
+};
+
+}  // namespace syncer
+
+#endif  // COMPONENTS_SYNC_DRIVER_CONFIGURE_CONTEXT_H_