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

Side by Side Diff: chrome/browser/sync_file_system/sync_process_runner.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/sync_file_system/sync_process_runner.h" 5 #include "chrome/browser/sync_file_system/sync_process_runner.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "chrome/browser/sync_file_system/logger.h" 8 #include "chrome/browser/sync_file_system/logger.h"
9 9
10 namespace sync_file_system { 10 namespace sync_file_system {
(...skipping 21 matching lines...) Expand all
32 const base::TimeDelta& delay, 32 const base::TimeDelta& delay,
33 const base::Closure& closure) override { 33 const base::Closure& closure) override {
34 timer_.Start(from_here, delay, closure); 34 timer_.Start(from_here, delay, closure);
35 } 35 }
36 36
37 base::TimeTicks Now() const override { return base::TimeTicks::Now(); } 37 base::TimeTicks Now() const override { return base::TimeTicks::Now(); }
38 38
39 ~BaseTimerHelper() override {} 39 ~BaseTimerHelper() override {}
40 40
41 private: 41 private:
42 base::OneShotTimer<SyncProcessRunner> timer_; 42 base::OneShotTimer timer_;
43 43
44 DISALLOW_COPY_AND_ASSIGN(BaseTimerHelper); 44 DISALLOW_COPY_AND_ASSIGN(BaseTimerHelper);
45 }; 45 };
46 46
47 bool WasSuccessfulSync(SyncStatusCode status) { 47 bool WasSuccessfulSync(SyncStatusCode status) {
48 return status == SYNC_STATUS_OK || 48 return status == SYNC_STATUS_OK ||
49 status == SYNC_STATUS_HAS_CONFLICT || 49 status == SYNC_STATUS_HAS_CONFLICT ||
50 status == SYNC_STATUS_NO_CONFLICT || 50 status == SYNC_STATUS_NO_CONFLICT ||
51 status == SYNC_STATUS_NO_CHANGE_TO_SYNC || 51 status == SYNC_STATUS_NO_CHANGE_TO_SYNC ||
52 status == SYNC_STATUS_UNKNOWN_ORIGIN || 52 status == SYNC_STATUS_UNKNOWN_ORIGIN ||
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 FROM_HERE, next_scheduled - now, 233 FROM_HERE, next_scheduled - now,
234 base::Bind(&SyncProcessRunner::Run, base::Unretained(this))); 234 base::Bind(&SyncProcessRunner::Run, base::Unretained(this)));
235 } 235 }
236 236
237 void SyncProcessRunner::CheckIfIdle() { 237 void SyncProcessRunner::CheckIfIdle() {
238 if (pending_changes_ == 0 && running_tasks_ == 0) 238 if (pending_changes_ == 0 && running_tasks_ == 0)
239 client_->OnSyncIdle(); 239 client_->OnSyncIdle();
240 } 240 }
241 241
242 } // namespace sync_file_system 242 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698