| 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 <stdint.h> |
| 9 |
| 9 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 10 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/macros.h" |
| 11 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 12 #include "ppapi/shared_impl/ppapi_shared_export.h" | 14 #include "ppapi/shared_impl/ppapi_shared_export.h" |
| 13 #include "ppapi/shared_impl/resource.h" | 15 #include "ppapi/shared_impl/resource.h" |
| 14 #include "ppapi/thunk/ppb_message_loop_api.h" | 16 #include "ppapi/thunk/ppb_message_loop_api.h" |
| 15 | 17 |
| 16 namespace base { | 18 namespace base { |
| 17 class SingleThreadTaskRunner; | 19 class SingleThreadTaskRunner; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace tracked_objects { | 22 namespace tracked_objects { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 explicit MessageLoopShared(ForMainThread); | 41 explicit MessageLoopShared(ForMainThread); |
| 40 virtual ~MessageLoopShared(); | 42 virtual ~MessageLoopShared(); |
| 41 | 43 |
| 42 // Handles posting to the message loop if there is one, or the pending queue | 44 // Handles posting to the message loop if there is one, or the pending queue |
| 43 // if there isn't. | 45 // if there isn't. |
| 44 // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock. | 46 // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock. |
| 45 // This only makes sense for user code and completely thread-safe | 47 // This only makes sense for user code and completely thread-safe |
| 46 // proxy operations (e.g., MessageLoop::QuitClosure). | 48 // proxy operations (e.g., MessageLoop::QuitClosure). |
| 47 virtual void PostClosure(const tracked_objects::Location& from_here, | 49 virtual void PostClosure(const tracked_objects::Location& from_here, |
| 48 const base::Closure& closure, | 50 const base::Closure& closure, |
| 49 int64 delay_ms) = 0; | 51 int64_t delay_ms) = 0; |
| 50 | 52 |
| 51 virtual base::SingleThreadTaskRunner* GetTaskRunner() = 0; | 53 virtual base::SingleThreadTaskRunner* GetTaskRunner() = 0; |
| 52 | 54 |
| 53 // Returns whether this MessageLoop is currently handling a blocking message | 55 // Returns whether this MessageLoop is currently handling a blocking message |
| 54 // from JavaScript. This is used to make it illegal to use blocking callbacks | 56 // from JavaScript. This is used to make it illegal to use blocking callbacks |
| 55 // while the thread is handling a blocking message. | 57 // while the thread is handling a blocking message. |
| 56 virtual bool CurrentlyHandlingBlockingMessage() = 0; | 58 virtual bool CurrentlyHandlingBlockingMessage() = 0; |
| 57 | 59 |
| 58 DISALLOW_COPY_AND_ASSIGN(MessageLoopShared); | 60 DISALLOW_COPY_AND_ASSIGN(MessageLoopShared); |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 } // namespace ppapi | 63 } // namespace ppapi |
| 62 | 64 |
| 63 #endif // PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_ | 65 #endif // PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_ |
| OLD | NEW |