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

Side by Side Diff: sync/sessions/sync_session_context.h

Issue 1991973002: [Sync] Add histograms for cookie jar state on Sessions commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 years, 7 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
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 // SyncSessionContext encapsulates the contextual information and engine 5 // SyncSessionContext encapsulates the contextual information and engine
6 // components specific to a SyncSession. Unlike the SyncSession, the context 6 // components specific to a SyncSession. Unlike the SyncSession, the context
7 // can be reused across several sync cycles. 7 // can be reused across several sync cycles.
8 // 8 //
9 // The context does not take ownership of its pointer members. It's up to 9 // The context does not take ownership of its pointer members. It's up to
10 // the surrounding classes to ensure those members remain valid while the 10 // the surrounding classes to ensure those members remain valid while the
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 128
129 bool cookie_jar_mismatch() const { 129 bool cookie_jar_mismatch() const {
130 return cookie_jar_mismatch_; 130 return cookie_jar_mismatch_;
131 } 131 }
132 132
133 void set_cookie_jar_mismatch(bool cookie_jar_mismatch) { 133 void set_cookie_jar_mismatch(bool cookie_jar_mismatch) {
134 cookie_jar_mismatch_ = cookie_jar_mismatch; 134 cookie_jar_mismatch_ = cookie_jar_mismatch;
135 } 135 }
136 136
137 bool cookie_jar_empty() const {
138 return cookie_jar_empty_;
139 }
140
141 void set_cookie_jar_empty(bool empty_jar) {
142 cookie_jar_empty_ = empty_jar;
143 }
144
137 private: 145 private:
138 // Rather than force clients to set and null-out various context members, we 146 // Rather than force clients to set and null-out various context members, we
139 // extend our encapsulation boundary to scoped helpers that take care of this 147 // extend our encapsulation boundary to scoped helpers that take care of this
140 // once they are allocated. See definitions of these below. 148 // once they are allocated. See definitions of these below.
141 friend class TestScopedSessionEventListener; 149 friend class TestScopedSessionEventListener;
142 150
143 base::ObserverList<SyncEngineEventListener> listeners_; 151 base::ObserverList<SyncEngineEventListener> listeners_;
144 152
145 ServerConnectionManager* const connection_manager_; 153 ServerConnectionManager* const connection_manager_;
146 syncable::Directory* const directory_; 154 syncable::Directory* const directory_;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 194
187 // If true, indicates that we've been passed a command-line flag to force 195 // If true, indicates that we've been passed a command-line flag to force
188 // enable the pre-commit update avoidance experiment described above. 196 // enable the pre-commit update avoidance experiment described above.
189 const bool client_enabled_pre_commit_update_avoidance_; 197 const bool client_enabled_pre_commit_update_avoidance_;
190 198
191 // Whether the account(s) present in the content area's cookie jar match the 199 // Whether the account(s) present in the content area's cookie jar match the
192 // chrome account. If multiple accounts are present in the cookie jar, a 200 // chrome account. If multiple accounts are present in the cookie jar, a
193 // mismatch implies all of them are different from the chrome account. 201 // mismatch implies all of them are different from the chrome account.
194 bool cookie_jar_mismatch_; 202 bool cookie_jar_mismatch_;
195 203
204 // If there's a cookie jar mismatch, whether the cookie jar was empty or not.
205 bool cookie_jar_empty_;
206
196 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); 207 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext);
197 }; 208 };
198 209
199 } // namespace sessions 210 } // namespace sessions
200 } // namespace syncer 211 } // namespace syncer
201 212
202 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ 213 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698