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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Handles posting to the message loop if there is one, or the pending queue | 57 // Handles posting to the message loop if there is one, or the pending queue |
58 // if there isn't. | 58 // if there isn't. |
59 // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock. | 59 // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock. |
60 // This only makes sense for user code and completely thread-safe | 60 // This only makes sense for user code and completely thread-safe |
61 // proxy operations (e.g., MessageLoop::QuitClosure). | 61 // proxy operations (e.g., MessageLoop::QuitClosure). |
62 virtual void PostClosure(const tracked_objects::Location& from_here, | 62 virtual void PostClosure(const tracked_objects::Location& from_here, |
63 const base::Closure& closure, | 63 const base::Closure& closure, |
64 int64 delay_ms) OVERRIDE; | 64 int64 delay_ms) OVERRIDE; |
65 | 65 |
| 66 virtual base::MessageLoopProxy* GetMessageLoopProxy() OVERRIDE; |
| 67 |
66 // TLS destructor function. | 68 // TLS destructor function. |
67 static void ReleaseMessageLoop(void* value); | 69 static void ReleaseMessageLoop(void* value); |
68 | 70 |
69 // Created when we attach to the current thread, since MessageLoop assumes | 71 // Created when we attach to the current thread, since MessageLoop assumes |
70 // that it's created on the thread it will run on. NULL for the main thread | 72 // that it's created on the thread it will run on. NULL for the main thread |
71 // loop, since that's owned by somebody else. This is needed for Run and Quit. | 73 // loop, since that's owned by somebody else. This is needed for Run and Quit. |
72 // Any time we post tasks, we should post them using loop_proxy_. | 74 // Any time we post tasks, we should post them using loop_proxy_. |
73 scoped_ptr<base::MessageLoop> loop_; | 75 scoped_ptr<base::MessageLoop> loop_; |
74 scoped_refptr<base::MessageLoopProxy> loop_proxy_; | 76 scoped_refptr<base::MessageLoopProxy> loop_proxy_; |
75 | 77 |
(...skipping 26 matching lines...) Expand all Loading... |
102 static const PPB_MessageLoop_1_0* GetInterface(); | 104 static const PPB_MessageLoop_1_0* GetInterface(); |
103 | 105 |
104 private: | 106 private: |
105 DISALLOW_COPY_AND_ASSIGN(PPB_MessageLoop_Proxy); | 107 DISALLOW_COPY_AND_ASSIGN(PPB_MessageLoop_Proxy); |
106 }; | 108 }; |
107 | 109 |
108 } // namespace proxy | 110 } // namespace proxy |
109 } // namespace ppapi | 111 } // namespace ppapi |
110 | 112 |
111 #endif // PPAPI_PROXY_PPB_MESSAGE_LOOP_PROXY_H_ | 113 #endif // PPAPI_PROXY_PPB_MESSAGE_LOOP_PROXY_H_ |
OLD | NEW |