Source
static void es_browser_push_performance_entry(zbx_es_env_t *env, duk_context *ctx, zbx_wd_perf_entry_t *entry)
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/******************************************************************************
* *
* Purpose: return backing C structure embedded in browser object *
* *
******************************************************************************/
static zbx_webdriver_t *es_webdriver(duk_context *ctx)
{
zbx_webdriver_t *wd;
zbx_es_env_t *env;
void *objptr;
if (NULL == (env = zbx_es_get_env(ctx)))
{
(void)duk_push_error_object(ctx, DUK_RET_EVAL_ERROR, "cannot access internal environment");
return NULL;
}
duk_push_this(ctx);
objptr = duk_require_heapptr(ctx, -1);
duk_pop(ctx);
if (NULL == (wd = (zbx_webdriver_t *)es_obj_get_data(env, objptr, ES_OBJ_BROWSER)))
(void)duk_push_error_object(ctx, DUK_RET_EVAL_ERROR, "cannot find native data attached to object");
return wd;
}
/******************************************************************************
* *
* Purpose: browser destructor *