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

Side by Side Diff: sync/notifier/sync_system_resources.h

Issue 14113050: sync: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 // Simple system resources class that uses the current message loop 5 // Simple system resources class that uses the current message loop
6 // for scheduling. Assumes the current message loop is already 6 // for scheduling. Assumes the current message loop is already
7 // running. 7 // running.
8 8
9 #ifndef SYNC_NOTIFIER_SYNC_SYSTEM_RESOURCES_H_ 9 #ifndef SYNC_NOTIFIER_SYNC_SYSTEM_RESOURCES_H_
10 #define SYNC_NOTIFIER_SYNC_SYSTEM_RESOURCES_H_ 10 #define SYNC_NOTIFIER_SYNC_SYSTEM_RESOURCES_H_
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 virtual invalidation::Time GetCurrentTime() const OVERRIDE; 62 virtual invalidation::Time GetCurrentTime() const OVERRIDE;
63 63
64 virtual void SetSystemResources( 64 virtual void SetSystemResources(
65 invalidation::SystemResources* resources) OVERRIDE; 65 invalidation::SystemResources* resources) OVERRIDE;
66 66
67 private: 67 private:
68 base::WeakPtrFactory<SyncInvalidationScheduler> weak_factory_; 68 base::WeakPtrFactory<SyncInvalidationScheduler> weak_factory_;
69 // Holds all posted tasks that have not yet been run. 69 // Holds all posted tasks that have not yet been run.
70 std::set<invalidation::Closure*> posted_tasks_; 70 std::set<invalidation::Closure*> posted_tasks_;
71 71
72 const MessageLoop* created_on_loop_; 72 const base::MessageLoop* created_on_loop_;
73 bool is_started_; 73 bool is_started_;
74 bool is_stopped_; 74 bool is_stopped_;
75 75
76 // Runs the task, deletes it, and removes it from |posted_tasks_|. 76 // Runs the task, deletes it, and removes it from |posted_tasks_|.
77 void RunPostedTask(invalidation::Closure* task); 77 void RunPostedTask(invalidation::Closure* task);
78 }; 78 };
79 79
80 class SyncStorage : public invalidation::Storage { 80 class SyncStorage : public invalidation::Storage {
81 public: 81 public:
82 SyncStorage(StateWriter* state_writer, invalidation::Scheduler* scheduler); 82 SyncStorage(StateWriter* state_writer, invalidation::Scheduler* scheduler);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 scoped_ptr<SyncLogger> logger_; 143 scoped_ptr<SyncLogger> logger_;
144 scoped_ptr<SyncInvalidationScheduler> internal_scheduler_; 144 scoped_ptr<SyncInvalidationScheduler> internal_scheduler_;
145 scoped_ptr<SyncInvalidationScheduler> listener_scheduler_; 145 scoped_ptr<SyncInvalidationScheduler> listener_scheduler_;
146 scoped_ptr<SyncStorage> storage_; 146 scoped_ptr<SyncStorage> storage_;
147 PushClientChannel push_client_channel_; 147 PushClientChannel push_client_channel_;
148 }; 148 };
149 149
150 } // namespace syncer 150 } // namespace syncer
151 151
152 #endif // SYNC_NOTIFIER_SYNC_SYSTEM_RESOURCES_H_ 152 #endif // SYNC_NOTIFIER_SYNC_SYSTEM_RESOURCES_H_
OLDNEW
« no previous file with comments | « sync/notifier/sync_invalidation_listener_unittest.cc ('k') | sync/notifier/sync_system_resources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698