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

Side by Side Diff: chrome/browser/sync/notifier/chrome_system_resources.h

Issue 2827014: Implemented initial version of server-issued notification client. (Closed)
Patch Set: Added DEPS Created 10 years, 6 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
(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_
OLDNEW
« no previous file with comments | « chrome/browser/sync/notifier/chrome_invalidation_client.cc ('k') | chrome/browser/sync/notifier/chrome_system_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698