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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/notifier/chrome_system_resources.h
diff --git a/chrome/browser/sync/notifier/chrome_system_resources.h b/chrome/browser/sync/notifier/chrome_system_resources.h
new file mode 100644
index 0000000000000000000000000000000000000000..a8a98df9e387fdd664c4bab6d8e40f33d4a49fc5
--- /dev/null
+++ b/chrome/browser/sync/notifier/chrome_system_resources.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Simple system resources class that uses the current message loop
+// for scheduling. Assumes the current message loop is already
+// running.
+
+#ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_
+#define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_
+
+#include "google/cacheinvalidation/invalidation-client.h"
+
+namespace sync_notifier {
+
+// TODO(akalin): Add a NonThreadSafe member to this class and use it.
+
+class ChromeSystemResources : public invalidation::SystemResources {
+ public:
+ ChromeSystemResources();
+
+ ~ChromeSystemResources();
+
+ virtual invalidation::Time current_time();
+
+ virtual void StartScheduler();
+
+ // We assume that the current message loop is stopped shortly after
+ // this is called, i.e. that any in-flight delayed tasks won't get
+ // run.
+ //
+ // TODO(akalin): Make sure that the above actually holds. Use a
+ // ScopedRunnableMethodFactory for better safety.
+ virtual void StopScheduler();
+
+ virtual void ScheduleWithDelay(invalidation::TimeDelta delay,
+ invalidation::Closure* task);
+
+ virtual void ScheduleImmediately(invalidation::Closure* task);
+
+ virtual void Log(LogLevel level, const char* file, int line,
+ const char* format, ...);
+
+ private:
+ bool scheduler_active_;
+};
+
+} // namespace sync_notifier
+
+#endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_SYSTEM_RESOURCES_H_
« 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