OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef GIN_MODULES_TIMER_H_ | 5 #ifndef GIN_MODULES_TIMER_H_ |
6 #define GIN_MODULES_TIMER_H_ | 6 #define GIN_MODULES_TIMER_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "gin/gin_export.h" | 10 #include "gin/gin_export.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 void OnTimerFired(); | 39 void OnTimerFired(); |
40 | 40 |
41 base::WeakPtrFactory<Timer> weak_factory_; | 41 base::WeakPtrFactory<Timer> weak_factory_; |
42 base::Timer timer_; | 42 base::Timer timer_; |
43 base::WeakPtr<gin::Runner> runner_; | 43 base::WeakPtr<gin::Runner> runner_; |
44 }; | 44 }; |
45 | 45 |
46 | 46 |
47 class GIN_EXPORT TimerModule : public Wrappable<TimerModule> { | 47 class GIN_EXPORT TimerModule : public Wrappable<TimerModule> { |
48 public: | 48 public: |
| 49 static const char kName[]; |
49 static WrapperInfo kWrapperInfo; | 50 static WrapperInfo kWrapperInfo; |
50 static Handle<TimerModule> Create(v8::Isolate* isolate); | 51 static Handle<TimerModule> Create(v8::Isolate* isolate); |
51 static v8::Local<v8::Value> GetModule(v8::Isolate* isolate); | 52 static v8::Local<v8::Value> GetModule(v8::Isolate* isolate); |
52 | 53 |
53 private: | 54 private: |
54 TimerModule(); | 55 TimerModule(); |
55 virtual ~TimerModule(); | 56 virtual ~TimerModule(); |
56 | 57 |
57 virtual ObjectTemplateBuilder GetObjectTemplateBuilder( | 58 virtual ObjectTemplateBuilder GetObjectTemplateBuilder( |
58 v8::Isolate* isolate) OVERRIDE; | 59 v8::Isolate* isolate) OVERRIDE; |
59 }; | 60 }; |
60 | 61 |
61 } // namespace gin | 62 } // namespace gin |
62 | 63 |
63 #endif // GIN_MODULES_TIMER_H_ | 64 #endif // GIN_MODULES_TIMER_H_ |
OLD | NEW |