Pepper_56_C++_interfaces
Pepper_56_C++_interfaces
 All Classes Namespaces Files Functions Typedefs Enumerations Macros Groups
message_loop.h
Go to the documentation of this file.
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
3 // found in the LICENSE file.
4 
5 #ifndef PPAPI_CPP_MESSAGE_LOOP_H_
6 #define PPAPI_CPP_MESSAGE_LOOP_H_
7 
8 #include <stdint.h>
9 
10 #include "ppapi/cpp/resource.h"
11 
14 
15 namespace pp {
16 
17 class CompletionCallback;
18 class InstanceHandle;
19 
135 class MessageLoop : public Resource {
136  public:
138  MessageLoop();
139 
146  explicit MessageLoop(const InstanceHandle& instance);
147 
148  MessageLoop(const MessageLoop& other);
149 
151  explicit MessageLoop(PP_Resource pp_message_loop);
152 
153  static MessageLoop GetForMainThread();
154  static MessageLoop GetCurrent();
155 
179  int32_t AttachToCurrentThread();
180 
201  int32_t Run();
202 
242  int32_t PostWork(const CompletionCallback& callback,
243  int64_t delay_ms = 0);
244 
265  int32_t PostQuit(bool should_destroy);
266 };
267 
268 } // namespace pp
269 
270 #endif // PPAPI_CPP_MESSAGE_LOOP_H_
int32_t PostWork(const CompletionCallback &callback, int64_t delay_ms=0)
MessageLoop()
Creates an is_null() MessageLoop resource.
int32_t AttachToCurrentThread()
Definition: completion_callback.h:26
Definition: instance_handle.h:44
Definition: message_loop.h:135
int32_t PostQuit(bool should_destroy)
A reference counted module resource.
Definition: resource.h:20