OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef PPAPI_PROXY_PPB_MESSAGE_LOOP_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_MESSAGE_LOOP_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_MESSAGE_LOOP_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_MESSAGE_LOOP_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 virtual int32_t PostWork(PP_CompletionCallback callback, | 37 virtual int32_t PostWork(PP_CompletionCallback callback, |
38 int64_t delay_ms) OVERRIDE; | 38 int64_t delay_ms) OVERRIDE; |
39 virtual int32_t PostQuit(PP_Bool should_destroy) OVERRIDE; | 39 virtual int32_t PostQuit(PP_Bool should_destroy) OVERRIDE; |
40 | 40 |
41 static MessageLoopResource* GetCurrent(); | 41 static MessageLoopResource* GetCurrent(); |
42 void DetachFromThread(); | 42 void DetachFromThread(); |
43 bool is_main_thread_loop() const { | 43 bool is_main_thread_loop() const { |
44 return is_main_thread_loop_; | 44 return is_main_thread_loop_; |
45 } | 45 } |
46 | 46 |
| 47 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy() { |
| 48 return loop_proxy_; |
| 49 } |
| 50 |
47 private: | 51 private: |
48 struct TaskInfo { | 52 struct TaskInfo { |
49 tracked_objects::Location from_here; | 53 tracked_objects::Location from_here; |
50 base::Closure closure; | 54 base::Closure closure; |
51 int64 delay_ms; | 55 int64 delay_ms; |
52 }; | 56 }; |
53 | 57 |
54 // Returns true if the object is associated with the current thread. | 58 // Returns true if the object is associated with the current thread. |
55 bool IsCurrent() const; | 59 bool IsCurrent() const; |
56 | 60 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 static const PPB_MessageLoop_1_0* GetInterface(); | 108 static const PPB_MessageLoop_1_0* GetInterface(); |
105 | 109 |
106 private: | 110 private: |
107 DISALLOW_COPY_AND_ASSIGN(PPB_MessageLoop_Proxy); | 111 DISALLOW_COPY_AND_ASSIGN(PPB_MessageLoop_Proxy); |
108 }; | 112 }; |
109 | 113 |
110 } // namespace proxy | 114 } // namespace proxy |
111 } // namespace ppapi | 115 } // namespace ppapi |
112 | 116 |
113 #endif // PPAPI_PROXY_PPB_MESSAGE_LOOP_PROXY_H_ | 117 #endif // PPAPI_PROXY_PPB_MESSAGE_LOOP_PROXY_H_ |
OLD | NEW |