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

Side by Side Diff: core/scheduler.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « core/google_update_core_unittest.cc ('k') | core/scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2007-2009 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 // ========================================================================
15
16 // TODO(omaha): consider using a waitable timer registered with the reactor. It
17 // seems a lot less code than using the QueueTimer class.
18
19 #ifndef OMAHA_CORE_SCHEDULER_H__
20 #define OMAHA_CORE_SCHEDULER_H__
21
22 #include <windows.h>
23 #include <atlstr.h>
24 #include "base/basictypes.h"
25 #include "base/scoped_ptr.h"
26
27 namespace omaha {
28
29 class Core;
30 class HighresTimer;
31 class QueueTimer;
32
33 class Scheduler {
34 public:
35 explicit Scheduler(const Core& core);
36 ~Scheduler();
37
38 // Starts the scheduler.
39 HRESULT Initialize();
40
41 private:
42 static void TimerCallback(QueueTimer* timer);
43 void HandleCallback(QueueTimer* timer);
44 HRESULT ScheduleUpdateTimer(int interval_ms);
45 HRESULT ScheduleCodeRedTimer(int interval_ms);
46
47 const Core& core_;
48 HANDLE timer_queue_;
49 scoped_ptr<QueueTimer> update_timer_;
50 scoped_ptr<QueueTimer> code_red_timer_;
51
52 // Measures the actual time interval between code red events for debugging
53 // purposes. The timer is started when a code red alarm is set and then,
54 // the value of the timer is read when the alarm goes off.
55 scoped_ptr<HighresTimer> cr_debug_timer_;
56
57 DISALLOW_EVIL_CONSTRUCTORS(Scheduler);
58 };
59
60 } // namespace omaha
61
62 #endif // OMAHA_CORE_SCHEDULER_H__
63
OLDNEW
« no previous file with comments | « core/google_update_core_unittest.cc ('k') | core/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698