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

Side by Side Diff: sync/internal_api/public/internal_components_factory.h

Issue 19309002: sync: Add pre-commit update avoidance mode + flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 // InternalComponentsFactory exists so that tests can override creation of 5 // InternalComponentsFactory exists so that tests can override creation of
6 // components used by the SyncManager that are not exposed across the sync 6 // components used by the SyncManager that are not exposed across the sync
7 // API boundary. 7 // API boundary.
8 8
9 #ifndef SYNC_INTERNAL_API_PUBLIC_INTERNAL_COMPONENTS_FACTORY_H_ 9 #ifndef SYNC_INTERNAL_API_PUBLIC_INTERNAL_COMPONENTS_FACTORY_H_
10 #define SYNC_INTERNAL_API_PUBLIC_INTERNAL_COMPONENTS_FACTORY_H_ 10 #define SYNC_INTERNAL_API_PUBLIC_INTERNAL_COMPONENTS_FACTORY_H_
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 }; 43 };
44 44
45 enum BackoffOverride { 45 enum BackoffOverride {
46 BACKOFF_NORMAL, 46 BACKOFF_NORMAL,
47 // Use this value for integration testing to avoid long delays / 47 // Use this value for integration testing to avoid long delays /
48 // timing out tests. Uses kInitialBackoffShortRetrySeconds (see 48 // timing out tests. Uses kInitialBackoffShortRetrySeconds (see
49 // polling_constants.h) for all initial retries. 49 // polling_constants.h) for all initial retries.
50 BACKOFF_SHORT_INITIAL_RETRY_OVERRIDE 50 BACKOFF_SHORT_INITIAL_RETRY_OVERRIDE
51 }; 51 };
52 52
53 enum PreCommitUpdatesPolicy {
54 // By default, the server will enable or disable this experiment through the
55 // sync protocol's experiments data type.
56 SERVER_CONTROLLED_PRE_COMMIT_UPDATE_AVOIANCE,
57
58 // This flag overrides the server's decision and enables the pre-commit
59 // update avoidance experiment.
60 FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE,
61 };
62
53 // Configuration options for internal components. This struct is expected 63 // Configuration options for internal components. This struct is expected
54 // to grow and shrink over time with transient features / experiments, 64 // to grow and shrink over time with transient features / experiments,
55 // roughly following command line flags in chrome. Implementations of 65 // roughly following command line flags in chrome. Implementations of
56 // InternalComponentsFactory can use this information to build components 66 // InternalComponentsFactory can use this information to build components
57 // with appropriate bells and whistles. 67 // with appropriate bells and whistles.
58 struct Switches { 68 struct Switches {
59 EncryptionMethod encryption_method; 69 EncryptionMethod encryption_method;
60 BackoffOverride backoff_override; 70 BackoffOverride backoff_override;
71 PreCommitUpdatesPolicy pre_commit_updates_policy;
61 }; 72 };
62 73
63 virtual ~InternalComponentsFactory() {} 74 virtual ~InternalComponentsFactory() {}
64 75
65 virtual scoped_ptr<SyncScheduler> BuildScheduler( 76 virtual scoped_ptr<SyncScheduler> BuildScheduler(
66 const std::string& name, 77 const std::string& name,
67 sessions::SyncSessionContext* context) = 0; 78 sessions::SyncSessionContext* context) = 0;
68 79
69 virtual scoped_ptr<sessions::SyncSessionContext> BuildContext( 80 virtual scoped_ptr<sessions::SyncSessionContext> BuildContext(
70 ServerConnectionManager* connection_manager, 81 ServerConnectionManager* connection_manager,
(...skipping 11 matching lines...) Expand all
82 const base::FilePath& backing_filepath) = 0; 93 const base::FilePath& backing_filepath) = 0;
83 94
84 // Returns the Switches struct that this object is using as configuration, if 95 // Returns the Switches struct that this object is using as configuration, if
85 // the implementation is making use of one. 96 // the implementation is making use of one.
86 virtual Switches GetSwitches() const = 0; 97 virtual Switches GetSwitches() const = 0;
87 }; 98 };
88 99
89 } // namespace syncer 100 } // namespace syncer
90 101
91 #endif // SYNC_INTERNAL_API_PUBLIC_INTERNAL_COMPONENTS_FACTORY_H_ 102 #endif // SYNC_INTERNAL_API_PUBLIC_INTERNAL_COMPONENTS_FACTORY_H_
OLDNEW
« no previous file with comments | « sync/internal_api/internal_components_factory_impl.cc ('k') | sync/internal_api/public/util/experiments.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698