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

Unified Diff: chrome/browser/sync/engine/syncer.cc

Issue 6286067: sync: add a SyncSessionJobPurpose for clearing sync user data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: whitespace Created 9 years, 11 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/engine/syncer.cc
diff --git a/chrome/browser/sync/engine/syncer.cc b/chrome/browser/sync/engine/syncer.cc
index b436c660de79f66d09db6922490850287a722c11..9ca668e227246768754e0df5a2d2f979b9db1c67 100644
--- a/chrome/browser/sync/engine/syncer.cc
+++ b/chrome/browser/sync/engine/syncer.cc
@@ -70,6 +70,7 @@ void Syncer::RequestEarlyExit() {
early_exit_requested_ = true;
}
+// TODO(tim): Deprecated.
void Syncer::SyncShare(sessions::SyncSession* session) {
ScopedDirLookup dir(session->context()->directory_manager(),
session->context()->account_name());
@@ -82,17 +83,6 @@ void Syncer::SyncShare(sessions::SyncSession* session) {
SyncShare(session, CLEAR_PRIVATE_DATA, SYNCER_END);
return;
} else {
- // This isn't perfect, as we can end up bundling extensions activity
- // intended for the next session into the current one. We could do a
- // test-and-reset as with the source, but note that also falls short if
- // the commit request fails (e.g. due to lost connection), as we will
- // fall all the way back to the syncer thread main loop in that case, and
- // wind up creating a new session when a connection is established, losing
- // the records set here on the original attempt. This should provide us
- // with the right data "most of the time", and we're only using this for
- // analysis purposes, so Law of Large Numbers FTW.
- session->context()->extensions_monitor()->GetAndClearRecords(
- session->mutable_extensions_activity());
SyncShare(session, SYNCER_BEGIN, SYNCER_END);
}
}
@@ -100,6 +90,11 @@ void Syncer::SyncShare(sessions::SyncSession* session) {
void Syncer::SyncShare(sessions::SyncSession* session,
const SyncerStep first_step,
const SyncerStep last_step) {
+ ScopedDirLookup dir(session->context()->directory_manager(),
+ session->context()->account_name());
+ // The directory must be good here.
+ CHECK(dir.good());
+
ScopedSessionContextConflictResolver scoped(session->context(),
&resolver_);
SyncerStep current_step = first_step;
@@ -109,6 +104,17 @@ void Syncer::SyncShare(sessions::SyncSession* session,
switch (current_step) {
case SYNCER_BEGIN:
VLOG(1) << "Syncer Begin";
+ // This isn't perfect, as we can end up bundling extensions activity
+ // intended for the next session into the current one. We could do a
+ // test-and-reset as with the source, but note that also falls short if
+ // the commit request fails (e.g. due to lost connection), as we will
+ // fall all the way back to the syncer thread main loop in that case,
+ // creating a new session when a connection is established, losing the
+ // records set here on the original attempt. This should provide us
+ // with the right data "most of the time", and we're only using this
+ // for analysis purposes, so Law of Large Numbers FTW.
+ session->context()->extensions_monitor()->GetAndClearRecords(
+ session->mutable_extensions_activity());
next_step = CLEANUP_DISABLED_TYPES;
break;
case CLEANUP_DISABLED_TYPES: {

Powered by Google App Engine
This is Rietveld 408576698