| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SIMPLE_PS_INSTANCE_H_ | 5 #ifndef PPAPI_SIMPLE_PS_INSTANCE_H_ |
| 6 #define PPAPI_SIMPLE_PS_INSTANCE_H_ | 6 #define PPAPI_SIMPLE_PS_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 | 9 |
| 10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // assert(value.is_int()); | 102 // assert(value.is_int()); |
| 103 // assert(value.AsInt() == 123); | 103 // assert(value.AsInt() == 123); |
| 104 // } | 104 // } |
| 105 // ... | 105 // ... |
| 106 // instance_->RegisterMessageHandler("foo", &MyMessageHandler, NULL); | 106 // instance_->RegisterMessageHandler("foo", &MyMessageHandler, NULL); |
| 107 // | 107 // |
| 108 void RegisterMessageHandler(std::string message_name, | 108 void RegisterMessageHandler(std::string message_name, |
| 109 MessageHandler_t handler, | 109 MessageHandler_t handler, |
| 110 void* user_data); | 110 void* user_data); |
| 111 | 111 |
| 112 | |
| 113 // Perform exit handshake with JavaScript. | 112 // Perform exit handshake with JavaScript. |
| 114 // This is called by _exit before the process is terminated to ensure | 113 // This is called by _exit before the process is terminated to ensure |
| 115 // that all messages sent prior to _exit arrive at the JavaScript side. | 114 // that all messages sent prior to _exit arrive at the JavaScript side. |
| 116 void ExitHandshake(int status); | 115 void ExitHandshake(int status); |
| 117 | 116 |
| 118 protected: | 117 protected: |
| 119 typedef std::map<std::string, MessageHandler> MessageHandlerMap; | 118 typedef std::map<std::string, MessageHandler> MessageHandlerMap; |
| 120 | 119 |
| 121 // Callback functions triggered by Pepper | 120 // Callback functions triggered by Pepper |
| 122 // | 121 // |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // JavaScript. | 208 // JavaScript. |
| 210 pthread_cond_t exit_cond_; | 209 pthread_cond_t exit_cond_; |
| 211 pthread_mutex_t exit_lock_; | 210 pthread_mutex_t exit_lock_; |
| 212 | 211 |
| 213 // A message to Post to JavaScript instead of exiting, or NULL if exit() | 212 // A message to Post to JavaScript instead of exiting, or NULL if exit() |
| 214 // should be called instead. | 213 // should be called instead. |
| 215 char* exit_message_; | 214 char* exit_message_; |
| 216 }; | 215 }; |
| 217 | 216 |
| 218 #endif // PPAPI_MAIN_PS_INSTANCE_H_ | 217 #endif // PPAPI_MAIN_PS_INSTANCE_H_ |
| OLD | NEW |