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

Issue 12210109: Call batch/incremental fetch with more strict conditions (Closed)

Created:
7 years, 10 months ago by kinuko
Modified:
7 years, 10 months ago
Reviewers:
tzik
CC:
chromium-reviews, tzik+watch_chromium.org, kinuko+watch
Visibility:
Public.

Description

Call batch/incremental fetch with more strict conditions - Deprecate is_fetching_changes_ flag - Add a new flag: may_have_unfetched_changes_ which is turned on at the beginning and when an event is fired - Call StartBatchSyncForOrigin() and FetchChangesForIncrementalSync() only from MaybeStartFetchTask() with more strict conditions. Partialy integrating the change proposal made by tzik: https://codereview.chromium.org/12221088/ * It ALWAYS sets may_have_unfetched_changes_ true and call MaybeStartFetchTask() in XMPP/Timer/Auth/Network event handlers, so it has to be able to kick StartBatchSyncForOrigin() or FetchChangesForIncrementalSync() whenever an event happens even if the service state is in TEMPORARY_UNAVAILABLE. * It ALWAYS sets may_have_unfetched_changes_ false in StartBatchSyncForOrigin() and FetchChangesForIncrementalSync(), so that it won't get stuck in an infinite loop calling one of the methods again and again when the service state is TEMPORARY_UNAVAILABLE (e.g. network is offline). * It does NOT queue fetch tasks to the pending_tasks_ when another task is running, so the service has not to be overloaded by unifinished pending fetch tasks. * NotifyTaskDone() ALWAYS calls SchedulePolling() (which starts the timer if it hasn't been started) so it should not miss the tminigs where one of fetch-change methods have to be called. == State transition map: { OK, !batch.empty(), _ } -> NotifyTaskDone() calls StartBatchSyncForOrigin() until batch.empty() becomes true { TEMPORARY_UNAVAILABLE, !batch.empty(), _ } -> NotifyTaskDone() calls nothing -> XMPP/Timer/Auth/Network event handler calls StartBatchSyncForOrigin() if no task is running, otherwise let NotifyTaskDone() call it at most once { !DISABLED, batch.empty(), !incremental.empty() } -> NotifyTaskDone() calls nothing -> XMPP/Timer/Auth/Network event handler calls FetchChangesForIncrementalSync() if no task is running, otherwise let NotifyTaskDone() call it at most once BUG=175047 TEST=manual Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=181851

Patch Set 1 #

Patch Set 2 : test fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -83 lines) Patch
M chrome/browser/sync_file_system/drive_file_sync_service.h View 3 chunks +25 lines, -3 lines 0 comments Download
M chrome/browser/sync_file_system/drive_file_sync_service.cc View 1 19 chunks +68 lines, -79 lines 0 comments Download
M chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc View 1 2 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
kinuko
wdyt
7 years, 10 months ago (2013-02-11 13:17:29 UTC) #1
tzik
lgtm
7 years, 10 months ago (2013-02-12 03:36:38 UTC) #2
kinuko
7 years, 10 months ago (2013-02-12 04:48:06 UTC) #3
Thanks, ok I'm submitting this now...

Powered by Google App Engine
This is Rietveld 408576698