trace_ppb_cursor_control_has_cursor_lock(PP_Instance instance)
{
    trace_info("[PPB] {zilch} %s instance=%d\n", __func__+6, instance);
    return ppb_cursor_control_has_cursor_lock(instance);
}

TRACE_WRAPPER
PP_Bool
trace_ppb_cursor_control_can_lock_cursor(PP_Instance instance)
{
    trace_info("[PPB] {zilch} %s instance=%d\n", __func__+6, instance);
    return ppb_cursor_control_can_lock_cursor(instance);
}


const struct PPB_CursorControl_Dev_0_4 ppb_cursor_control_dev_interface_0_4 = {
    .SetCursor =        TWRAPF(ppb_cursor_control_set_cursor),
    .LockCursor =       TWRAPZ(ppb_cursor_control_lock_cursor),
    .UnlockCursor =     TWRAPZ(ppb_cursor_control_unlock_cursor),
    .HasCursorLock =    TWRAPZ(ppb_cursor_control_has_cursor_lock),
    .CanLockCursor =    TWRAPZ(ppb_cursor_control_can_lock_cursor),
};

static
void
__attribute__((constructor))
constructor_ppb_cursor_control(void)
{
    register_interface(PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4, &ppb_cursor_control_dev_interface_0_4);
}
}

TRACE_WRAPPER
struct PP_Var
trace_n2p_construct(void *object, uint32_t argc, struct PP_Var *argv, struct PP_Var *exception)
{
    trace_info("[CLS] {full} %s object=%p, argc=%u, argv=%p\n", __func__+6, object, argc, argv);
    return n2p_construct(object, argc, argv, exception);
}

TRACE_WRAPPER
void
trace_n2p_deallocate(void *object)
{
    trace_info("[CLS] {full} %s object=%p\n", __func__+6, object);
    n2p_deallocate(object);
}


const struct PPP_Class_Deprecated n2p_proxy_class = {
    .HasProperty =          TWRAPF(n2p_has_property),
    .HasMethod =            TWRAPZ(n2p_has_method),
    .GetProperty =          TWRAPF(n2p_get_property),
    .GetAllPropertyNames =  TWRAPZ(n2p_get_all_property_names),
    .SetProperty =          TWRAPZ(n2p_set_property),
    .RemoveProperty =       TWRAPZ(n2p_remove_property),
    .Call =                 TWRAPF(n2p_call),
    .Construct =            TWRAPF(n2p_construct),
    .Deallocate =           TWRAPF(n2p_deallocate),
};
    return ppb_flash_menu_create(instance_id, menu_data);
}

TRACE_WRAPPER
PP_Bool
trace_ppb_flash_menu_is_flash_menu(PP_Resource resource_id)
{
    trace_info("[PPB] {full} %s resource_id=%d\n", __func__+6, resource_id);
    return ppb_flash_menu_is_flash_menu(resource_id);
}

TRACE_WRAPPER
int32_t
trace_ppb_flash_menu_show(PP_Resource menu_id, const struct PP_Point *location,
                          int32_t *selected_id, struct PP_CompletionCallback callback)
{
    gchar *s_location = trace_point_as_string(location);
    trace_info("[PPB] {full} %s menu_id=%d, location=%s, callback={.func=%p, .user_data=%p, "
               ".flags=%d}\n", __func__+6, menu_id, s_location, callback.func, callback.user_data,
               callback.flags);
    g_free(s_location);
    return ppb_flash_menu_show(menu_id, location, selected_id, callback);
}


const struct PPB_Flash_Menu_0_2 ppb_flash_menu_interface_0_2 = {
    .Create =       TWRAPF(ppb_flash_menu_create),
    .IsFlashMenu =  TWRAPF(ppb_flash_menu_is_flash_menu),
    .Show =         TWRAPF(ppb_flash_menu_show),
};
{
    trace_info("[CLS] {full} %s npobj=%p\n", __func__+6, npobj);
    return p2n_enumerate(npobj, value, count);
}

TRACE_WRAPPER
bool
trace_p2n_construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
{
    trace_info("[CLS] {zilch} %s\n", __func__+6);
    return p2n_construct(npobj, args, argCount, result);
}


// can't be const due to npapi restrictions
struct NPClass p2n_proxy_class = {
    .structVersion =    NP_CLASS_STRUCT_VERSION,
    .allocate =         TWRAPF(p2n_allocate),
    .deallocate =       TWRAPF(p2n_deallocate),
    .invalidate =       TWRAPF(p2n_invalidate),
    .hasMethod =        TWRAPF(p2n_has_method),
    .invoke =           TWRAPF(p2n_invoke),
    .invokeDefault =    TWRAPZ(p2n_invoke_default),
    .hasProperty =      TWRAPF(p2n_has_property),
    .getProperty =      TWRAPF(p2n_get_property),
    .setProperty =      TWRAPZ(p2n_set_property),
    .removeProperty =   TWRAPZ(p2n_remove_property),
    .enumerate =        TWRAPF(p2n_enumerate),
    .construct =        TWRAPZ(p2n_construct),
};
Пример #5
0
}

TRACE_WRAPPER
void
trace_ppb_core_call_on_main_thread(int32_t delay_in_milliseconds,
                                   struct PP_CompletionCallback callback, int32_t result)
{
    trace_info("[PPB] {full} %s delay_in_milliseconds=%d, callback={.func=%p, .user_data=%p, "
               ".flags=%d}, result=%d\n", __func__+6, delay_in_milliseconds, callback.func,
               callback.user_data, callback.flags, result);
    ppb_core_call_on_main_thread(delay_in_milliseconds, callback, result);
}

TRACE_WRAPPER
PP_Bool
trace_ppb_core_is_main_thread(void)
{
    trace_info("[PPB] {full} %s\n", __func__+6);
    return ppb_core_is_main_thread();
}


const struct PPB_Core_1_0 ppb_core_interface_1_0 = {
    .AddRefResource =   TWRAPF(ppb_core_add_ref_resource),
    .ReleaseResource =  TWRAPF(ppb_core_release_resource),
    .GetTime =          TWRAPF(ppb_core_get_time),
    .GetTimeTicks =     TWRAPF(ppb_core_get_time_ticks),
    .CallOnMainThread = TWRAPF(ppb_core_call_on_main_thread),
    .IsMainThread =     TWRAPF(ppb_core_is_main_thread),
};
Пример #6
0
TRACE_WRAPPER
int32_t
trace_ppb_graphics3d_resize_buffers(PP_Resource context, int32_t width, int32_t height)
{
    trace_info("[PPB] {full} %s context=%d, width=%d, height=%d\n", __func__+6, context,
               width, height);
    return ppb_graphics3d_resize_buffers(context, width, height);
}

TRACE_WRAPPER
int32_t
trace_ppb_graphics3d_swap_buffers(PP_Resource context, struct PP_CompletionCallback callback)
{
    trace_info("[PPB] {full} %s context=%d, callback={.func=%p, .user_data=%p, .flags=%d}\n",
               __func__+6, context, callback.func, callback.user_data, callback.flags);
    return ppb_graphics3d_swap_buffers(context, callback);
}


const struct PPB_Graphics3D_1_0 ppb_graphics3d_interface_1_0 = {
    .GetAttribMaxValue =    TWRAPZ(ppb_graphics3d_get_attrib_max_value),
    .Create =               TWRAPF(ppb_graphics3d_create),
    .IsGraphics3D =         TWRAPF(ppb_graphics3d_is_graphics3d),
    .GetAttribs =           TWRAPZ(ppb_graphics3d_get_attribs),
    .SetAttribs =           TWRAPZ(ppb_graphics3d_set_attribs),
    .GetError =             TWRAPZ(ppb_graphics3d_get_error),
    .ResizeBuffers =        TWRAPF(ppb_graphics3d_resize_buffers),
    .SwapBuffers =          TWRAPF(ppb_graphics3d_swap_buffers),
};
trace_ppb_url_response_info_get_property(PP_Resource response, PP_URLResponseProperty property)
{
    trace_info("[PPB] {full} %s response=%d, property=%s\n", __func__+6, response,
               reverse_pp_url_response_property(property));
    return ppb_url_response_info_get_property(response, property);
}

TRACE_WRAPPER
PP_Resource
trace_ppb_url_response_info_get_body_as_file_ref(PP_Resource response)
{
    trace_info("[PPB] {full} %s response=%d\n", __func__+6, response);
    return ppb_url_response_info_get_body_as_file_ref(response);
}


const struct PPB_URLResponseInfo_1_0 ppb_url_response_info_interface_1_0 = {
    .IsURLResponseInfo =    TWRAPF(ppb_url_response_info_is_url_response_info),
    .GetProperty =          TWRAPF(ppb_url_response_info_get_property),
    .GetBodyAsFileRef =     TWRAPF(ppb_url_response_info_get_body_as_file_ref),
};

static
void
__attribute__((constructor))
constructor_ppb_url_response_info(void)
{
    register_interface(PPB_URLRESPONSEINFO_INTERFACE_1_0, &ppb_url_response_info_interface_1_0);
    register_resource(PP_RESOURCE_URL_RESPONSE_INFO, ppb_url_response_info_destroy);
}
Пример #8
0
{
    trace_info("[PPB] {full} %s resource=%d, scale=%f\n", __func__+6, resource, scale);
    return ppb_graphics2d_set_scale(resource, scale);
}

TRACE_WRAPPER
float
trace_ppb_graphics2d_get_scale(PP_Resource resource)
{
    trace_info("[PPB] {full} %s resource=%d\n", __func__+6, resource);
    return ppb_graphics2d_get_scale(resource);
}


const struct PPB_Graphics2D_1_0 ppb_graphics2d_interface_1_0 = {
    .Create =           TWRAPF(ppb_graphics2d_create),
    .IsGraphics2D =     TWRAPF(ppb_graphics2d_is_graphics2d),
    .Describe =         TWRAPZ(ppb_graphics2d_describe),
    .PaintImageData =   TWRAPF(ppb_graphics2d_paint_image_data),
    .Scroll =           TWRAPZ(ppb_graphics2d_scroll),
    .ReplaceContents =  TWRAPF(ppb_graphics2d_replace_contents),
    .Flush =            TWRAPF(ppb_graphics2d_flush),
};

const struct PPB_Graphics2D_1_1 ppb_graphics2d_interface_1_1 = {
    .Create =           TWRAPF(ppb_graphics2d_create),
    .IsGraphics2D =     TWRAPF(ppb_graphics2d_is_graphics2d),
    .Describe =         TWRAPZ(ppb_graphics2d_describe),
    .PaintImageData =   TWRAPF(ppb_graphics2d_paint_image_data),
    .Scroll =           TWRAPZ(ppb_graphics2d_scroll),
    .ReplaceContents =  TWRAPF(ppb_graphics2d_replace_contents),
Пример #9
0
TRACE_WRAPPER
int32_t
trace_ppb_message_loop_post_work(PP_Resource message_loop, struct PP_CompletionCallback callback,
                                 int64_t delay_ms)
{
    trace_info("[PPB] {full} %s message_loop=%d, callback={.func=%p, .user_data=%p, .flags=%u}, "
               "delay_ms=%"PRId64"\n", __func__+6, message_loop, callback.func, callback.user_data,
               callback.flags, delay_ms);
    return ppb_message_loop_post_work(message_loop, callback, delay_ms);
}

TRACE_WRAPPER
int32_t
trace_ppb_message_loop_post_quit(PP_Resource message_loop, PP_Bool should_destroy)
{
    trace_info("[PPB] {full} %s message_loop=%d, should_destroy=%d\n", __func__+6,
               message_loop, should_destroy);
    return ppb_message_loop_post_quit(message_loop, should_destroy);
}

const struct PPB_MessageLoop_1_0 ppb_message_loop_interface_1_0 = {
    .Create =                TWRAPF(ppb_message_loop_create),
    .GetForMainThread =      TWRAPF(ppb_message_loop_get_for_main_thread),
    .GetCurrent =            TWRAPF(ppb_message_loop_get_current),
    .AttachToCurrentThread = TWRAPF(ppb_message_loop_attach_to_current_thread),
    .Run =                   TWRAPF(ppb_message_loop_run),
    .PostWork =              TWRAPF(ppb_message_loop_post_work),
    .PostQuit =              TWRAPF(ppb_message_loop_post_quit),
};
{
    trace_info("[PPB] {full} %s video_decoder=%d, callback={.func=%p, .user_data=%p, .flags=%u}\n",
               __func__+6, video_decoder, callback.func, callback.user_data, callback.flags);
    return ppb_video_decoder_reset(video_decoder, callback);
}

TRACE_WRAPPER
void
trace_ppb_video_decoder_destroy(PP_Resource video_decoder)
{
    trace_info("[PPB] {zilch} %s video_decoder=%d\n", __func__+6, video_decoder);
    return ppb_video_decoder_destroy(video_decoder);
}

const struct PPB_VideoDecoder_Dev_0_16 ppb_video_decoder_dev_interface_0_16 = {
    .Create =               TWRAPF(ppb_video_decoder_create),
    .IsVideoDecoder =       TWRAPF(ppb_video_decoder_is_video_decoder),
    .Decode =               TWRAPF(ppb_video_decoder_decode),
    .AssignPictureBuffers = TWRAPF(ppb_video_decoder_assign_picture_buffers),
    .ReusePictureBuffer =   TWRAPF(ppb_video_decoder_reuse_picture_buffer),
    .Flush =                TWRAPF(ppb_video_decoder_flush),
    .Reset =                TWRAPF(ppb_video_decoder_reset),
    .Destroy =              TWRAPZ(ppb_video_decoder_destroy),
};

static
void
__attribute__((constructor))
constructor_ppb_video_decoder(void)
{
    avcodec_register_all();
Пример #11
0
TRACE_WRAPPER
int32_t
trace_ppb_font_pixel_offset_for_character(PP_Resource font, const struct PP_TextRun_Dev *text,
                                          uint32_t char_offset)
{
    gchar *s_text = trace_var_as_string(text->text);
    trace_info("[PPB] {zilch} %s font=%d, text={.text=%s, .rtl=%u, .override_direction=%u}, "
               "char_offset=%u\n", __func__+6, font, s_text, text->rtl, text->override_direction,
               char_offset);
    g_free(s_text);
    return ppb_font_pixel_offset_for_character(font, text, char_offset);
}


const struct PPB_Font_Dev_0_6 ppb_font_dev_interface_0_6 = {
    .GetFontFamilies =          TWRAPF(ppb_font_get_font_families),
    .Create =                   TWRAPF(ppb_font_create),
    .IsFont =                   TWRAPF(ppb_font_is_font),
    .Describe =                 TWRAPF(ppb_font_describe),
    .DrawTextAt =               TWRAPF(ppb_font_draw_text_at),
    .MeasureText =              TWRAPF(ppb_font_measure_text),
    .CharacterOffsetForPixel =  TWRAPZ(ppb_font_character_offset_for_pixel),
    .PixelOffsetForCharacter =  TWRAPZ(ppb_font_pixel_offset_for_character),
};

static
void
__attribute__((constructor))
constructor_ppb_font(void)
{
    register_interface(PPB_FONT_DEV_INTERFACE_0_6, &ppb_font_dev_interface_0_6);
}

TRACE_WRAPPER
int32_t
trace_ppb_video_capture_stop_capture(PP_Resource video_capture)
{
    trace_info("[PPB] {full} %s video_capture=%d\n", __func__+6, video_capture);
    return ppb_video_capture_stop_capture(video_capture);
}

TRACE_WRAPPER
void
trace_ppb_video_capture_close(PP_Resource video_capture)
{
    trace_info("[PPB] {full} %s video_capture=%d\n", __func__+6, video_capture);
    ppb_video_capture_close(video_capture);
}


const struct PPB_VideoCapture_Dev_0_3 ppb_video_capture_dev_interface_0_3 = {
    .Create =               TWRAPF(ppb_video_capture_create),
    .IsVideoCapture =       TWRAPF(ppb_video_capture_is_video_capture),
    .EnumerateDevices =     TWRAPF(ppb_video_capture_enumerate_devices),
    .MonitorDeviceChange =  TWRAPZ(ppb_video_capture_monitor_device_change),
    .Open =                 TWRAPF(ppb_video_capture_open),
    .StartCapture =         TWRAPF(ppb_video_capture_start_capture),
    .ReuseBuffer =          TWRAPF(ppb_video_capture_reuse_buffer),
    .StopCapture =          TWRAPF(ppb_video_capture_stop_capture),
    .Close =                TWRAPF(ppb_video_capture_close),
};
Пример #13
0
{
    trace_info("[PPB] {full} %s audio=%d\n", __func__+6, audio);
    return ppb_audio_start_playback(audio);
}

TRACE_WRAPPER
PP_Bool
trace_ppb_audio_stop_playback(PP_Resource audio)
{
    trace_info("[PPB] {full} %s audio=%d\n", __func__+6, audio);
    return ppb_audio_stop_playback(audio);
}


const struct PPB_Audio_1_0 ppb_audio_interface_1_0 = {
    .Create =           TWRAPF(ppb_audio_create_1_0),
    .IsAudio =          TWRAPF(ppb_audio_is_audio),
    .GetCurrentConfig = TWRAPF(ppb_audio_get_current_config),
    .StartPlayback =    TWRAPF(ppb_audio_start_playback),
    .StopPlayback =     TWRAPF(ppb_audio_stop_playback),
};

const struct PPB_Audio_1_1 ppb_audio_interface_1_1 = {
    .Create =           TWRAPF(ppb_audio_create_1_1),
    .IsAudio =          TWRAPF(ppb_audio_is_audio),
    .GetCurrentConfig = TWRAPF(ppb_audio_get_current_config),
    .StartPlayback =    TWRAPF(ppb_audio_start_playback),
    .StopPlayback =     TWRAPF(ppb_audio_stop_playback),
};

static
Пример #14
0
    return ppb_url_util_dev_get_plugin_instance_url(instance, components);
}

TRACE_WRAPPER
struct PP_Var
trace_ppb_url_util_dev_get_plugin_referrer_url(PP_Instance instance,
                                               struct PP_URLComponents_Dev *components)
{
    trace_info("[PPB] {zilch} %s instance=%d\n", __func__+6, instance);
    return ppb_url_util_dev_get_plugin_referrer_url(instance, components);
}


const struct PPB_URLUtil_Dev_0_6 ppb_url_util_dev_interface_0_6 = {
    .Canonicalize =                 TWRAPZ(ppb_url_util_dev_canonicalize),
    .ResolveRelativeToURL =         TWRAPF(ppb_url_util_dev_resolve_relative_to_url),
    .ResolveRelativeToDocument =    TWRAPF(ppb_url_util_dev_resolve_relative_to_document),
    .IsSameSecurityOrigin =         TWRAPZ(ppb_url_util_dev_is_same_security_origin),
    .DocumentCanRequest =           TWRAPZ(ppb_url_util_dev_document_can_request),
    .DocumentCanAccessDocument =    TWRAPZ(ppb_url_util_dev_document_can_access_document),
    .GetDocumentURL =               TWRAPF(ppb_url_util_dev_get_document_url),
    .GetPluginInstanceURL =         TWRAPF(ppb_url_util_dev_get_plugin_instance_url),
};

const struct PPB_URLUtil_Dev_0_7 ppb_url_util_dev_interface_0_7 = {
    .Canonicalize =                 TWRAPZ(ppb_url_util_dev_canonicalize),
    .ResolveRelativeToURL =         TWRAPF(ppb_url_util_dev_resolve_relative_to_url),
    .ResolveRelativeToDocument =    TWRAPF(ppb_url_util_dev_resolve_relative_to_document),
    .IsSameSecurityOrigin =         TWRAPZ(ppb_url_util_dev_is_same_security_origin),
    .DocumentCanRequest =           TWRAPZ(ppb_url_util_dev_document_can_request),
    .DocumentCanAccessDocument =    TWRAPZ(ppb_url_util_dev_document_can_access_document),
Пример #15
0
{
    trace_info("[PPB] {zilch} %s ime_event=%d\n", __func__+6, ime_event);
    return ppb_ime_input_event_get_target_segment(ime_event);
}

TRACE_WRAPPER
void
trace_ppb_ime_input_event_get_selection(PP_Resource ime_event, uint32_t *start, uint32_t *end)
{
    trace_info("[PPB] {zilch} %s ime_event=%d\n", __func__+6, ime_event);
    return ppb_ime_input_event_get_selection(ime_event, start, end);
}


const struct PPB_InputEvent_1_0 ppb_input_event_interface_1_0 = {
    .RequestInputEvents =           TWRAPF(ppb_input_event_request_input_events),
    .RequestFilteringInputEvents =  TWRAPF(ppb_input_event_request_filtering_input_events),
    .ClearInputEventRequest =       TWRAPF(ppb_input_event_clear_input_event_request),
    .IsInputEvent =                 TWRAPF(ppb_input_event_is_input_event),
    .GetType =                      TWRAPF(ppb_input_event_get_type),
    .GetTimeStamp =                 TWRAPZ(ppb_input_event_get_time_stamp),
    .GetModifiers =                 TWRAPF(ppb_input_event_get_modifiers),
};

const struct PPB_MouseInputEvent_1_1 ppb_mouse_input_event_interface_1_1 = {
    .Create =               TWRAPF(ppb_mouse_input_event_create),
    .IsMouseInputEvent =    TWRAPF(ppb_mouse_input_event_is_mouse_input_event),
    .GetButton =            TWRAPF(ppb_mouse_input_event_get_button),
    .GetPosition =          TWRAPF(ppb_mouse_input_event_get_position),
    .GetClickCount =        TWRAPF(ppb_mouse_input_event_get_click_count),
    .GetMovement =          TWRAPZ(ppb_mouse_input_event_get_movement),
    trace_info("[PPB] {full} %s tcp_socket=%d\n", __func__+6, tcp_socket);
    ppb_tcp_socket_disconnect(tcp_socket);
}

TRACE_WRAPPER
int32_t
trace_ppb_tcp_socket_set_option(PP_Resource tcp_socket, PP_TCPSocketOption_Private name,
                                struct PP_Var value, struct PP_CompletionCallback callback)
{
    trace_info("[PPB] {zilch} %s\n", __func__+6);
    return ppb_tcp_socket_set_option(tcp_socket, name, value, callback);
}


const struct PPB_TCPSocket_Private_0_5 ppb_tcp_socket_private_interface_0_5 = {
    .Create =                       TWRAPF(ppb_tcp_socket_create),
    .IsTCPSocket =                  TWRAPF(ppb_tcp_socket_is_tcp_socket),
    .Connect =                      TWRAPF(ppb_tcp_socket_connect),
    .ConnectWithNetAddress =        TWRAPF(ppb_tcp_socket_connect_with_net_address),
    .GetLocalAddress =              TWRAPF(ppb_tcp_socket_get_local_address),
    .GetRemoteAddress =             TWRAPF(ppb_tcp_socket_get_remote_address),
    .SSLHandshake =                 TWRAPZ(ppb_tcp_socket_ssl_handshake),
    .GetServerCertificate =         TWRAPZ(ppb_tcp_socket_get_server_certificate),
    .AddChainBuildingCertificate =  TWRAPZ(ppb_tcp_socket_add_chain_building_certificate),
    .Read =                         TWRAPF(ppb_tcp_socket_read),
    .Write =                        TWRAPF(ppb_tcp_socket_write),
    .Disconnect =                   TWRAPF(ppb_tcp_socket_disconnect),
    .SetOption =                    TWRAPZ(ppb_tcp_socket_set_option),
};

const struct PPB_TCPSocket_Private_0_4 ppb_tcp_socket_private_interface_0_4 = {
Пример #17
0
{
    trace_info("[PPB] {full} %s image_data=%d\n", __func__+6, image_data);
    return ppb_image_data_map(image_data);
}

TRACE_WRAPPER
void
trace_ppb_image_data_unmap(PP_Resource image_data)
{
    trace_info("[PPB] {full} %s image_data=%d\n", __func__+6, image_data);
    ppb_image_data_unmap(image_data);
}


const struct PPB_ImageData_1_0 ppb_image_data_interface_1_0 = {
    .GetNativeImageDataFormat =     TWRAPF(ppb_image_data_get_native_image_data_format),
    .IsImageDataFormatSupported =   TWRAPF(ppb_image_data_is_image_data_format_supported),
    .Create =                       TWRAPF(ppb_image_data_create),
    .IsImageData =                  TWRAPF(ppb_image_data_is_image_data),
    .Describe =                     TWRAPF(ppb_image_data_describe),
    .Map =                          TWRAPF(ppb_image_data_map),
    .Unmap =                        TWRAPF(ppb_image_data_unmap),
};

static
void
__attribute__((constructor))
constructor_ppb_image_data(void)
{
    register_interface(PPB_IMAGEDATA_INTERFACE_1_0, &ppb_image_data_interface_1_0);
    register_resource(PP_RESOURCE_IMAGE_DATA, ppb_image_data_destroy);
    trace_info("[PPB] {zilch} %s drm=%d, callback={.func=%p, .user_data=%p, .flags=%u}\n",
               __func__+6, drm, callback.func, callback.user_data, callback.flags);
    return ppb_flash_drm_get_voucher_file(drm, file_ref, callback);
}

TRACE_WRAPPER
int32_t
trace_ppb_flash_drm_monitor_is_external(PP_Resource drm, PP_Bool *is_external,
                                        struct PP_CompletionCallback callback)
{
    trace_info("[PPB] {zilch} %s drm=%d, callback={.func=%p, .user_data=%p, .flags=%u}\n",
               __func__+6, drm, callback.func, callback.user_data, callback.flags);
    return ppb_flash_drm_monitor_is_external(drm, is_external, callback);
}


const struct PPB_Flash_DRM_1_1 ppb_flash_drm_interface_1_1 = {
    .Create =               TWRAPF(ppb_flash_drm_create),
    .GetDeviceID =          TWRAPF(ppb_flash_drm_get_device_id),
    .GetHmonitor =          TWRAPZ(ppb_flash_drm_get_hmonitor),
    .GetVoucherFile =       TWRAPZ(ppb_flash_drm_get_voucher_file),
    .MonitorIsExternal =    TWRAPZ(ppb_flash_drm_monitor_is_external),
};

const struct PPB_Flash_DRM_1_0 ppb_flash_drm_interface_1_0 = {
    .Create =           TWRAPF(ppb_flash_drm_create),
    .GetDeviceID =      TWRAPF(ppb_flash_drm_get_device_id),
    .GetHmonitor =      TWRAPZ(ppb_flash_drm_get_hmonitor),
    .GetVoucherFile =   TWRAPZ(ppb_flash_drm_get_voucher_file),
};
Пример #19
0
{
    trace_info("[PPB] {full} %s instance=%d, input=%.*s, input_len=%u, input_char_set=%s, "
               "on_error=%s\n", __func__+6, instance, input_len, input, input_len, input_char_set,
               reverse_char_set_conversion_error(on_error));
    return ppb_char_set_char_set_to_utf16(instance, input, input_len, input_char_set, on_error,
                                          output_length);
}

TRACE_WRAPPER
struct PP_Var
trace_ppb_char_set_get_default_char_set(PP_Instance instance)
{
    trace_info("[PPB] {full} %s instance=%d\n", __func__+6, instance);
    return ppb_char_set_get_default_char_set(instance);
}


const struct PPB_CharSet_Dev_0_4 ppb_char_set_dev_interface_0_4 = {
    .UTF16ToCharSet =       TWRAPF(ppb_char_set_utf16_to_char_set),
    .CharSetToUTF16 =       TWRAPF(ppb_char_set_char_set_to_utf16),
    .GetDefaultCharSet =    TWRAPF(ppb_char_set_get_default_char_set),
};

static
void
__attribute__((constructor))
constructor_ppb_char_set(void)
{
    register_interface(PPB_CHAR_SET_DEV_INTERFACE_0_4, &ppb_char_set_dev_interface_0_4);
}
Пример #20
0
{
    trace_info("[PPB] {full} %s instance=%d, text=%s, caret=%u, anchor=%u\n", __func__+6, instance,
               text, caret, anchor);
    ppb_text_input_interface_update_surrounding_text(instance, text, caret, anchor);
}

TRACE_WRAPPER
void
trace_ppb_text_input_interface_selection_changed(PP_Instance instance)
{
    trace_info("[PPB] {full} %s instance=%d\n", __func__+6, instance);
    ppb_text_input_interface_selection_changed(instance);
}


const struct PPB_TextInput_Dev_0_2 ppb_text_input_dev_interface_0_2 = {
    .SetTextInputType =         TWRAPF(ppb_text_input_interface_set_text_input_type),
    .UpdateCaretPosition =      TWRAPF(ppb_text_input_interface_update_caret_position),
    .CancelCompositionText =    TWRAPF(ppb_text_input_interface_cancel_composition_text),
    .UpdateSurroundingText =    TWRAPF(ppb_text_input_interface_update_surrounding_text),
    .SelectionChanged =         TWRAPF(ppb_text_input_interface_selection_changed),
};

static
void
__attribute__((constructor))
constructor_ppb_text_input(void)
{
    register_interface(PPB_TEXTINPUT_DEV_INTERFACE_0_2, &ppb_text_input_dev_interface_0_2);
}
Пример #21
0
TRACE_WRAPPER
PP_DeviceType_Dev
trace_ppb_device_ref_get_type(PP_Resource device_ref)
{
    trace_info("[PPB] {full} %s device_ref=%d\n", __func__+6, device_ref);
    return ppb_device_ref_get_type(device_ref);
}

TRACE_WRAPPER
struct PP_Var
trace_ppb_device_ref_get_name(PP_Resource device_ref)
{
    trace_info("[PPB] {full} %s device_ref=%d\n", __func__+6, device_ref);
    return ppb_device_ref_get_name(device_ref);
}

const struct PPB_DeviceRef_Dev_0_1 ppb_device_ref_dev_interface_0_1 = {
    .IsDeviceRef =  TWRAPF(ppb_device_ref_is_device_ref),
    .GetType =      TWRAPF(ppb_device_ref_get_type),
    .GetName =      TWRAPF(ppb_device_ref_get_name),
};

static
void
__attribute__((constructor))
constructor_ppb_device_ref(void)
{
    register_interface(PPB_DEVICEREF_DEV_INTERFACE_0_1, &ppb_device_ref_dev_interface_0_1);
    register_resource(PP_RESOURCE_DEVICE_REF, ppb_device_ref_destroy);
}
Пример #22
0
TRACE_WRAPPER
uint32_t
trace_ppb_font_dev_character_offset_for_pixel(PP_Resource font, const struct PP_TextRun_Dev *text,
        int32_t pixel_position)
{
    trace_info("[PPB] {zilch} %s\n", __func__+6);
    return ppb_font_dev_character_offset_for_pixel(font, text, pixel_position);
}

TRACE_WRAPPER
int32_t
trace_ppb_font_dev_pixel_offset_for_character(PP_Resource font, const struct PP_TextRun_Dev *text,
        uint32_t char_offset)
{
    trace_info("[PPB] {zilch} %s\n", __func__+6);
    return ppb_font_dev_pixel_offset_for_character(font, text, char_offset);
}


const struct PPB_Font_Dev_0_6 ppb_font_dev_interface_0_6 = {
    .GetFontFamilies =          TWRAPF(ppb_font_dev_get_font_families),
    .Create =                   TWRAPZ(ppb_font_dev_create),
    .IsFont =                   TWRAPZ(ppb_font_dev_is_font),
    .Describe =                 TWRAPZ(ppb_font_dev_describe),
    .DrawTextAt =               TWRAPZ(ppb_font_dev_draw_text_at),
    .MeasureText =              TWRAPZ(ppb_font_dev_measure_text),
    .CharacterOffsetForPixel =  TWRAPZ(ppb_font_dev_character_offset_for_pixel),
    .PixelOffsetForCharacter =  TWRAPZ(ppb_font_dev_pixel_offset_for_character),
};
trace_ppb_flash_message_loop_run(PP_Resource flash_message_loop)
{
    trace_info("[PPB] {full} %s flash_message_loop=%d\n", __func__+6, flash_message_loop);
    return ppb_flash_message_loop_run(flash_message_loop);
}

TRACE_WRAPPER
void
trace_ppb_flash_message_loop_quit(PP_Resource flash_message_loop)
{
    trace_info("[PPB] {full} %s flash_message_loop=%d\n", __func__+6, flash_message_loop);
    return ppb_flash_message_loop_quit(flash_message_loop);
}


const struct PPB_Flash_MessageLoop_0_1 ppb_flash_message_loop_interface_0_1 = {
    .Create =               TWRAPF(ppb_flash_message_loop_create),
    .IsFlashMessageLoop =   TWRAPF(ppb_flash_message_loop_is_flash_message_loop),
    .Run =                  TWRAPF(ppb_flash_message_loop_run),
    .Quit =                 TWRAPF(ppb_flash_message_loop_quit),
};

static
void
__attribute__((constructor))
constructor_ppb_flash_message_loop(void)
{
    register_interface(PPB_FLASH_MESSAGELOOP_INTERFACE_0_1, &ppb_flash_message_loop_interface_0_1);
    register_resource(PP_RESOURCE_FLASH_MESSAGE_LOOP, ppb_flash_message_loop_destroy);
}
Пример #24
0
TRACE_WRAPPER
struct PP_Var
trace_ppb_instance_private_get_owner_element_object(PP_Instance instance)
{
    trace_info("[PPB] {zilch} %s instance=%d\n", __func__+6, instance);
    return ppb_instance_private_get_owner_element_object(instance);
}

TRACE_WRAPPER
struct PP_Var
trace_ppb_instance_private_execute_script(PP_Instance instance, struct PP_Var script,
                                          struct PP_Var *exception)
{
    char *s_script = trace_var_as_string(script);
    trace_info("[PPB] {full} %s instance=%d, script=%s\n", __func__+6, instance, s_script);
    g_free(s_script);
    return ppb_instance_private_execute_script(instance, script, exception);
}


const struct PPB_Instance_1_0 ppb_instance_interface_1_0 = {
    .BindGraphics = TWRAPF(ppb_instance_bind_graphics),
    .IsFullFrame =  TWRAPF(ppb_instance_is_full_frame),
};

const struct PPB_Instance_Private_0_1 ppb_instance_private_interface_0_1 = {
    .GetWindowObject =          TWRAPF(ppb_instance_private_get_window_object),
    .GetOwnerElementObject =    TWRAPZ(ppb_instance_private_get_owner_element_object),
    .ExecuteScript =            TWRAPF(ppb_instance_private_execute_script),
};
Пример #25
0
    trace_info("[PPB] {fake} %s loader=%d\n", __func__+6, loader);
    ppb_url_loader_trusted_grant_universal_access(loader);
}

TRACE_WRAPPER
void
trace_ppb_url_loader_trusted_register_status_callback(PP_Resource loader,
                                                      PP_URLLoaderTrusted_StatusCallback cb)
{
    trace_info("[PPB] {zilch} %s loader=%d, cb=%p\n", __func__+6, loader, cb);
    ppb_url_loader_trusted_register_status_callback(loader, cb);
}


const struct PPB_URLLoader_1_0 ppb_url_loader_interface_1_0 = {
    .Create =                   TWRAPF(ppb_url_loader_create),
    .IsURLLoader =              TWRAPF(ppb_url_loader_is_url_loader),
    .Open =                     TWRAPF(ppb_url_loader_open),
    .FollowRedirect =           TWRAPF(ppb_url_loader_follow_redirect),
    .GetUploadProgress =        TWRAPZ(ppb_url_loader_get_upload_progress),
    .GetDownloadProgress =      TWRAPF(ppb_url_loader_get_download_progress),
    .GetResponseInfo =          TWRAPF(ppb_url_loader_get_response_info),
    .ReadResponseBody =         TWRAPF(ppb_url_loader_read_response_body),
    .FinishStreamingToFile =    TWRAPF(ppb_url_loader_finish_streaming_to_file),
    .Close =                    TWRAPF(ppb_url_loader_close),
};

const struct PPB_URLLoaderTrusted_0_3 ppb_url_loader_trusted_interface_0_3 = {
    .GrantUniversalAccess =     TWRAPZ(ppb_url_loader_trusted_grant_universal_access),
    .RegisterStatusCallback =   TWRAPZ(ppb_url_loader_trusted_register_status_callback),
};
trace_ppb_network_monitor_create(PP_Instance instance)
{
    trace_info("[PPB] {full} %s\n", __func__+6);
    return ppb_network_monitor_create(instance);
}

TRACE_WRAPPER
int32_t
trace_ppb_network_monitor_update_network_list(PP_Resource network_monitor,
                                              PP_Resource *network_list,
                                              struct PP_CompletionCallback callback)
{
    trace_info("[PPB] {zilch} %s\n", __func__+6);
    return ppb_network_monitor_update_network_list(network_monitor, network_list, callback);
}

TRACE_WRAPPER
PP_Bool
trace_ppb_network_monitor_is_network_monitor(PP_Resource resource)
{
    trace_info("[PPB] {full} %s\n", __func__+6);
    return ppb_network_monitor_is_network_monitor(resource);
}


const struct PPB_NetworkMonitor_1_0 ppb_network_monitor_interface_1_0 = {
    .Create =               TWRAPF(ppb_network_monitor_create),
    .UpdateNetworkList =    TWRAPZ(ppb_network_monitor_update_network_list),
    .IsNetworkMonitor =     TWRAPF(ppb_network_monitor_is_network_monitor),
};
TRACE_WRAPPER
PP_Bool
trace_ppb_url_request_info_append_file_to_body(PP_Resource request, PP_Resource file_ref,
        int64_t start_offset, int64_t number_of_bytes,
        PP_Time expected_last_modified_time)
{
    trace_info("[PPB] {full} %s request=%d, file_ref=%d, start_offset=%"PRId64", "
               "number_of_bytes=%"PRId64", expected_last_modified_time=%f\n", __func__+6, request,
               file_ref, start_offset, number_of_bytes, expected_last_modified_time);
    return ppb_url_request_info_append_file_to_body(request, file_ref, start_offset,
            number_of_bytes, expected_last_modified_time);
}


const struct PPB_URLRequestInfo_1_0 ppb_url_request_info_interface_1_0 = {
    .Create =           TWRAPF(ppb_url_request_info_create),
    .IsURLRequestInfo = TWRAPF(ppb_url_request_info_is_url_request_info),
    .SetProperty =      TWRAPF(ppb_url_request_info_set_property),
    .AppendDataToBody = TWRAPF(ppb_url_request_info_append_data_to_body),
    .AppendFileToBody = TWRAPF(ppb_url_request_info_append_file_to_body),
};

static
void
__attribute__((constructor))
constructor_ppb_url_request_info(void)
{
    register_interface(PPB_URLREQUESTINFO_INTERFACE_1_0, &ppb_url_request_info_interface_1_0);
    register_resource(PP_RESOURCE_URL_REQUEST_INFO, ppb_url_request_info_destroy);
}
Пример #28
0
{
    trace_info("[PPB] {full} %s instance=%d\n", __func__+6, instance);
    return ppb_printing_create(instance);
}

TRACE_WRAPPER
int32_t
trace_ppb_printing_get_default_print_settings(PP_Resource resource,
                                              struct PP_PrintSettings_Dev *print_settings,
                                              struct PP_CompletionCallback callback)
{
    trace_info("[PPB] {zilch} %s resource=%d, callback={.func=%p, .user_data=%p, .flags=%d}\n",
               __func__+6, resource, callback.func, callback.user_data, callback.flags);
    return ppb_printing_get_default_print_settings(resource, print_settings, callback);
}


const struct PPB_Printing_Dev_0_7 ppb_printing_dev_interface_0_7 = {
    .Create =                   TWRAPF(ppb_printing_create),
    .GetDefaultPrintSettings =  TWRAPZ(ppb_printing_get_default_print_settings),
};

static
void
__attribute__((constructor))
constructor_ppb_printing(void)
{
    register_interface(PPB_PRINTING_DEV_INTERFACE_0_7, &ppb_printing_dev_interface_0_7);
    register_resource(PP_RESOURCE_PRINTING, ppb_printing_destroy);
}
Пример #29
0
void
ppb_memory_dev_mem_free(void *ptr)
{
    npn.memfree(ptr); // TODO: is it safe to call npn.memfree()?
}


// trace wrappers
TRACE_WRAPPER
void *
trace_ppb_memory_dev_mem_alloc(uint32_t num_bytes)
{
    trace_info("[PPB] {full} %s num_bytes=%u\n", __func__+6, num_bytes);
    return ppb_memory_dev_mem_alloc(num_bytes);
}

TRACE_WRAPPER
void
trace_ppb_memory_dev_mem_free(void *ptr)
{
    trace_info("[PPB] {full} %s ptr=%p\n", __func__+6, ptr);
    ppb_memory_dev_mem_free(ptr);
}


const struct PPB_Memory_Dev_0_1 ppb_memory_dev_interface_0_1 = {
    .MemAlloc = TWRAPF(ppb_memory_dev_mem_alloc),
    .MemFree =  TWRAPF(ppb_memory_dev_mem_free),
};
Пример #30
0
                                                       struct PP_NetAddress_Private *addr_out)
{
    trace_info("[PPB] {zilch} %s\n", __func__+6);
    return ppb_net_address_private_create_from_ipv4_address(ip, port, addr_out);
}

TRACE_WRAPPER
void
trace_ppb_net_address_private_create_from_ipv6_address(const uint8_t ip[16], uint32_t scope_id,
                                                       uint16_t port,
                                                       struct PP_NetAddress_Private *addr_out)
{
    trace_info("[PPB] {zilch} %s\n", __func__+6);
    return ppb_net_address_private_create_from_ipv6_address(ip, scope_id, port, addr_out);
}


const struct PPB_NetAddress_Private_1_1 ppb_net_address_private_interface_1_1 = {
    .AreEqual =         TWRAPF(ppb_net_address_private_are_equal),
    .AreHostsEqual =    TWRAPF(ppb_net_address_private_are_hosts_equal),
    .Describe =         TWRAPZ(ppb_net_address_private_describe),
    .ReplacePort =      TWRAPF(ppb_net_address_private_replace_port),
    .GetAnyAddress =    TWRAPZ(ppb_net_address_private_get_any_address),
    .GetFamily =        TWRAPF(ppb_net_address_private_get_family),
    .GetPort =          TWRAPF(ppb_net_address_private_get_port),
    .GetAddress =       TWRAPF(ppb_net_address_private_get_address),
    .GetScopeID =       TWRAPZ(ppb_net_address_private_get_scope_id),
    .CreateFromIPv4Address = TWRAPZ(ppb_net_address_private_create_from_ipv4_address),
    .CreateFromIPv6Address = TWRAPZ(ppb_net_address_private_create_from_ipv6_address),
};