Return decompressed values from CefResourceBundle (fixes issue #2976)

This commit is contained in:
Mike Wiedenbauer
2020-07-21 15:55:54 +00:00
committed by Marshall Greenblatt
parent ca1c00f95d
commit 034bd641de
8 changed files with 88 additions and 157 deletions

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=b9577b495df3990284d4e4a3db2824196175dc91$
// $hash=b0e2b63b467c6d4e990405d948908da3546ea1c7$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
@@ -41,6 +41,7 @@
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
extern "C" {
@@ -70,34 +71,25 @@ typedef struct _cef_resource_bundle_t {
int string_id);
///
// Retrieves the contents of the specified scale independent |resource_id|. If
// the value is found then |data| and |data_size| will be populated and this
// function will return true (1). If the value is not found then this function
// will return false (0). The returned |data| pointer will remain resident in
// memory and should not be freed. Include cef_pack_resources.h for a listing
// of valid resource ID values.
// Returns a cef_binary_value_t containing the decompressed contents of the
// specified scale independent |resource_id| or NULL if not found. Include
// cef_pack_resources.h for a listing of valid resource ID values.
///
int(CEF_CALLBACK* get_data_resource)(struct _cef_resource_bundle_t* self,
int resource_id,
void** data,
size_t* data_size);
struct _cef_binary_value_t*(CEF_CALLBACK* get_data_resource)(
struct _cef_resource_bundle_t* self,
int resource_id);
///
// Retrieves the contents of the specified |resource_id| nearest the scale
// factor |scale_factor|. Use a |scale_factor| value of SCALE_FACTOR_NONE for
// scale independent resources or call GetDataResource instead. If the value
// is found then |data| and |data_size| will be populated and this function
// will return true (1). If the value is not found then this function will
// return false (0). The returned |data| pointer will remain resident in
// memory and should not be freed. Include cef_pack_resources.h for a listing
// of valid resource ID values.
// Returns a cef_binary_value_t containing the decompressed contents of the
// specified |resource_id| nearest the scale factor |scale_factor| or NULL if
// not found. Use a |scale_factor| value of SCALE_FACTOR_NONE for scale
// independent resources or call GetDataResource instead.Include
// cef_pack_resources.h for a listing of valid resource ID values.
///
int(CEF_CALLBACK* get_data_resource_for_scale)(
struct _cef_binary_value_t*(CEF_CALLBACK* get_data_resource_for_scale)(
struct _cef_resource_bundle_t* self,
int resource_id,
cef_scale_factor_t scale_factor,
void** data,
size_t* data_size);
cef_scale_factor_t scale_factor);
} cef_resource_bundle_t;
///