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

Side by Side Diff: chrome/browser/sync/engine/syncer_thread.cc

Issue 6104003: sync: use progress markers instead of timestamps during GetUpdates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tim's fixes 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/sync/engine/syncer_thread.h" 4 #include "chrome/browser/sync/engine/syncer_thread.h"
5 5
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 7
8 #if defined(OS_MACOSX) 8 #if defined(OS_MACOSX)
9 #include <CoreFoundation/CFNumber.h> 9 #include <CoreFoundation/CFNumber.h>
10 #include <IOKit/IOTypes.h> 10 #include <IOKit/IOTypes.h>
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 return_interval.poll_delta = silenced_until_ - TimeTicks::Now(); 465 return_interval.poll_delta = silenced_until_ - TimeTicks::Now();
466 return return_interval; 466 return return_interval;
467 } 467 }
468 468
469 bool is_continuing_sync_cyle = *continue_sync_cycle; 469 bool is_continuing_sync_cyle = *continue_sync_cycle;
470 *continue_sync_cycle = false; 470 *continue_sync_cycle = false;
471 471
472 // Determine if the syncer has unfinished work to do. 472 // Determine if the syncer has unfinished work to do.
473 SyncSessionSnapshot* snapshot = session_context_->previous_session_snapshot(); 473 SyncSessionSnapshot* snapshot = session_context_->previous_session_snapshot();
474 const bool syncer_has_work_to_do = snapshot && 474 const bool syncer_has_work_to_do = snapshot &&
475 (snapshot->num_server_changes_remaining > snapshot->max_local_timestamp || 475 (snapshot->num_server_changes_remaining > 0 ||
476 snapshot->unsynced_count > 0); 476 snapshot->unsynced_count > 0);
477 VLOG(1) << "syncer_has_work_to_do is " << syncer_has_work_to_do; 477 VLOG(1) << "syncer_has_work_to_do is " << syncer_has_work_to_do;
478 478
479 // First calculate the expected wait time, figuring in any backoff because of 479 // First calculate the expected wait time, figuring in any backoff because of
480 // user idle time. next_wait is in seconds 480 // user idle time. next_wait is in seconds
481 syncer_polling_interval_ = (!session_context_->notifications_enabled()) ? 481 syncer_polling_interval_ = (!session_context_->notifications_enabled()) ?
482 syncer_short_poll_interval_seconds_ : 482 syncer_short_poll_interval_seconds_ :
483 syncer_long_poll_interval_seconds_; 483 syncer_long_poll_interval_seconds_;
484 int default_next_wait = syncer_polling_interval_; 484 int default_next_wait = syncer_polling_interval_;
485 return_interval.poll_delta = TimeDelta::FromSeconds(default_next_wait); 485 return_interval.poll_delta = TimeDelta::FromSeconds(default_next_wait);
486 486
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 was_logged = true; 843 was_logged = true;
844 VLOG(1) << "UserIdleTime unimplemented on this platform, synchronization " 844 VLOG(1) << "UserIdleTime unimplemented on this platform, synchronization "
845 "will not throttle when user idle"; 845 "will not throttle when user idle";
846 } 846 }
847 #endif 847 #endif
848 848
849 return 0; 849 return 0;
850 } 850 }
851 851
852 } // namespace browser_sync 852 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_proto_util.cc ('k') | chrome/browser/sync/engine/syncer_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698