|
Ruby
2.5.0dev(2017-10-22revision60238)
|
#include <stdlib.h>#include <stdio.h>#include <string.h>#include <pthread.h>#include <sys/stat.h>#include <sys/mount.h>#include <fcntl.h>#include "ppapi/c/pp_errors.h"#include "ppapi/c/pp_module.h"#include "ppapi/c/pp_var.h"#include "ppapi/c/ppb.h"#include "ppapi/c/ppb_core.h"#include "ppapi/c/ppb_file_ref.h"#include "ppapi/c/ppb_instance.h"#include "ppapi/c/ppb_messaging.h"#include "ppapi/c/ppb_url_loader.h"#include "ppapi/c/ppb_url_request_info.h"#include "ppapi/c/ppb_url_response_info.h"#include "ppapi/c/ppb_var.h"#include "ppapi/c/ppp.h"#include "ppapi/c/ppp_instance.h"#include "ppapi/c/ppp_messaging.h"#include "nacl_io/nacl_io.h"#include "verconf.h"#include "ruby/ruby.h"#include "version.h"#include "gc.h"Go to the source code of this file.
Data Structures | |
| struct | PepperInstance |
Macros | |
| #define | GET_PEPPER_INSTANCE() (pruby_get_instance(current_instance)) |
| #define | EVAL_PREFIX_LEN 5 |
Functions | |
| struct PepperInstance * | pruby_get_instance (PP_Instance instance) |
| struct PepperInstance * | pruby_register_instance (PP_Instance instance) |
| int | pruby_unregister_instance (PP_Instance instance) |
| void | pruby_async_return_int (void *data, int32_t result) |
| void | pruby_async_return_str (void *data, const char *result) |
| void | pruby_async_return_value (void *data, VALUE value) |
| int | pruby_var_equal_to_cstr_p (struct PP_Var lhs, const char *rhs) |
| int | pruby_var_prefixed_p (struct PP_Var var, const char *prefix) |
| void | pruby_post_cstr (void *data) |
| void | pruby_post_value (void *data) |
| void | Messaging_HandleMessage (PP_Instance instance, struct PP_Var var_message) |
| Handler for messages coming in from the browser via postMessage. More... | |
| PP_EXPORT int32_t | PPP_InitializeModule (PP_Module a_module_id, PPB_GetInterface a_get_browser_interface) |
| Entry points for the module. More... | |
| PP_EXPORT const void * | PPP_GetInterface (const char *interface_name) |
| Returns an interface pointer for the interface of the given name, or NULL if the interface is not supported. More... | |
| PP_EXPORT void | PPP_ShutdownModule (void) |
| Called before the plugin module is unloaded. More... | |
| #define EVAL_PREFIX_LEN 5 |
| #define GET_PEPPER_INSTANCE | ( | ) | (pruby_get_instance(current_instance)) |
Definition at line 116 of file pepper_main.c.
| void Messaging_HandleMessage | ( | PP_Instance | instance, |
| struct PP_Var | var_message | ||
| ) |
Handler for messages coming in from the browser via postMessage.
The var_message can contain anything: a JSON string; a string that encodes method names and arguments; etc. For example, you could use JSON.stringify in the browser to create a message that contains a method name and some parameters, something like this: var json_message = JSON.stringify({ "myMethod" : "3.14159" }); nacl_module.postMessage(json_message); On receipt of this message in var_message, you could parse the JSON to retrieve the method name, match it to a function call, and then call it with the parameter.
| [in] | instance | The instance ID. |
| [in] | message | The contents, copied by value, of the message sent from browser via postMessage. |
Definition at line 639 of file pepper_main.c.
Returns an interface pointer for the interface of the given name, or NULL if the interface is not supported.
| [in] | interface_name | name of the interface |
Definition at line 705 of file pepper_main.c.
| PP_EXPORT int32_t PPP_InitializeModule | ( | PP_Module | a_module_id, |
| PPB_GetInterface | a_get_browser_interface | ||
| ) |
Entry points for the module.
Initialize instance interface and scriptable object class.
| [in] | a_module_id | Module ID |
| [in] | get_browser_interface | Pointer to PPB_GetInterface |
Definition at line 670 of file pepper_main.c.
| PP_EXPORT void PPP_ShutdownModule | ( | void | ) |
Called before the plugin module is unloaded.
Definition at line 729 of file pepper_main.c.
References ruby_cleanup().
| void pruby_async_return_int | ( | void * | data, |
| int32_t | result | ||
| ) |
Definition at line 171 of file pepper_main.c.
| void pruby_async_return_str | ( | void * | data, |
| const char * | result | ||
| ) |
Definition at line 182 of file pepper_main.c.
| void pruby_async_return_value | ( | void * | data, |
| VALUE | value | ||
| ) |
Definition at line 193 of file pepper_main.c.
References PepperInstance::as_value, PepperInstance::async_call_result, PepperInstance::cond, and PepperInstance::instance.
| struct PepperInstance* pruby_get_instance | ( | PP_Instance | instance | ) |
Definition at line 103 of file pepper_main.c.
References rb_hash_aref().
| void pruby_post_cstr | ( | void * | data | ) |
Definition at line 318 of file pepper_main.c.
References PepperInstance::instance.
| void pruby_post_value | ( | void * | data | ) |
Definition at line 330 of file pepper_main.c.
References PepperInstance::async_call_args, and PepperInstance::instance.
| struct PepperInstance* pruby_register_instance | ( | PP_Instance | instance | ) |
Definition at line 119 of file pepper_main.c.
References PepperInstance::cond, PepperInstance::instance, PepperInstance::mutex, NULL, rb_cData, rb_hash_aset(), PepperInstance::self, TypedData_Make_Struct, and PepperInstance::url_loader.
| int pruby_unregister_instance | ( | PP_Instance | instance | ) |
Definition at line 136 of file pepper_main.c.
References rb_hash_delete().
| int pruby_var_equal_to_cstr_p | ( | struct PP_Var | lhs, |
| const char * | rhs | ||
| ) |
Definition at line 284 of file pepper_main.c.
References len.
| int pruby_var_prefixed_p | ( | struct PP_Var | var, |
| const char * | prefix | ||
| ) |
Definition at line 297 of file pepper_main.c.
References len.
1.8.13