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_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_ |
6 #define PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_ | 6 #define PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "ppapi/c/pp_instance.h" | 11 #include "ppapi/c/pp_instance.h" |
12 #include "ppapi/shared_impl/ppapi_shared_export.h" | 12 #include "ppapi/shared_impl/ppapi_shared_export.h" |
13 #include "ppapi/shared_impl/resource.h" | 13 #include "ppapi/shared_impl/resource.h" |
14 #include "ppapi/thunk/ppb_message_loop_api.h" | 14 #include "ppapi/thunk/ppb_message_loop_api.h" |
15 | 15 |
| 16 namespace base { |
| 17 class MessageLoopProxy; |
| 18 } |
| 19 |
16 namespace tracked_objects { | 20 namespace tracked_objects { |
17 class Location; | 21 class Location; |
18 } | 22 } |
19 | 23 |
20 namespace ppapi { | 24 namespace ppapi { |
21 | 25 |
22 // MessageLoopShared doesn't really do anything interesting. It exists so that | 26 // MessageLoopShared doesn't really do anything interesting. It exists so that |
23 // shared code (in particular, TrackedCallback) can keep a pointer to a | 27 // shared code (in particular, TrackedCallback) can keep a pointer to a |
24 // MessageLoop resource. In the host side, there is not a concrete class that | 28 // MessageLoop resource. In the host side, there is not a concrete class that |
25 // implements this. So pointers to MessageLoopShared can only really be valid | 29 // implements this. So pointers to MessageLoopShared can only really be valid |
(...skipping 11 matching lines...) Expand all Loading... |
37 | 41 |
38 // Handles posting to the message loop if there is one, or the pending queue | 42 // Handles posting to the message loop if there is one, or the pending queue |
39 // if there isn't. | 43 // if there isn't. |
40 // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock. | 44 // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock. |
41 // This only makes sense for user code and completely thread-safe | 45 // This only makes sense for user code and completely thread-safe |
42 // proxy operations (e.g., MessageLoop::QuitClosure). | 46 // proxy operations (e.g., MessageLoop::QuitClosure). |
43 virtual void PostClosure(const tracked_objects::Location& from_here, | 47 virtual void PostClosure(const tracked_objects::Location& from_here, |
44 const base::Closure& closure, | 48 const base::Closure& closure, |
45 int64 delay_ms) = 0; | 49 int64 delay_ms) = 0; |
46 | 50 |
| 51 virtual base::MessageLoopProxy* GetMessageLoopProxy() = 0; |
| 52 |
47 DISALLOW_COPY_AND_ASSIGN(MessageLoopShared); | 53 DISALLOW_COPY_AND_ASSIGN(MessageLoopShared); |
48 }; | 54 }; |
49 | 55 |
50 } // namespace ppapi | 56 } // namespace ppapi |
51 | 57 |
52 #endif // PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_ | 58 #endif // PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_ |
OLD | NEW |