| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // Simple system resources class that uses the current message loop |
| 6 // for scheduling. Assumes the current message loop is already |
| 7 // running. |
| 8 |
| 9 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_ |
| 10 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_ |
| 11 |
| 12 #include "google/cacheinvalidation/invalidation-client.h" |
| 13 |
| 14 namespace sync_notifier { |
| 15 |
| 16 // TODO(akalin): Add a NonThreadSafe member to this class and use it. |
| 17 |
| 18 class ChromeSystemResources : public invalidation::SystemResources { |
| 19 public: |
| 20 ChromeSystemResources(); |
| 21 |
| 22 ~ChromeSystemResources(); |
| 23 |
| 24 virtual invalidation::Time current_time(); |
| 25 |
| 26 virtual void StartScheduler(); |
| 27 |
| 28 // We assume that the current message loop is stopped shortly after |
| 29 // this is called, i.e. that any in-flight delayed tasks won't get |
| 30 // run. |
| 31 // |
| 32 // TODO(akalin): Make sure that the above actually holds. Use a |
| 33 // ScopedRunnableMethodFactory for better safety. |
| 34 virtual void StopScheduler(); |
| 35 |
| 36 virtual void ScheduleWithDelay(invalidation::TimeDelta delay, |
| 37 invalidation::Closure* task); |
| 38 |
| 39 virtual void ScheduleImmediately(invalidation::Closure* task); |
| 40 |
| 41 virtual void Log(LogLevel level, const char* file, int line, |
| 42 const char* format, ...); |
| 43 |
| 44 private: |
| 45 bool scheduler_active_; |
| 46 }; |
| 47 |
| 48 } // namespace sync_notifier |
| 49 |
| 50 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_ |
| OLD | NEW |