code
string | label
int64 |
|---|---|
psf_get_date_str (char *str, int maxlen)
{ time_t current ;
struct tm timedata, *tmptr ;
time (¤t) ;
#if defined (HAVE_GMTIME_R)
/* If the re-entrant version is available, use it. */
tmptr = gmtime_r (¤t, &timedata) ;
#elif defined (HAVE_GMTIME)
/* Otherwise use the standard one and copy the data to local storage. */
tmptr = gmtime (¤t) ;
memcpy (&timedata, tmptr, sizeof (timedata)) ;
#else
tmptr = NULL ;
#endif
if (tmptr)
snprintf (str, maxlen, "%4d-%02d-%02d %02d:%02d:%02d UTC",
1900 + timedata.tm_year, timedata.tm_mon, timedata.tm_mday,
timedata.tm_hour, timedata.tm_min, timedata.tm_sec) ;
else
snprintf (str, maxlen, "Unknown date") ;
return ;
} /* psf_get_date_str */
| 0
|
void MultibufferDataSource::CreateResourceLoader(int64_t first_byte_position,
int64_t last_byte_position) {
DCHECK(render_task_runner_->BelongsToCurrentThread());
SetReader(new MultiBufferReader(
url_data()->multibuffer(), first_byte_position, last_byte_position,
base::Bind(&MultibufferDataSource::ProgressCallback, weak_ptr_)));
reader_->SetIsClientAudioElement(is_client_audio_element_);
UpdateBufferSizes();
}
| 0
|
fbStore_a2r2g2b2 (FbBits *bits, const CARD32 *values, int x, int width, miIndexedPtr indexed)
{
int i;
CARD8 *pixel = ((CARD8 *) bits) + x;
for (i = 0; i < width; ++i) {
Splita(READ(values + i));
WRITE(pixel++, ((a ) & 0xc0) |
((r >> 2) & 0x30) |
((g >> 4) & 0x0c) |
((b >> 6) ));
}
}
| 0
|
void UsageTracker::DidGetClientGlobalUsage(StorageType type,
int64 usage,
int64 unlimited_usage) {
DCHECK_EQ(type, type_);
global_usage_.usage += usage;
global_usage_.unlimited_usage += unlimited_usage;
if (--global_usage_.pending_clients == 0) {
if (global_usage_.usage < 0)
global_usage_.usage = 0;
if (global_usage_.unlimited_usage > global_usage_.usage)
global_usage_.unlimited_usage = global_usage_.usage;
else if (global_usage_.unlimited_usage < 0)
global_usage_.unlimited_usage = 0;
global_usage_callbacks_.Run(type, global_usage_.usage,
global_usage_.unlimited_usage);
}
}
| 0
|
void BlobURLRequestJob::DidRead(int result) {
if (result < 0) {
NotifyFailure(net::ERR_FAILED);
return;
}
SetStatus(net::URLRequestStatus()); // Clear the IO_PENDING status
AdvanceBytesRead(result);
if (!read_buf_remaining_bytes_) {
int bytes_read = ReadCompleted();
NotifyReadComplete(bytes_read);
return;
}
int bytes_read = 0;
if (ReadLoop(&bytes_read))
NotifyReadComplete(bytes_read);
}
| 0
|
gss_get_mic (minor_status,
context_handle,
qop_req,
message_buffer,
msg_token)
OM_uint32 * minor_status;
gss_ctx_id_t context_handle;
gss_qop_t qop_req;
gss_buffer_t message_buffer;
gss_buffer_t msg_token;
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
status = val_get_mic_args(minor_status, context_handle,
qop_req, message_buffer, msg_token);
if (status != GSS_S_COMPLETE)
return (status);
/*
* select the approprate underlying mechanism routine and
* call it.
*/
ctx = (gss_union_ctx_id_t) context_handle;
mech = gssint_get_mechanism (ctx->mech_type);
if (mech) {
if (mech->gss_get_mic) {
status = mech->gss_get_mic(
minor_status,
ctx->internal_ctx_id,
qop_req,
message_buffer,
msg_token);
if (status != GSS_S_COMPLETE)
map_error(minor_status, mech);
} else
status = GSS_S_UNAVAILABLE;
return(status);
}
return (GSS_S_BAD_MECH);
}
| 1
|
void PluginServiceImpl::RegisterFilePathWatcher(FilePathWatcher* watcher,
const FilePath& path) {
bool result = watcher->Watch(path, false,
base::Bind(&NotifyPluginDirChanged));
DCHECK(result);
}
| 0
|
record_loop_stats(
double offset, /* offset */
double freq, /* frequency (PPM) */
double jitter, /* jitter */
double wander, /* wander (PPM) */
int spoll
)
{
l_fp now;
u_long day;
if (!stats_control)
return;
get_systime(&now);
filegen_setup(&loopstats, now.l_ui);
day = now.l_ui / 86400 + MJD_1900;
now.l_ui %= 86400;
if (loopstats.fp != NULL) {
fprintf(loopstats.fp, "%lu %s %.9f %.3f %.9f %.6f %d\n",
day, ulfptoa(&now, 3), offset, freq * 1e6, jitter,
wander * 1e6, spoll);
fflush(loopstats.fp);
}
}
| 0
|
static void hns_xgmac_exc_irq_en(struct mac_driver *drv, u32 en)
{
u32 clr_vlue = 0xfffffffful;
u32 msk_vlue = en ? 0xfffffffful : 0; /*1 is en, 0 is dis*/
dsaf_write_dev(drv, XGMAC_INT_STATUS_REG, clr_vlue);
dsaf_write_dev(drv, XGMAC_INT_ENABLE_REG, msk_vlue);
}
| 0
|
void BaseRenderingContext2D::clip(Path2D* dom_path,
const String& winding_rule_string) {
ClipInternal(dom_path->GetPath(), winding_rule_string);
}
| 0
|
int http_process_request(struct session *s, struct channel *req, int an_bit)
{
struct http_txn *txn = &s->txn;
struct http_msg *msg = &txn->req;
struct connection *cli_conn = objt_conn(req->prod->end);
if (unlikely(msg->msg_state < HTTP_MSG_BODY)) {
/* we need more data */
channel_dont_connect(req);
return 0;
}
DPRINTF(stderr,"[%u] %s: session=%p b=%p, exp(r,w)=%u,%u bf=%08x bh=%d analysers=%02x\n",
now_ms, __FUNCTION__,
s,
req,
req->rex, req->wex,
req->flags,
req->buf->i,
req->analysers);
if (s->fe->comp || s->be->comp)
select_compression_request_header(s, req->buf);
/*
* Right now, we know that we have processed the entire headers
* and that unwanted requests have been filtered out. We can do
* whatever we want with the remaining request. Also, now we
* may have separate values for ->fe, ->be.
*/
/*
* If HTTP PROXY is set we simply get remote server address parsing
* incoming request. Note that this requires that a connection is
* allocated on the server side.
*/
if ((s->be->options & PR_O_HTTP_PROXY) && !(s->flags & SN_ADDR_SET)) {
struct connection *conn;
char *path;
/* Note that for now we don't reuse existing proxy connections */
if (unlikely((conn = si_alloc_conn(req->cons, 0)) == NULL)) {
txn->req.msg_state = HTTP_MSG_ERROR;
txn->status = 500;
req->analysers = 0;
stream_int_retnclose(req->prod, http_error_message(s, HTTP_ERR_500));
if (!(s->flags & SN_ERR_MASK))
s->flags |= SN_ERR_RESOURCE;
if (!(s->flags & SN_FINST_MASK))
s->flags |= SN_FINST_R;
return 0;
}
path = http_get_path(txn);
url2sa(req->buf->p + msg->sl.rq.u,
path ? path - (req->buf->p + msg->sl.rq.u) : msg->sl.rq.u_l,
&conn->addr.to, NULL);
/* if the path was found, we have to remove everything between
* req->buf->p + msg->sl.rq.u and path (excluded). If it was not
* found, we need to replace from req->buf->p + msg->sl.rq.u for
* u_l characters by a single "/".
*/
if (path) {
char *cur_ptr = req->buf->p;
char *cur_end = cur_ptr + txn->req.sl.rq.l;
int delta;
delta = buffer_replace2(req->buf, req->buf->p + msg->sl.rq.u, path, NULL, 0);
http_msg_move_end(&txn->req, delta);
cur_end += delta;
if (http_parse_reqline(&txn->req, HTTP_MSG_RQMETH, cur_ptr, cur_end + 1, NULL, NULL) == NULL)
goto return_bad_req;
}
else {
char *cur_ptr = req->buf->p;
char *cur_end = cur_ptr + txn->req.sl.rq.l;
int delta;
delta = buffer_replace2(req->buf, req->buf->p + msg->sl.rq.u,
req->buf->p + msg->sl.rq.u + msg->sl.rq.u_l, "/", 1);
http_msg_move_end(&txn->req, delta);
cur_end += delta;
if (http_parse_reqline(&txn->req, HTTP_MSG_RQMETH, cur_ptr, cur_end + 1, NULL, NULL) == NULL)
goto return_bad_req;
}
}
/*
* 7: Now we can work with the cookies.
* Note that doing so might move headers in the request, but
* the fields will stay coherent and the URI will not move.
* This should only be performed in the backend.
*/
if ((s->be->cookie_name || s->be->appsession_name || s->fe->capture_name)
&& !(txn->flags & (TX_CLDENY|TX_CLTARPIT)))
manage_client_side_cookies(s, req);
/*
* 8: the appsession cookie was looked up very early in 1.2,
* so let's do the same now.
*/
/* It needs to look into the URI unless persistence must be ignored */
if ((txn->sessid == NULL) && s->be->appsession_name && !(s->flags & SN_IGNORE_PRST)) {
get_srv_from_appsession(s, req->buf->p + msg->sl.rq.u, msg->sl.rq.u_l);
}
/* add unique-id if "header-unique-id" is specified */
if (!LIST_ISEMPTY(&s->fe->format_unique_id)) {
if ((s->unique_id = pool_alloc2(pool2_uniqueid)) == NULL)
goto return_bad_req;
s->unique_id[0] = '\0';
build_logline(s, s->unique_id, UNIQUEID_LEN, &s->fe->format_unique_id);
}
if (s->fe->header_unique_id && s->unique_id) {
chunk_printf(&trash, "%s: %s", s->fe->header_unique_id, s->unique_id);
if (trash.len < 0)
goto return_bad_req;
if (unlikely(http_header_add_tail2(&txn->req, &txn->hdr_idx, trash.str, trash.len) < 0))
goto return_bad_req;
}
/*
* 9: add X-Forwarded-For if either the frontend or the backend
* asks for it.
*/
if ((s->fe->options | s->be->options) & PR_O_FWDFOR) {
struct hdr_ctx ctx = { .idx = 0 };
if (!((s->fe->options | s->be->options) & PR_O_FF_ALWAYS) &&
http_find_header2(s->be->fwdfor_hdr_len ? s->be->fwdfor_hdr_name : s->fe->fwdfor_hdr_name,
s->be->fwdfor_hdr_len ? s->be->fwdfor_hdr_len : s->fe->fwdfor_hdr_len,
req->buf->p, &txn->hdr_idx, &ctx)) {
/* The header is set to be added only if none is present
* and we found it, so don't do anything.
*/
}
else if (cli_conn && cli_conn->addr.from.ss_family == AF_INET) {
/* Add an X-Forwarded-For header unless the source IP is
* in the 'except' network range.
*/
if ((!s->fe->except_mask.s_addr ||
(((struct sockaddr_in *)&cli_conn->addr.from)->sin_addr.s_addr & s->fe->except_mask.s_addr)
!= s->fe->except_net.s_addr) &&
(!s->be->except_mask.s_addr ||
(((struct sockaddr_in *)&cli_conn->addr.from)->sin_addr.s_addr & s->be->except_mask.s_addr)
!= s->be->except_net.s_addr)) {
int len;
unsigned char *pn;
pn = (unsigned char *)&((struct sockaddr_in *)&cli_conn->addr.from)->sin_addr;
/* Note: we rely on the backend to get the header name to be used for
* x-forwarded-for, because the header is really meant for the backends.
* However, if the backend did not specify any option, we have to rely
* on the frontend's header name.
*/
if (s->be->fwdfor_hdr_len) {
len = s->be->fwdfor_hdr_len;
memcpy(trash.str, s->be->fwdfor_hdr_name, len);
} else {
len = s->fe->fwdfor_hdr_len;
memcpy(trash.str, s->fe->fwdfor_hdr_name, len);
}
len += snprintf(trash.str + len, trash.size - len, ": %d.%d.%d.%d", pn[0], pn[1], pn[2], pn[3]);
if (unlikely(http_header_add_tail2(&txn->req, &txn->hdr_idx, trash.str, len) < 0))
goto return_bad_req;
}
}
else if (cli_conn && cli_conn->addr.from.ss_family == AF_INET6) {
/* FIXME: for the sake of completeness, we should also support
* 'except' here, although it is mostly useless in this case.
*/
int len;
char pn[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6,
(const void *)&((struct sockaddr_in6 *)(&cli_conn->addr.from))->sin6_addr,
pn, sizeof(pn));
/* Note: we rely on the backend to get the header name to be used for
* x-forwarded-for, because the header is really meant for the backends.
* However, if the backend did not specify any option, we have to rely
* on the frontend's header name.
*/
if (s->be->fwdfor_hdr_len) {
len = s->be->fwdfor_hdr_len;
memcpy(trash.str, s->be->fwdfor_hdr_name, len);
} else {
len = s->fe->fwdfor_hdr_len;
memcpy(trash.str, s->fe->fwdfor_hdr_name, len);
}
len += snprintf(trash.str + len, trash.size - len, ": %s", pn);
if (unlikely(http_header_add_tail2(&txn->req, &txn->hdr_idx, trash.str, len) < 0))
goto return_bad_req;
}
}
/*
* 10: add X-Original-To if either the frontend or the backend
* asks for it.
*/
if ((s->fe->options | s->be->options) & PR_O_ORGTO) {
/* FIXME: don't know if IPv6 can handle that case too. */
if (cli_conn && cli_conn->addr.from.ss_family == AF_INET) {
/* Add an X-Original-To header unless the destination IP is
* in the 'except' network range.
*/
conn_get_to_addr(cli_conn);
if (cli_conn->addr.to.ss_family == AF_INET &&
((!s->fe->except_mask_to.s_addr ||
(((struct sockaddr_in *)&cli_conn->addr.to)->sin_addr.s_addr & s->fe->except_mask_to.s_addr)
!= s->fe->except_to.s_addr) &&
(!s->be->except_mask_to.s_addr ||
(((struct sockaddr_in *)&cli_conn->addr.to)->sin_addr.s_addr & s->be->except_mask_to.s_addr)
!= s->be->except_to.s_addr))) {
int len;
unsigned char *pn;
pn = (unsigned char *)&((struct sockaddr_in *)&cli_conn->addr.to)->sin_addr;
/* Note: we rely on the backend to get the header name to be used for
* x-original-to, because the header is really meant for the backends.
* However, if the backend did not specify any option, we have to rely
* on the frontend's header name.
*/
if (s->be->orgto_hdr_len) {
len = s->be->orgto_hdr_len;
memcpy(trash.str, s->be->orgto_hdr_name, len);
} else {
len = s->fe->orgto_hdr_len;
memcpy(trash.str, s->fe->orgto_hdr_name, len);
}
len += snprintf(trash.str + len, trash.size - len, ": %d.%d.%d.%d", pn[0], pn[1], pn[2], pn[3]);
if (unlikely(http_header_add_tail2(&txn->req, &txn->hdr_idx, trash.str, len) < 0))
goto return_bad_req;
}
}
}
/* 11: add "Connection: close" or "Connection: keep-alive" if needed and not yet set.
* If an "Upgrade" token is found, the header is left untouched in order not to have
* to deal with some servers bugs : some of them fail an Upgrade if anything but
* "Upgrade" is present in the Connection header.
*/
if (!(txn->flags & TX_HDR_CONN_UPG) &&
(((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_TUN) ||
((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL ||
(s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL))) {
unsigned int want_flags = 0;
if (msg->flags & HTTP_MSGF_VER_11) {
if (((txn->flags & TX_CON_WANT_MSK) >= TX_CON_WANT_SCL ||
((s->fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL ||
(s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_PCL)) &&
!((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA))
want_flags |= TX_CON_CLO_SET;
} else {
if (((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_KAL &&
((s->fe->options & PR_O_HTTP_MODE) != PR_O_HTTP_PCL &&
(s->be->options & PR_O_HTTP_MODE) != PR_O_HTTP_PCL)) ||
((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA))
want_flags |= TX_CON_KAL_SET;
}
if (want_flags != (txn->flags & (TX_CON_CLO_SET|TX_CON_KAL_SET)))
http_change_connection_header(txn, msg, want_flags);
}
/* If we have no server assigned yet and we're balancing on url_param
* with a POST request, we may be interested in checking the body for
* that parameter. This will be done in another analyser.
*/
if (!(s->flags & (SN_ASSIGNED|SN_DIRECT)) &&
s->txn.meth == HTTP_METH_POST && s->be->url_param_name != NULL &&
(msg->flags & (HTTP_MSGF_CNT_LEN|HTTP_MSGF_TE_CHNK))) {
channel_dont_connect(req);
req->analysers |= AN_REQ_HTTP_BODY;
}
if (msg->flags & HTTP_MSGF_XFER_LEN) {
req->analysers |= AN_REQ_HTTP_XFER_BODY;
#ifdef TCP_QUICKACK
/* We expect some data from the client. Unless we know for sure
* we already have a full request, we have to re-enable quick-ack
* in case we previously disabled it, otherwise we might cause
* the client to delay further data.
*/
if ((s->listener->options & LI_O_NOQUICKACK) &&
cli_conn && conn_ctrl_ready(cli_conn) &&
((msg->flags & HTTP_MSGF_TE_CHNK) ||
(msg->body_len > req->buf->i - txn->req.eoh - 2)))
setsockopt(cli_conn->t.sock.fd, IPPROTO_TCP, TCP_QUICKACK, &one, sizeof(one));
#endif
}
/*************************************************************
* OK, that's finished for the headers. We have done what we *
* could. Let's switch to the DATA state. *
************************************************************/
req->analyse_exp = TICK_ETERNITY;
req->analysers &= ~an_bit;
/* if the server closes the connection, we want to immediately react
* and close the socket to save packets and syscalls.
*/
if (!(req->analysers & AN_REQ_HTTP_XFER_BODY))
req->cons->flags |= SI_FL_NOHALF;
s->logs.tv_request = now;
/* OK let's go on with the BODY now */
return 1;
return_bad_req: /* let's centralize all bad requests */
if (unlikely(msg->msg_state == HTTP_MSG_ERROR) || msg->err_pos >= 0) {
/* we detected a parsing error. We want to archive this request
* in the dedicated proxy area for later troubleshooting.
*/
http_capture_bad_message(&s->fe->invalid_req, s, msg, msg->msg_state, s->fe);
}
txn->req.msg_state = HTTP_MSG_ERROR;
txn->status = 400;
req->analysers = 0;
stream_int_retnclose(req->prod, http_error_message(s, HTTP_ERR_400));
s->fe->fe_counters.failed_req++;
if (s->listener->counters)
s->listener->counters->failed_req++;
if (!(s->flags & SN_ERR_MASK))
s->flags |= SN_ERR_PRXCOND;
if (!(s->flags & SN_FINST_MASK))
s->flags |= SN_FINST_R;
return 0;
}
| 0
|
void crypto_aes_encrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
{
aes_enc_blk(ctx, dst, src);
}
| 0
|
error::Error GLES2DecoderPassthroughImpl::DoDeletePathsCHROMIUM(GLuint path,
GLsizei range) {
NOTIMPLEMENTED();
return error::kNoError;
}
| 0
|
void VideoCaptureImpl::OnBufferCreated(int32_t buffer_id,
mojo::ScopedSharedBufferHandle handle) {
DVLOG(1) << __func__ << " buffer_id: " << buffer_id;
DCHECK(io_thread_checker_.CalledOnValidThread());
DCHECK(handle.is_valid());
base::SharedMemoryHandle memory_handle;
size_t memory_size = 0;
bool read_only_flag = false;
const MojoResult result = mojo::UnwrapSharedMemoryHandle(
std::move(handle), &memory_handle, &memory_size, &read_only_flag);
DCHECK_EQ(MOJO_RESULT_OK, result);
DCHECK_GT(memory_size, 0u);
std::unique_ptr<base::SharedMemory> shm(
new base::SharedMemory(memory_handle, true /* read_only */));
if (!shm->Map(memory_size)) {
DLOG(ERROR) << "OnBufferCreated: Map failed.";
return;
}
const bool inserted =
client_buffers_
.insert(std::make_pair(buffer_id,
new ClientBuffer(std::move(shm), memory_size)))
.second;
DCHECK(inserted);
}
| 1
|
void FFmpegVideoDecodeEngine::DecodeFrame(scoped_refptr<Buffer> buffer) {
scoped_refptr<VideoFrame> video_frame;
AVPacket packet;
av_init_packet(&packet);
packet.data = const_cast<uint8*>(buffer->GetData());
packet.size = buffer->GetDataSize();
PipelineStatistics statistics;
statistics.video_bytes_decoded = buffer->GetDataSize();
codec_context_->reordered_opaque = buffer->GetTimestamp().InMicroseconds();
av_frame_->reordered_opaque = codec_context_->reordered_opaque;
int frame_decoded = 0;
int result = avcodec_decode_video2(codec_context_,
av_frame_.get(),
&frame_decoded,
&packet);
if (result < 0) {
LOG(ERROR) << "Error decoding a video frame with timestamp: "
<< buffer->GetTimestamp().InMicroseconds() << " us, duration: "
<< buffer->GetDuration().InMicroseconds() << " us, packet size: "
<< buffer->GetDataSize() << " bytes";
event_handler_->OnError();
return;
}
if (frame_decoded == 0) {
if (buffer->IsEndOfStream()) { // We had started flushing.
event_handler_->ConsumeVideoFrame(video_frame, statistics);
output_eos_reached_ = true;
} else {
ReadInput();
}
return;
}
if (!av_frame_->data[VideoFrame::kYPlane] ||
!av_frame_->data[VideoFrame::kUPlane] ||
!av_frame_->data[VideoFrame::kVPlane]) {
event_handler_->OnError();
return;
}
DCHECK_LE(av_frame_->repeat_pict, 2); // Sanity check.
AVRational doubled_time_base;
doubled_time_base.num = frame_rate_denominator_;
doubled_time_base.den = frame_rate_numerator_ * 2;
base::TimeDelta timestamp =
base::TimeDelta::FromMicroseconds(av_frame_->reordered_opaque);
base::TimeDelta duration =
ConvertFromTimeBase(doubled_time_base, 2 + av_frame_->repeat_pict);
DCHECK(frame_queue_available_.size());
video_frame = frame_queue_available_.front();
frame_queue_available_.pop_front();
size_t height = codec_context_->height;
CopyPlane(VideoFrame::kYPlane, video_frame.get(), av_frame_.get(), height);
CopyPlane(VideoFrame::kUPlane, video_frame.get(), av_frame_.get(), height);
CopyPlane(VideoFrame::kVPlane, video_frame.get(), av_frame_.get(), height);
video_frame->SetTimestamp(timestamp);
video_frame->SetDuration(duration);
pending_output_buffers_--;
event_handler_->ConsumeVideoFrame(video_frame, statistics);
}
| 0
|
void Performance::BuildJSONValue(V8ObjectBuilder& builder) const {
builder.AddNumber("timeOrigin", timeOrigin());
}
| 0
|
void RenderView::OnRedo() {
if (!webview())
return;
webview()->focusedFrame()->executeCommand(WebString::fromUTF8("Redo"));
}
| 0
|
void RenderWidgetHostImpl::AddMouseEventCallback(
const MouseEventCallback& callback) {
mouse_event_callbacks_.push_back(callback);
}
| 0
|
void HTMLFormControlElement::didChangeForm() {
ListedElement::didChangeForm();
formOwnerSetNeedsValidityCheck();
if (formOwner() && isConnected() && canBeSuccessfulSubmitButton())
formOwner()->invalidateDefaultButtonStyle();
}
| 0
|
IMPEG2D_ERROR_CODES_T impeg2d_pre_pic_dec_proc(dec_state_t *ps_dec)
{
WORD32 u4_get_disp;
pic_buf_t *ps_disp_pic;
IMPEG2D_ERROR_CODES_T e_error = (IMPEG2D_ERROR_CODES_T)IVD_ERROR_NONE;
u4_get_disp = 0;
ps_disp_pic = NULL;
/* Field Picture */
if(ps_dec->u2_picture_structure != FRAME_PICTURE)
{
ps_dec->u2_num_vert_mb = (ps_dec->u2_vertical_size + 31) >> 5;
if(ps_dec->u2_num_flds_decoded == 0)
{
pic_buf_t *ps_pic_buf;
u4_get_disp = 1;
ps_pic_buf = impeg2_buf_mgr_get_next_free(ps_dec->pv_pic_buf_mg, &ps_dec->i4_cur_buf_id);
if (NULL == ps_pic_buf)
{
return IMPEG2D_NO_FREE_BUF_ERR;
}
impeg2_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_pic_buf_mg, ps_dec->i4_cur_buf_id, BUF_MGR_DISP);
impeg2_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_pic_buf_mg, ps_dec->i4_cur_buf_id, BUF_MGR_REF);
ps_pic_buf->u4_ts = ps_dec->u4_inp_ts;
ps_pic_buf->e_pic_type = ps_dec->e_pic_type;
ps_dec->ps_cur_pic = ps_pic_buf;
ps_dec->s_cur_frm_buf.pu1_y = ps_pic_buf->pu1_y;
ps_dec->s_cur_frm_buf.pu1_u = ps_pic_buf->pu1_u;
ps_dec->s_cur_frm_buf.pu1_v = ps_pic_buf->pu1_v;
}
if(ps_dec->u2_picture_structure == TOP_FIELD)
{
ps_dec->u2_fld_parity = TOP;
}
else
{
ps_dec->u2_fld_parity = BOTTOM;
}
ps_dec->u2_field_dct = 0;
ps_dec->u2_read_dct_type = 0;
ps_dec->u2_read_motion_type = 1;
ps_dec->u2_fld_pic = 1;
ps_dec->u2_frm_pic = 0;
ps_dec->ps_func_forw_or_back = gas_impeg2d_func_fld_fw_or_bk;
ps_dec->ps_func_bi_direct = gas_impeg2d_func_fld_bi_direct;
}
/* Frame Picture */
else
{
pic_buf_t *ps_pic_buf;
ps_dec->u2_num_vert_mb = (ps_dec->u2_vertical_size + 15) >> 4;
u4_get_disp = 1;
ps_pic_buf = impeg2_buf_mgr_get_next_free(ps_dec->pv_pic_buf_mg, &ps_dec->i4_cur_buf_id);
if (NULL == ps_pic_buf)
{
return IMPEG2D_NO_FREE_BUF_ERR;
}
impeg2_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_pic_buf_mg, ps_dec->i4_cur_buf_id, BUF_MGR_DISP);
impeg2_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_pic_buf_mg, ps_dec->i4_cur_buf_id, BUF_MGR_REF);
ps_pic_buf->u4_ts = ps_dec->u4_inp_ts;
ps_pic_buf->e_pic_type = ps_dec->e_pic_type;
ps_dec->ps_cur_pic = ps_pic_buf;
ps_dec->s_cur_frm_buf.pu1_y = ps_pic_buf->pu1_y;
ps_dec->s_cur_frm_buf.pu1_u = ps_pic_buf->pu1_u;
ps_dec->s_cur_frm_buf.pu1_v = ps_pic_buf->pu1_v;
if(ps_dec->u2_frame_pred_frame_dct == 0)
{
ps_dec->u2_read_dct_type = 1;
ps_dec->u2_read_motion_type = 1;
}
else
{
ps_dec->u2_read_dct_type = 0;
ps_dec->u2_read_motion_type = 0;
ps_dec->u2_motion_type = 2;
ps_dec->u2_field_dct = 0;
}
ps_dec->u2_fld_parity = TOP;
ps_dec->u2_fld_pic = 0;
ps_dec->u2_frm_pic = 1;
ps_dec->ps_func_forw_or_back = gas_impeg2d_func_frm_fw_or_bk;
ps_dec->ps_func_bi_direct = gas_impeg2d_func_frm_bi_direct;
}
ps_dec->u2_def_dc_pred[Y_LUMA] = 128 << ps_dec->u2_intra_dc_precision;
ps_dec->u2_def_dc_pred[U_CHROMA] = 128 << ps_dec->u2_intra_dc_precision;
ps_dec->u2_def_dc_pred[V_CHROMA] = 128 << ps_dec->u2_intra_dc_precision;
ps_dec->u2_num_mbs_left = ps_dec->u2_num_horiz_mb * ps_dec->u2_num_vert_mb;
if(u4_get_disp)
{
if(ps_dec->u4_num_frames_decoded > 1)
{
ps_disp_pic = impeg2_disp_mgr_get(&ps_dec->s_disp_mgr, &ps_dec->i4_disp_buf_id);
}
ps_dec->ps_disp_pic = ps_disp_pic;
if(ps_disp_pic)
{
if(1 == ps_dec->u4_share_disp_buf)
{
ps_dec->ps_disp_frm_buf->pv_y_buf = ps_disp_pic->pu1_y;
if(IV_YUV_420P == ps_dec->i4_chromaFormat)
{
ps_dec->ps_disp_frm_buf->pv_u_buf = ps_disp_pic->pu1_u;
ps_dec->ps_disp_frm_buf->pv_v_buf = ps_disp_pic->pu1_v;
}
else
{
UWORD8 *pu1_buf;
pu1_buf = ps_dec->as_disp_buffers[ps_disp_pic->i4_buf_id].pu1_bufs[1];
ps_dec->ps_disp_frm_buf->pv_u_buf = pu1_buf;
pu1_buf = ps_dec->as_disp_buffers[ps_disp_pic->i4_buf_id].pu1_bufs[2];
ps_dec->ps_disp_frm_buf->pv_v_buf = pu1_buf;
}
}
}
}
switch(ps_dec->e_pic_type)
{
case I_PIC:
{
ps_dec->pf_decode_slice = impeg2d_dec_i_slice;
break;
}
case D_PIC:
{
ps_dec->pf_decode_slice = impeg2d_dec_d_slice;
break;
}
case P_PIC:
{
ps_dec->pf_decode_slice = impeg2d_dec_p_b_slice;
ps_dec->pu2_mb_type = gau2_impeg2d_p_mb_type;
break;
}
case B_PIC:
{
ps_dec->pf_decode_slice = impeg2d_dec_p_b_slice;
ps_dec->pu2_mb_type = gau2_impeg2d_b_mb_type;
break;
}
default:
return IMPEG2D_INVALID_PIC_TYPE;
}
/*************************************************************************/
/* Set the reference pictures */
/*************************************************************************/
/* Error resilience: If forward and backward pictures are going to be NULL*/
/* then assign both to the current */
/* if one of them NULL then we will assign the non null to the NULL one */
if(ps_dec->e_pic_type == P_PIC)
{
if (NULL == ps_dec->as_recent_fld[1][0].pu1_y)
{
ps_dec->as_recent_fld[1][0] = ps_dec->s_cur_frm_buf;
}
if (NULL == ps_dec->as_recent_fld[1][1].pu1_y)
{
impeg2d_get_bottom_field_buf(&ps_dec->s_cur_frm_buf, &ps_dec->as_recent_fld[1][1],
ps_dec->u2_frame_width);
}
ps_dec->as_ref_buf[FORW][TOP] = ps_dec->as_recent_fld[1][0];
ps_dec->as_ref_buf[FORW][BOTTOM] = ps_dec->as_recent_fld[1][1];
}
else if(ps_dec->e_pic_type == B_PIC)
{
if((NULL == ps_dec->as_recent_fld[1][0].pu1_y) && (NULL == ps_dec->as_recent_fld[0][0].pu1_y))
{
ps_dec->as_recent_fld[1][0] = ps_dec->s_cur_frm_buf;
impeg2d_get_bottom_field_buf(&ps_dec->s_cur_frm_buf, &ps_dec->as_recent_fld[1][1],
ps_dec->u2_frame_width);
ps_dec->as_recent_fld[0][0] = ps_dec->s_cur_frm_buf;
ps_dec->as_recent_fld[0][1] = ps_dec->as_recent_fld[1][1];
}
else if ((NULL != ps_dec->as_recent_fld[1][0].pu1_y) && (NULL == ps_dec->as_recent_fld[0][0].pu1_y))
{
ps_dec->as_recent_fld[0][0] = ps_dec->as_recent_fld[1][0];
ps_dec->as_recent_fld[0][1] = ps_dec->as_recent_fld[1][1];
}
else if ((NULL == ps_dec->as_recent_fld[1][0].pu1_y) && (NULL != ps_dec->as_recent_fld[0][0].pu1_y))
{
ps_dec->as_recent_fld[1][0] = ps_dec->as_recent_fld[0][0];
ps_dec->as_recent_fld[1][1] = ps_dec->as_recent_fld[0][1];
}
ps_dec->as_ref_buf[FORW][TOP] = ps_dec->as_recent_fld[0][0];
ps_dec->as_ref_buf[FORW][BOTTOM] = ps_dec->as_recent_fld[0][1];
ps_dec->as_ref_buf[BACK][TOP] = ps_dec->as_recent_fld[1][0];
ps_dec->as_ref_buf[BACK][BOTTOM] = ps_dec->as_recent_fld[1][1];
}
return e_error;
}
| 0
|
static void tg3_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
if (dev) {
struct tg3 *tp = netdev_priv(dev);
release_firmware(tp->fw);
tg3_reset_task_cancel(tp);
if (tg3_flag(tp, USE_PHYLIB)) {
tg3_phy_fini(tp);
tg3_mdio_fini(tp);
}
unregister_netdev(dev);
if (tp->aperegs) {
iounmap(tp->aperegs);
tp->aperegs = NULL;
}
if (tp->regs) {
iounmap(tp->regs);
tp->regs = NULL;
}
free_netdev(dev);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
}
| 0
|
void *Type_LUT16_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag)
{
cmsUInt8Number InputChannels, OutputChannels, CLUTpoints;
cmsPipeline* NewLUT = NULL;
cmsUInt32Number nTabSize;
cmsFloat64Number Matrix[3*3];
cmsUInt16Number InputEntries, OutputEntries;
*nItems = 0;
if (!_cmsReadUInt8Number(io, &InputChannels)) return NULL;
if (!_cmsReadUInt8Number(io, &OutputChannels)) return NULL;
if (!_cmsReadUInt8Number(io, &CLUTpoints)) return NULL; // 255 maximum
if (!_cmsReadUInt8Number(io, NULL)) return NULL;
if (InputChannels > cmsMAXCHANNELS) goto Error;
if (OutputChannels > cmsMAXCHANNELS) goto Error;
NewLUT = cmsPipelineAlloc(self ->ContextID, InputChannels, OutputChannels);
if (NewLUT == NULL) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[0])) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[1])) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[2])) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[3])) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[4])) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[5])) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[6])) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[7])) goto Error;
if (!_cmsRead15Fixed16Number(io, &Matrix[8])) goto Error;
if ((InputChannels == 3) && !_cmsMAT3isIdentity((cmsMAT3*) Matrix)) {
if (!cmsPipelineInsertStage(NewLUT, cmsAT_END, cmsStageAllocMatrix(self ->ContextID, 3, 3, Matrix, NULL)))
goto Error;
}
if (!_cmsReadUInt16Number(io, &InputEntries)) goto Error;
if (!_cmsReadUInt16Number(io, &OutputEntries)) goto Error;
if (InputEntries > 0x7FFF || OutputEntries > 0x7FFF) goto Error;
if (CLUTpoints == 1) goto Error; // Impossible value, 0 for no CLUT and then 2 at least
if (!Read16bitTables(self ->ContextID, io, NewLUT, InputChannels, InputEntries)) goto Error;
nTabSize = uipow(OutputChannels, CLUTpoints, InputChannels);
if (nTabSize == (cmsUInt32Number) -1) goto Error;
if (nTabSize > 0) {
cmsUInt16Number *T;
T = (cmsUInt16Number*) _cmsCalloc(self ->ContextID, nTabSize, sizeof(cmsUInt16Number));
if (T == NULL) goto Error;
if (!_cmsReadUInt16Array(io, nTabSize, T)) {
_cmsFree(self ->ContextID, T);
goto Error;
}
if (!cmsPipelineInsertStage(NewLUT, cmsAT_END, cmsStageAllocCLut16bit(self ->ContextID, CLUTpoints, InputChannels, OutputChannels, T))) {
_cmsFree(self ->ContextID, T);
goto Error;
}
_cmsFree(self ->ContextID, T);
}
if (!Read16bitTables(self ->ContextID, io, NewLUT, OutputChannels, OutputEntries)) goto Error;
*nItems = 1;
return NewLUT;
Error:
if (NewLUT != NULL) cmsPipelineFree(NewLUT);
return NULL;
cmsUNUSED_PARAMETER(SizeOfTag);
}
| 0
|
static int start_audio_datapath(struct a2dp_stream_common *common)
{
INFO("state %d", common->state);
if (common->ctrl_fd == AUDIO_SKT_DISCONNECTED) {
INFO("%s AUDIO_SKT_DISCONNECTED", __func__);
return -1;
}
int oldstate = common->state;
common->state = AUDIO_A2DP_STATE_STARTING;
int a2dp_status = a2dp_command(common, A2DP_CTRL_CMD_START);
if (a2dp_status < 0)
{
ERROR("%s Audiopath start failed (status %d)", __func__, a2dp_status);
common->state = oldstate;
return -1;
}
else if (a2dp_status == A2DP_CTRL_ACK_INCALL_FAILURE)
{
ERROR("%s Audiopath start failed - in call, move to suspended", __func__);
common->state = oldstate;
return -1;
}
/* connect socket if not yet connected */
if (common->audio_fd == AUDIO_SKT_DISCONNECTED)
{
common->audio_fd = skt_connect(A2DP_DATA_PATH, common->buffer_sz);
if (common->audio_fd < 0)
{
common->state = oldstate;
return -1;
}
common->state = AUDIO_A2DP_STATE_STARTED;
}
return 0;
}
| 0
|
UpdateTouchesForGrab(DeviceIntPtr mouse)
{
int i;
if (!mouse->touch || mouse->deviceGrab.fromPassiveGrab)
return;
for (i = 0; i < mouse->touch->num_touches; i++) {
TouchPointInfoPtr ti = mouse->touch->touches + i;
TouchListener *listener = &ti->listeners[0];
GrabPtr grab = mouse->deviceGrab.grab;
if (ti->active &&
CLIENT_BITS(listener->listener) == grab->resource) {
listener->listener = grab->resource;
listener->level = grab->grabtype;
listener->state = LISTENER_IS_OWNER;
listener->window = grab->window;
if (grab->grabtype == CORE || grab->grabtype == XI ||
!xi2mask_isset(grab->xi2mask, mouse, XI_TouchBegin))
listener->type = LISTENER_POINTER_GRAB;
else
listener->type = LISTENER_GRAB;
if (listener->grab)
FreeGrab(listener->grab);
listener->grab = AllocGrab(grab);
}
}
}
| 0
|
virtual ResourceContext* GetResourceContext() {
return context_;
}
| 0
|
v8::Handle<v8::Value> V8WebGLRenderingContext::uniformMatrix2fvCallback(const v8::Arguments& args)
{
INC_STATS("DOM.WebGLRenderingContext.uniformMatrix2fv()");
return uniformMatrixHelper(args, 2);
}
| 0
|
static int decode_putfh(struct xdr_stream *xdr)
{
return decode_op_hdr(xdr, OP_PUTFH);
}
| 0
|
xsltCheckExtURI(xsltStylesheetPtr style, const xmlChar * URI)
{
xsltExtDefPtr cur;
if ((style == NULL) || (style->nsDefs == NULL))
return (0);
if (URI == NULL)
return (0);
cur = (xsltExtDefPtr) style->nsDefs;
while (cur != NULL) {
if (xmlStrEqual(URI, cur->URI))
return (1);
cur = cur->next;
}
return (0);
}
| 0
|
static int bpf_obj_get(const union bpf_attr *attr)
{
if (CHECK_ATTR(BPF_OBJ) || attr->bpf_fd != 0)
return -EINVAL;
return bpf_obj_get_user(u64_to_ptr(attr->pathname));
}
| 0
|
bool IsLoaderInterceptionEnabled() {
return base::FeatureList::IsEnabled(network::features::kNetworkService) ||
blink::ServiceWorkerUtils::IsServicificationEnabled() ||
signed_exchange_utils::IsSignedExchangeHandlingEnabled();
}
| 0
|
check_switch(int firstcode)
{
return (firstcode == SWFACTION_PUSH || firstcode == SWFACTION_JUMP);
}
| 0
|
xmlParse3986URI(xmlURIPtr uri, const char *str) {
int ret;
ret = xmlParse3986Scheme(uri, &str);
if (ret != 0) return(ret);
if (*str != ':') {
return(1);
}
str++;
ret = xmlParse3986HierPart(uri, &str);
if (ret != 0) return(ret);
if (*str == '?') {
str++;
ret = xmlParse3986Query(uri, &str);
if (ret != 0) return(ret);
}
if (*str == '#') {
str++;
ret = xmlParse3986Fragment(uri, &str);
if (ret != 0) return(ret);
}
if (*str != 0) {
xmlCleanURI(uri);
return(1);
}
return(0);
}
| 0
|
static inline void assign_proto_idx(struct proto *prot)
{
}
| 0
|
static void intr_callback(struct urb *urb)
{
pegasus_t *pegasus = urb->context;
struct net_device *net;
int res, status = urb->status;
if (!pegasus)
return;
net = pegasus->net;
switch (status) {
case 0:
break;
case -ECONNRESET: /* unlink */
case -ENOENT:
case -ESHUTDOWN:
return;
default:
/* some Pegasus-I products report LOTS of data
* toggle errors... avoid log spamming
*/
netif_dbg(pegasus, timer, net, "intr status %d\n", status);
}
if (urb->actual_length >= 6) {
u8 *d = urb->transfer_buffer;
/* byte 0 == tx_status1, reg 2B */
if (d[0] & (TX_UNDERRUN|EXCESSIVE_COL
|LATE_COL|JABBER_TIMEOUT)) {
pegasus->stats.tx_errors++;
if (d[0] & TX_UNDERRUN)
pegasus->stats.tx_fifo_errors++;
if (d[0] & (EXCESSIVE_COL | JABBER_TIMEOUT))
pegasus->stats.tx_aborted_errors++;
if (d[0] & LATE_COL)
pegasus->stats.tx_window_errors++;
}
/* d[5].LINK_STATUS lies on some adapters.
* d[0].NO_CARRIER kicks in only with failed TX.
* ... so monitoring with MII may be safest.
*/
/* bytes 3-4 == rx_lostpkt, reg 2E/2F */
pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4];
}
res = usb_submit_urb(urb, GFP_ATOMIC);
if (res == -ENODEV)
netif_device_detach(pegasus->net);
if (res)
netif_err(pegasus, timer, net,
"can't resubmit interrupt urb, %d\n", res);
}
| 0
|
ProcXvPutImage(ClientPtr client)
{
DrawablePtr pDraw;
XvPortPtr pPort;
XvImagePtr pImage = NULL;
GCPtr pGC;
int status, i, size;
CARD16 width, height;
REQUEST(xvPutImageReq);
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
if (!(pPort->pAdaptor->type & XvImageMask) ||
!(pPort->pAdaptor->type & XvInputMask)) {
client->errorValue = stuff->port;
return BadMatch;
}
status = XvdiMatchPort(pPort, pDraw);
if (status != Success) {
return status;
}
for (i = 0; i < pPort->pAdaptor->nImages; i++) {
if (pPort->pAdaptor->pImages[i].id == stuff->id) {
pImage = &(pPort->pAdaptor->pImages[i]);
break;
}
}
if (!pImage)
return BadMatch;
width = stuff->width;
height = stuff->height;
size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width,
&height, NULL, NULL);
size += sizeof(xvPutImageReq);
size = bytes_to_int32(size);
if ((width < stuff->width) || (height < stuff->height))
return BadValue;
if (client->req_len < size)
return BadLength;
return XvdiPutImage(client, pDraw, pPort, pGC, stuff->src_x, stuff->src_y,
stuff->src_w, stuff->src_h, stuff->drw_x, stuff->drw_y,
stuff->drw_w, stuff->drw_h, pImage,
(unsigned char *) (&stuff[1]), FALSE,
stuff->width, stuff->height);
}
| 0
|
void bitmap_writer_finish(struct pack_idx_entry **index,
uint32_t index_nr,
const char *filename,
uint16_t options)
{
static char tmp_file[PATH_MAX];
static uint16_t default_version = 1;
static uint16_t flags = BITMAP_OPT_FULL_DAG;
struct sha1file *f;
struct bitmap_disk_header header;
int fd = odb_mkstemp(tmp_file, sizeof(tmp_file), "pack/tmp_bitmap_XXXXXX");
if (fd < 0)
die_errno("unable to create '%s'", tmp_file);
f = sha1fd(fd, tmp_file);
memcpy(header.magic, BITMAP_IDX_SIGNATURE, sizeof(BITMAP_IDX_SIGNATURE));
header.version = htons(default_version);
header.options = htons(flags | options);
header.entry_count = htonl(writer.selected_nr);
hashcpy(header.checksum, writer.pack_checksum);
sha1write(f, &header, sizeof(header));
dump_bitmap(f, writer.commits);
dump_bitmap(f, writer.trees);
dump_bitmap(f, writer.blobs);
dump_bitmap(f, writer.tags);
write_selected_commits_v1(f, index, index_nr);
if (options & BITMAP_OPT_HASH_CACHE)
write_hash_cache(f, index, index_nr);
sha1close(f, NULL, CSUM_FSYNC);
if (adjust_shared_perm(tmp_file))
die_errno("unable to make temporary bitmap file readable");
if (rename(tmp_file, filename))
die_errno("unable to rename temporary bitmap file to '%s'", filename);
}
| 0
|
frag6_print(netdissect_options *ndo, register const u_char *bp, register const u_char *bp2)
{
register const struct ip6_frag *dp;
register const struct ip6_hdr *ip6;
dp = (const struct ip6_frag *)bp;
ip6 = (const struct ip6_hdr *)bp2;
ND_TCHECK(dp->ip6f_offlg);
if (ndo->ndo_vflag) {
ND_PRINT((ndo, "frag (0x%08x:%d|%ld)",
EXTRACT_32BITS(&dp->ip6f_ident),
EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK,
sizeof(struct ip6_hdr) + EXTRACT_16BITS(&ip6->ip6_plen) -
(long)(bp - bp2) - sizeof(struct ip6_frag)));
} else {
ND_PRINT((ndo, "frag (%d|%ld)",
EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK,
sizeof(struct ip6_hdr) + EXTRACT_16BITS(&ip6->ip6_plen) -
(long)(bp - bp2) - sizeof(struct ip6_frag)));
}
/* it is meaningless to decode non-first fragment */
if ((EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK) != 0)
return -1;
else
{
ND_PRINT((ndo, " "));
return sizeof(struct ip6_frag);
}
trunc:
ND_PRINT((ndo, "[|frag]"));
return -1;
}
| 1
|
const char* dump_uipc_event(tUIPC_EVENT event)
{
switch(event)
{
CASE_RETURN_STR(UIPC_OPEN_EVT)
CASE_RETURN_STR(UIPC_CLOSE_EVT)
CASE_RETURN_STR(UIPC_RX_DATA_EVT)
CASE_RETURN_STR(UIPC_RX_DATA_READY_EVT)
CASE_RETURN_STR(UIPC_TX_DATA_READY_EVT)
default:
return "UNKNOWN MSG ID";
}
}
| 0
|
static int new_socket_unix(void) {
int sfd;
int flags;
if ((sfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
perror("socket()");
return -1;
}
if ((flags = fcntl(sfd, F_GETFL, 0)) < 0 ||
fcntl(sfd, F_SETFL, flags | O_NONBLOCK) < 0) {
perror("setting O_NONBLOCK");
close(sfd);
return -1;
}
return sfd;
}
| 0
|
Vp9Parser::~Vp9Parser() {}
| 0
|
static inline bool is_no_device(u32 intr_info)
{
return is_exception_n(intr_info, NM_VECTOR);
}
| 0
|
int fz_colorspace_is_rgb(fz_context *ctx, const fz_colorspace *cs)
{
return cs && cs->type == FZ_COLORSPACE_RGB;
}
| 0
|
_add_starting_step(uint16_t type, void *req)
{
starting_step_t *starting_step;
int rc = SLURM_SUCCESS;
/* Add the step info to a list of starting processes that
cannot reliably be contacted. */
slurm_mutex_lock(&conf->starting_steps_lock);
starting_step = xmalloc(sizeof(starting_step_t));
if (!starting_step) {
error("%s failed to allocate memory", __func__);
rc = SLURM_FAILURE;
goto fail;
}
switch (type) {
case LAUNCH_BATCH_JOB:
starting_step->job_id =
((batch_job_launch_msg_t *)req)->job_id;
starting_step->step_id =
((batch_job_launch_msg_t *)req)->step_id;
break;
case LAUNCH_TASKS:
starting_step->job_id =
((launch_tasks_request_msg_t *)req)->job_id;
starting_step->step_id =
((launch_tasks_request_msg_t *)req)->job_step_id;
break;
case REQUEST_LAUNCH_PROLOG:
starting_step->job_id = ((prolog_launch_msg_t *)req)->job_id;
starting_step->step_id = SLURM_EXTERN_CONT;
break;
default:
error("%s called with an invalid type: %u", __func__, type);
rc = SLURM_FAILURE;
xfree(starting_step);
goto fail;
}
if (!list_append(conf->starting_steps, starting_step)) {
error("%s failed to allocate memory for list", __func__);
rc = SLURM_FAILURE;
xfree(starting_step);
goto fail;
}
fail:
slurm_mutex_unlock(&conf->starting_steps_lock);
return rc;
}
| 0
|
int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
struct futex_q *q, union futex_key *key2,
struct hrtimer_sleeper *timeout)
{
int ret = 0;
/*
* With the hb lock held, we avoid races while we process the wakeup.
* We only need to hold hb (and not hb2) to ensure atomicity as the
* wakeup code can't change q.key from uaddr to uaddr2 if we hold hb.
* It can't be requeued from uaddr2 to something else since we don't
* support a PI aware source futex for requeue.
*/
if (!match_futex(&q->key, key2)) {
WARN_ON(q->lock_ptr && (&hb->lock != q->lock_ptr));
/*
* We were woken prior to requeue by a timeout or a signal.
* Unqueue the futex_q and determine which it was.
*/
plist_del(&q->list, &hb->chain);
hb_waiters_dec(hb);
/* Handle spurious wakeups gracefully */
ret = -EWOULDBLOCK;
if (timeout && !timeout->task)
ret = -ETIMEDOUT;
else if (signal_pending(current))
ret = -ERESTARTNOINTR;
}
return ret;
}
| 0
|
STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
const wchar_t* current_headers, DWORD reserved,
wchar_t** additional_headers) {
DCHECK_EQ(thread_, base::PlatformThread::CurrentId());
if (!additional_headers) {
NOTREACHED();
return E_POINTER;
}
DVLOG(1) << __FUNCTION__ << me() << "headers: \n" << current_headers;
if (status_.get_state() == Status::ABORTING) {
DLOG(WARNING) << __FUNCTION__ << me()
<< ": Aborting connection to URL:"
<< url
<< " as the binding has been aborted";
return E_ABORT;
}
HRESULT hr = S_OK;
std::string new_headers;
if (post_data_len() > 0) {
if (is_chunked_upload()) {
new_headers = base::StringPrintf("Transfer-Encoding: chunked\r\n");
}
}
if (!extra_headers().empty()) {
new_headers += extra_headers();
}
if (!referrer().empty()) {
new_headers += base::StringPrintf("Referer: %s\r\n", referrer().c_str());
}
std::string user_agent = http_utils::AddChromeFrameToUserAgentValue(
http_utils::GetChromeUserAgent());
new_headers += ReplaceOrAddUserAgent(current_headers, user_agent);
if (!new_headers.empty()) {
*additional_headers = reinterpret_cast<wchar_t*>(
CoTaskMemAlloc((new_headers.size() + 1) * sizeof(wchar_t)));
if (*additional_headers == NULL) {
NOTREACHED();
hr = E_OUTOFMEMORY;
} else {
lstrcpynW(*additional_headers, ASCIIToWide(new_headers).c_str(),
new_headers.size());
}
}
request_headers_ = new_headers;
return hr;
}
| 0
|
rad_server_secret(struct rad_handle *h)
{
if (h->srv >= h->num_servers) {
generr(h, "No RADIUS servers specified");
return NULL;
}
return (h->servers[h->srv].secret);
}
| 0
|
void PaintLayerScrollableArea::DidChangeGlobalRootScroller() {
if (GetLayoutBox()->GetNode()->IsElementNode()) {
ToElement(GetLayoutBox()->GetNode())->SetNeedsCompositingUpdate();
GetLayoutBox()->SetNeedsPaintPropertyUpdate();
}
if (GetLayoutBox()->GetFrame()->GetSettings() &&
GetLayoutBox()->GetFrame()->GetSettings()->GetViewportEnabled()) {
bool needs_horizontal_scrollbar;
bool needs_vertical_scrollbar;
ComputeScrollbarExistence(needs_horizontal_scrollbar,
needs_vertical_scrollbar);
SetHasHorizontalScrollbar(needs_horizontal_scrollbar);
SetHasVerticalScrollbar(needs_vertical_scrollbar);
}
}
| 0
|
int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa,
const void *val, int bytes)
{
int ret;
ret = kvm_vcpu_write_guest(vcpu, gpa, val, bytes);
if (ret < 0)
return 0;
kvm_mmu_pte_write(vcpu, gpa, val, bytes);
return 1;
}
| 0
|
static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata)
{
struct nfs4_opendata *data = calldata;
data->rpc_status = task->tk_status;
if (data->rpc_status == 0) {
nfs4_stateid_copy(&data->o_res.stateid, &data->c_res.stateid);
nfs_confirm_seqid(&data->owner->so_seqid, 0);
renew_lease(data->o_res.server, data->timestamp);
data->rpc_done = 1;
}
}
| 0
|
static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx,
vpx_codec_iter_t *iter)
{
vpx_image_t *img = NULL;
/* iter acts as a flip flop, so an image is only returned on the first
* call to get_frame.
*/
if (!(*iter) && ctx->yv12_frame_buffers.pbi[0])
{
YV12_BUFFER_CONFIG sd;
int64_t time_stamp = 0, time_end_stamp = 0;
vp8_ppflags_t flags = {0};
if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)
{
flags.post_proc_flag= ctx->postproc_cfg.post_proc_flag
#if CONFIG_POSTPROC_VISUALIZER
| ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS : 0)
| ((ctx->dbg_color_mb_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
| ((ctx->dbg_color_b_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
| ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0)
#endif
;
flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
flags.noise_level = ctx->postproc_cfg.noise_level;
#if CONFIG_POSTPROC_VISUALIZER
flags.display_ref_frame_flag= ctx->dbg_color_ref_frame_flag;
flags.display_mb_modes_flag = ctx->dbg_color_mb_modes_flag;
flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag;
flags.display_mv_flag = ctx->dbg_display_mv_flag;
#endif
}
if (0 == vp8dx_get_raw_frame(ctx->yv12_frame_buffers.pbi[0], &sd,
&time_stamp, &time_end_stamp, &flags))
{
yuvconfig2image(&ctx->img, &sd, ctx->user_priv);
img = &ctx->img;
*iter = img;
}
}
return img;
}
| 0
|
WebUIController* NewWebUI(content::WebUI* web_ui, const GURL& url) {
return new T(web_ui);
}
| 0
|
void FindInPageNotificationObserver::Observe(
int type, const content::NotificationSource& source,
const content::NotificationDetails& details) {
content::Details<FindNotificationDetails> find_details(details);
if (!(find_details->final_update() && reply_message_ != NULL)) {
DVLOG(1) << "Ignoring, since we only care about the final message";
return;
}
if (!automation_) {
delete this;
return;
}
if (find_details->request_id() == kFindInPageRequestId) {
if (reply_with_json_) {
scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
return_value->SetInteger("match_count",
find_details->number_of_matches());
gfx::Rect rect = find_details->selection_rect();
if (!rect.IsEmpty()) {
return_value->SetInteger("match_left", rect.x());
return_value->SetInteger("match_top", rect.y());
return_value->SetInteger("match_right", rect.right());
return_value->SetInteger("match_bottom", rect.bottom());
}
AutomationJSONReply(automation_, reply_message_.release())
.SendSuccess(return_value.get());
delete this;
} else {
if (find_details->active_match_ordinal() > -1) {
active_match_ordinal_ = find_details->active_match_ordinal();
AutomationMsg_Find::WriteReplyParams(reply_message_.get(),
active_match_ordinal_, find_details->number_of_matches());
automation_->Send(reply_message_.release());
}
}
}
}
| 0
|
void RenderWidgetHostImpl::Blur() {
if (IsMouseLocked())
view_->UnlockMouse();
Send(new ViewMsg_SetFocus(routing_id_, false));
}
| 0
|
static int list_files(void)
{
sc_path_t path;
int r;
sc_format_path("3F00", &path);
r = enum_dir(path, 0);
return r;
}
| 0
|
status_t MediaPlayer::setSyncSettings(const AVSyncSettings& sync, float videoFpsHint)
{
ALOGV("setSyncSettings: %u %u %f %f",
sync.mSource, sync.mAudioAdjustMode, sync.mTolerance, videoFpsHint);
Mutex::Autolock _l(mLock);
if (mPlayer == 0) return INVALID_OPERATION;
return mPlayer->setSyncSettings(sync, videoFpsHint);
}
| 0
|
status_t AMRSource::stop() {
CHECK(mStarted);
delete mGroup;
mGroup = NULL;
mStarted = false;
return OK;
}
| 0
|
inline void comps_rtree_pair_destroy(COMPS_RTreePair * pair) {
free(pair->key);
free(pair);
}
| 0
|
GF_Err gf_sm_load_string(GF_SceneLoader *load, const char *str, Bool do_clean)
{
GF_Err e;
if (!load->type) e = GF_BAD_PARAM;
else if (load->parse_string) e = load->parse_string(load, str);
else e = GF_NOT_SUPPORTED;
return e;
}
| 0
|
static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
{
int idx;
int s_idx = cb->family;
if (s_idx == 0)
s_idx = 1;
for (idx = 1; idx <= RTNL_FAMILY_MAX; idx++) {
int type = cb->nlh->nlmsg_type-RTM_BASE;
if (idx < s_idx || idx == PF_PACKET)
continue;
if (rtnl_msg_handlers[idx] == NULL ||
rtnl_msg_handlers[idx][type].dumpit == NULL)
continue;
if (idx > s_idx)
memset(&cb->args[0], 0, sizeof(cb->args));
if (rtnl_msg_handlers[idx][type].dumpit(skb, cb))
break;
}
cb->family = idx;
return skb->len;
}
| 0
|
flx_colorspace_convert (FlxColorSpaceConverter * flxpal, guchar * src,
guchar * dest)
{
guint size, col;
g_return_if_fail (flxpal != NULL);
g_return_if_fail (src != dest);
size = flxpal->width * flxpal->height;
while (size--) {
col = (*src++ * 3);
#if G_BYTE_ORDER == G_BIG_ENDIAN
*dest++ = 0;
*dest++ = flxpal->palvec[col];
*dest++ = flxpal->palvec[col + 1];
*dest++ = flxpal->palvec[col + 2];
#else
*dest++ = flxpal->palvec[col + 2];
*dest++ = flxpal->palvec[col + 1];
*dest++ = flxpal->palvec[col];
*dest++ = 0;
#endif
}
}
| 0
|
int put_compat_itimerspec64(const struct itimerspec64 *its,
struct compat_itimerspec __user *uits)
{
if (__compat_put_timespec64(&its->it_interval, &uits->it_interval) ||
__compat_put_timespec64(&its->it_value, &uits->it_value))
return -EFAULT;
return 0;
}
| 0
|
static void windows_destroy_device(struct libusb_device *dev)
{
windows_device_priv_release(dev);
}
| 0
|
void Document::ViewportDefiningElementDidChange() {
HTMLBodyElement* body = FirstBodyElement();
if (!body)
return;
LayoutObject* layout_object = body->GetLayoutObject();
if (layout_object && layout_object->IsLayoutBlock()) {
layout_object->SetStyle(ComputedStyle::Clone(*layout_object->Style()));
if (layout_object->HasLayer()) {
ToLayoutBoxModelObject(layout_object)
->Layer()
->SetNeeedsCompositingReasonsUpdate();
}
}
}
| 0
|
static void __ip_vs_unlink_dest(struct ip_vs_service *svc,
struct ip_vs_dest *dest,
int svcupd)
{
dest->flags &= ~IP_VS_DEST_F_AVAILABLE;
/*
* Remove it from the d-linked destination list.
*/
list_del(&dest->n_list);
svc->num_dests--;
/*
* Call the update_service function of its scheduler
*/
if (svcupd && svc->scheduler->update_service)
svc->scheduler->update_service(svc);
}
| 0
|
static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd,
struct ib_wq_init_attr *init_attr)
{
struct mlx5_ib_dev *dev;
int has_net_offloads;
__be64 *rq_pas0;
void *in;
void *rqc;
void *wq;
int inlen;
int err;
dev = to_mdev(pd->device);
inlen = MLX5_ST_SZ_BYTES(create_rq_in) + sizeof(u64) * rwq->rq_num_pas;
in = kvzalloc(inlen, GFP_KERNEL);
if (!in)
return -ENOMEM;
rqc = MLX5_ADDR_OF(create_rq_in, in, ctx);
MLX5_SET(rqc, rqc, mem_rq_type,
MLX5_RQC_MEM_RQ_TYPE_MEMORY_RQ_INLINE);
MLX5_SET(rqc, rqc, user_index, rwq->user_index);
MLX5_SET(rqc, rqc, cqn, to_mcq(init_attr->cq)->mcq.cqn);
MLX5_SET(rqc, rqc, state, MLX5_RQC_STATE_RST);
MLX5_SET(rqc, rqc, flush_in_error_en, 1);
wq = MLX5_ADDR_OF(rqc, rqc, wq);
MLX5_SET(wq, wq, wq_type,
rwq->create_flags & MLX5_IB_WQ_FLAGS_STRIDING_RQ ?
MLX5_WQ_TYPE_CYCLIC_STRIDING_RQ : MLX5_WQ_TYPE_CYCLIC);
if (init_attr->create_flags & IB_WQ_FLAGS_PCI_WRITE_END_PADDING) {
if (!MLX5_CAP_GEN(dev->mdev, end_pad)) {
mlx5_ib_dbg(dev, "Scatter end padding is not supported\n");
err = -EOPNOTSUPP;
goto out;
} else {
MLX5_SET(wq, wq, end_padding_mode, MLX5_WQ_END_PAD_MODE_ALIGN);
}
}
MLX5_SET(wq, wq, log_wq_stride, rwq->log_rq_stride);
if (rwq->create_flags & MLX5_IB_WQ_FLAGS_STRIDING_RQ) {
MLX5_SET(wq, wq, two_byte_shift_en, rwq->two_byte_shift_en);
MLX5_SET(wq, wq, log_wqe_stride_size,
rwq->single_stride_log_num_of_bytes -
MLX5_MIN_SINGLE_STRIDE_LOG_NUM_BYTES);
MLX5_SET(wq, wq, log_wqe_num_of_strides, rwq->log_num_strides -
MLX5_MIN_SINGLE_WQE_LOG_NUM_STRIDES);
}
MLX5_SET(wq, wq, log_wq_sz, rwq->log_rq_size);
MLX5_SET(wq, wq, pd, to_mpd(pd)->pdn);
MLX5_SET(wq, wq, page_offset, rwq->rq_page_offset);
MLX5_SET(wq, wq, log_wq_pg_sz, rwq->log_page_size);
MLX5_SET(wq, wq, wq_signature, rwq->wq_sig);
MLX5_SET64(wq, wq, dbr_addr, rwq->db.dma);
has_net_offloads = MLX5_CAP_GEN(dev->mdev, eth_net_offloads);
if (init_attr->create_flags & IB_WQ_FLAGS_CVLAN_STRIPPING) {
if (!(has_net_offloads && MLX5_CAP_ETH(dev->mdev, vlan_cap))) {
mlx5_ib_dbg(dev, "VLAN offloads are not supported\n");
err = -EOPNOTSUPP;
goto out;
}
} else {
MLX5_SET(rqc, rqc, vsd, 1);
}
if (init_attr->create_flags & IB_WQ_FLAGS_SCATTER_FCS) {
if (!(has_net_offloads && MLX5_CAP_ETH(dev->mdev, scatter_fcs))) {
mlx5_ib_dbg(dev, "Scatter FCS is not supported\n");
err = -EOPNOTSUPP;
goto out;
}
MLX5_SET(rqc, rqc, scatter_fcs, 1);
}
if (init_attr->create_flags & IB_WQ_FLAGS_DELAY_DROP) {
if (!(dev->ib_dev.attrs.raw_packet_caps &
IB_RAW_PACKET_CAP_DELAY_DROP)) {
mlx5_ib_dbg(dev, "Delay drop is not supported\n");
err = -EOPNOTSUPP;
goto out;
}
MLX5_SET(rqc, rqc, delay_drop_en, 1);
}
rq_pas0 = (__be64 *)MLX5_ADDR_OF(wq, wq, pas);
mlx5_ib_populate_pas(dev, rwq->umem, rwq->page_shift, rq_pas0, 0);
err = mlx5_core_create_rq_tracked(dev->mdev, in, inlen, &rwq->core_qp);
if (!err && init_attr->create_flags & IB_WQ_FLAGS_DELAY_DROP) {
err = set_delay_drop(dev);
if (err) {
mlx5_ib_warn(dev, "Failed to enable delay drop err=%d\n",
err);
mlx5_core_destroy_rq_tracked(dev->mdev, &rwq->core_qp);
} else {
rwq->create_flags |= MLX5_IB_WQ_FLAGS_DELAY_DROP;
}
}
out:
kvfree(in);
return err;
}
| 0
|
fbCombineSaturateC (CARD32 *dest, CARD32 *src, CARD32 *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
CARD32 s, d;
CARD16 sa, sr, sg, sb, da;
CARD16 t, u, v;
CARD32 m,n,o,p;
d = READ(dest + i);
s = READ(src + i);
m = READ(mask + i);
fbCombineMaskC (&s, &m);
sa = (m >> 24);
sr = (m >> 16) & 0xff;
sg = (m >> 8) & 0xff;
sb = (m ) & 0xff;
da = ~d >> 24;
if (sb <= da)
m = FbAdd(s,d,0,t);
else
m = FbGen (s, d, 0, (da << 8) / sb, 0xff, t, u, v);
if (sg <= da)
n = FbAdd(s,d,8,t);
else
n = FbGen (s, d, 8, (da << 8) / sg, 0xff, t, u, v);
if (sr <= da)
o = FbAdd(s,d,16,t);
else
o = FbGen (s, d, 16, (da << 8) / sr, 0xff, t, u, v);
if (sa <= da)
p = FbAdd(s,d,24,t);
else
p = FbGen (s, d, 24, (da << 8) / sa, 0xff, t, u, v);
WRITE(dest + i, m|n|o|p);
}
}
| 0
|
bool MediaStreamImpl::EnsurePeerConnectionFactory() {
DCHECK(CalledOnValidThread());
if (!signaling_thread_) {
jingle_glue::JingleThreadWrapper::EnsureForCurrentThread();
jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true);
signaling_thread_ = jingle_glue::JingleThreadWrapper::current();
}
if (!worker_thread_) {
if (!chrome_worker_thread_.IsRunning()) {
if (!chrome_worker_thread_.Start()) {
LOG(ERROR) << "Could not start worker thread";
signaling_thread_ = NULL;
return false;
}
}
base::WaitableEvent event(true, false);
chrome_worker_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
&MediaStreamImpl::InitializeWorkerThread,
this,
&worker_thread_,
&event));
event.Wait();
DCHECK(worker_thread_);
}
if (!network_manager_)
network_manager_ = new content::IpcNetworkManager(p2p_socket_dispatcher_);
if (!socket_factory_.get()) {
socket_factory_.reset(
new content::IpcPacketSocketFactory(p2p_socket_dispatcher_));
}
if (!dependency_factory_->PeerConnectionFactoryCreated()) {
if (!dependency_factory_->CreatePeerConnectionFactory(
worker_thread_,
signaling_thread_,
p2p_socket_dispatcher_,
network_manager_,
socket_factory_.get())) {
LOG(ERROR) << "Could not initialize PeerConnection factory";
return false;
}
}
return true;
}
| 0
|
static int vmx_restore_fixed0_msr(struct vcpu_vmx *vmx, u32 msr_index, u64 data)
{
u64 *msr;
switch (msr_index) {
case MSR_IA32_VMX_CR0_FIXED0:
msr = &vmx->nested.msrs.cr0_fixed0;
break;
case MSR_IA32_VMX_CR4_FIXED0:
msr = &vmx->nested.msrs.cr4_fixed0;
break;
default:
BUG();
}
/*
* 1 bits (which indicates bits which "must-be-1" during VMX operation)
* must be 1 in the restored value.
*/
if (!is_bitwise_subset(data, *msr, -1ULL))
return -EINVAL;
*msr = data;
return 0;
}
| 0
|
EntrySync* EntrySync::copyTo(DirectoryEntrySync* parent, const String& name, ExceptionState& exceptionState) const
{
RefPtr<EntrySyncCallbackHelper> helper = EntrySyncCallbackHelper::create();
m_fileSystem->copy(this, parent, name, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous);
return helper->getResult(exceptionState);
}
| 1
|
ScriptPromise BluetoothRemoteGATTServer::getPrimaryServicesImpl(
ScriptState* scriptState,
mojom::blink::WebBluetoothGATTQueryQuantity quantity,
String servicesUUID) {
if (!connected()) {
return ScriptPromise::rejectWithDOMException(
scriptState,
DOMException::create(NetworkError, kGATTServerNotConnected));
}
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
AddToActiveAlgorithms(resolver);
mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service();
WTF::Optional<String> uuid = WTF::nullopt;
if (!servicesUUID.isEmpty())
uuid = servicesUUID;
service->RemoteServerGetPrimaryServices(
device()->id(), quantity, uuid,
convertToBaseCallback(
WTF::bind(&BluetoothRemoteGATTServer::GetPrimaryServicesCallback,
wrapPersistent(this), quantity, wrapPersistent(resolver))));
return promise;
}
| 1
|
static void _sx_sasl_features(sx_t s, sx_plugin_t p, nad_t nad) {
_sx_sasl_t ctx = (_sx_sasl_t) p->private;
Gsasl_session *sd = (Gsasl_session *) s->plugin_data[p->index];
int nmechs, ret;
char *mechs, *mech, *c;
if(s->type != type_SERVER)
return;
if(sd != NULL) {
_sx_debug(ZONE, "already auth'd, not offering sasl mechanisms");
return;
}
if(!(s->flags & SX_SASL_OFFER)) {
_sx_debug(ZONE, "application didn't ask us to offer sasl, so we won't");
return;
}
#ifdef HAVE_SSL
if((s->flags & SX_SSL_STARTTLS_REQUIRE) && s->ssf == 0) {
_sx_debug(ZONE, "ssl not established yet but the app requires it, not offering mechanisms");
return;
}
#endif
_sx_debug(ZONE, "offering sasl mechanisms");
ret = gsasl_server_mechlist(ctx->gsasl_ctx, &mechs);
if(ret != GSASL_OK) {
_sx_debug(ZONE, "gsasl_server_mechlist failed (%d): %s, not offering sasl for this conn", ret, gsasl_strerror (ret));
return;
}
mech = mechs;
nmechs = 0;
while(mech != NULL) {
c = strchr(mech, ' ');
if(c != NULL)
*c = '\0';
if ((ctx->cb)(sx_sasl_cb_CHECK_MECH, mech, NULL, s, ctx->cbarg)==sx_sasl_ret_OK) {
if (nmechs == 0) {
int ns = nad_add_namespace(nad, uri_SASL, NULL);
nad_append_elem(nad, ns, "mechanisms", 1);
}
_sx_debug(ZONE, "offering mechanism: %s", mech);
nad_append_elem(nad, -1 /*ns*/, "mechanism", 2);
nad_append_cdata(nad, mech, strlen(mech), 3);
nmechs++;
}
if(c == NULL)
mech = NULL;
else
mech = ++c;
}
free(mechs);
}
| 0
|
void WebRuntimeFeatures::enablePeerConnection(bool enable)
{
RuntimeEnabledFeatures::setPeerConnectionEnabled(enable);
}
| 0
|
void drm_mode_config_cleanup(struct drm_device *dev)
{
struct drm_connector *connector, *ot;
struct drm_crtc *crtc, *ct;
struct drm_encoder *encoder, *enct;
struct drm_framebuffer *fb, *fbt;
struct drm_property *property, *pt;
list_for_each_entry_safe(encoder, enct, &dev->mode_config.encoder_list,
head) {
encoder->funcs->destroy(encoder);
}
list_for_each_entry_safe(connector, ot,
&dev->mode_config.connector_list, head) {
connector->funcs->destroy(connector);
}
list_for_each_entry_safe(property, pt, &dev->mode_config.property_list,
head) {
drm_property_destroy(dev, property);
}
list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
fb->funcs->destroy(fb);
}
list_for_each_entry_safe(crtc, ct, &dev->mode_config.crtc_list, head) {
crtc->funcs->destroy(crtc);
}
}
| 0
|
gfx::Size RenderWidgetHostViewAura::GetMaximumSize() const {
return gfx::Size();
}
| 0
|
bool HasHostBeenLookedUp(const std::string& host) {
return base::Contains(successful_dns_lookups_, host) ||
base::Contains(unsuccessful_dns_lookups_, host);
}
| 0
|
ProcRenderQueryFilters (ClientPtr client)
{
REQUEST (xRenderQueryFiltersReq);
DrawablePtr pDrawable;
xRenderQueryFiltersReply *reply;
int nbytesName;
int nnames;
ScreenPtr pScreen;
PictureScreenPtr ps;
int i, j, len, total_bytes, rc;
INT16 *aliases;
char *names;
REQUEST_SIZE_MATCH(xRenderQueryFiltersReq);
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
DixGetAttrAccess);
if (rc != Success)
return rc;
pScreen = pDrawable->pScreen;
nbytesName = 0;
nnames = 0;
ps = GetPictureScreenIfSet(pScreen);
if (ps)
{
for (i = 0; i < ps->nfilters; i++)
nbytesName += 1 + strlen (ps->filters[i].name);
for (i = 0; i < ps->nfilterAliases; i++)
nbytesName += 1 + strlen (ps->filterAliases[i].alias);
nnames = ps->nfilters + ps->nfilterAliases;
}
len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName);
total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2);
reply = (xRenderQueryFiltersReply *) malloc(total_bytes);
if (!reply)
return BadAlloc;
aliases = (INT16 *) (reply + 1);
names = (char *) (aliases + ((nnames + 1) & ~1));
reply->type = X_Reply;
reply->sequenceNumber = client->sequence;
reply->length = len;
reply->numAliases = nnames;
reply->numFilters = nnames;
if (ps)
{
/* fill in alias values */
for (i = 0; i < ps->nfilters; i++)
aliases[i] = FilterAliasNone;
for (i = 0; i < ps->nfilterAliases; i++)
{
for (j = 0; j < ps->nfilters; j++)
if (ps->filterAliases[i].filter_id == ps->filters[j].id)
break;
if (j == ps->nfilters)
{
for (j = 0; j < ps->nfilterAliases; j++)
if (ps->filterAliases[i].filter_id ==
ps->filterAliases[j].alias_id)
{
break;
}
if (j == ps->nfilterAliases)
j = FilterAliasNone;
else
j = j + ps->nfilters;
}
aliases[i + ps->nfilters] = j;
}
/* fill in filter names */
for (i = 0; i < ps->nfilters; i++)
{
j = strlen (ps->filters[i].name);
*names++ = j;
strncpy (names, ps->filters[i].name, j);
names += j;
}
/* fill in filter alias names */
for (i = 0; i < ps->nfilterAliases; i++)
{
j = strlen (ps->filterAliases[i].alias);
*names++ = j;
strncpy (names, ps->filterAliases[i].alias, j);
names += j;
}
}
if (client->swapped)
{
register int n;
for (i = 0; i < reply->numAliases; i++)
{
swaps (&aliases[i], n);
}
swaps(&reply->sequenceNumber, n);
swapl(&reply->length, n);
swapl(&reply->numAliases, n);
swapl(&reply->numFilters, n);
}
WriteToClient(client, total_bytes, (char *) reply);
free(reply);
return Success;
}
| 0
|
LRUCanvasResourceProviderCache(int capacity)
: resource_providers_(
std::make_unique<std::unique_ptr<CanvasResourceProvider>[]>(
capacity)),
capacity_(capacity) {}
| 0
|
bool IsNonClientLocation(Window* target, const gfx::Point& location) {
if (!target->delegate())
return false;
int hit_test_code = target->delegate()->GetNonClientComponent(location);
return hit_test_code != HTCLIENT && hit_test_code != HTNOWHERE;
}
| 0
|
void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) {
ClearPowerSaveBlockers(rvh);
render_manager_.RenderViewDeleted(rvh);
FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh));
}
| 0
|
static int __init setup_print_fatal_signals(char *str)
{
get_option (&str, &print_fatal_signals);
return 1;
}
| 0
|
static struct transit *transit_intern(struct transit *transit)
{
struct transit *find;
find = hash_get(transit_hash, transit, transit_hash_alloc);
if (find != transit)
transit_free(transit);
find->refcnt++;
return find;
}
| 0
|
explicit CloseDialogCallbackWrapper(CloseCallback callback)
: callback_(std::move(callback)) {}
| 0
|
struct ndp_msgra *ndp_msgra(struct ndp_msg *msg)
{
if (ndp_msg_type(msg) != NDP_MSG_RA)
return NULL;
return &msg->nd_msg.ra;
}
| 0
|
void __init proc_root_init(void)
{
int err;
proc_init_inodecache();
err = register_filesystem(&proc_fs_type);
if (err)
return;
proc_self_init();
proc_thread_self_init();
proc_symlink("mounts", NULL, "self/mounts");
proc_net_init();
#ifdef CONFIG_SYSVIPC
proc_mkdir("sysvipc", NULL);
#endif
proc_mkdir("fs", NULL);
proc_mkdir("driver", NULL);
proc_create_mount_point("fs/nfsd"); /* somewhere for the nfsd filesystem to be mounted */
#if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE)
/* just give it a mountpoint */
proc_create_mount_point("openprom");
#endif
proc_tty_init();
proc_mkdir("bus", NULL);
proc_sys_init();
}
| 0
|
static inline int ep_op_has_event(int op)
{
return op != EPOLL_CTL_DEL;
}
| 0
|
void inode_set_flags(struct inode *inode, unsigned int flags,
unsigned int mask)
{
unsigned int old_flags, new_flags;
WARN_ON_ONCE(flags & ~mask);
do {
old_flags = ACCESS_ONCE(inode->i_flags);
new_flags = (old_flags & ~mask) | flags;
} while (unlikely(cmpxchg(&inode->i_flags, old_flags,
new_flags) != old_flags));
}
| 0
|
VideoCodec StringToVideoCodec(const std::string& codec_id) {
std::vector<std::string> elem = base::SplitString(
codec_id, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (elem.empty())
return kUnknownVideoCodec;
VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
uint8_t level = 0;
gfx::ColorSpace::TransferID eotf = gfx::ColorSpace::TransferID::INVALID;
if (codec_id == "vp8" || codec_id == "vp8.0")
return kCodecVP8;
if (ParseNewStyleVp9CodecID(codec_id, &profile, &level, &eotf) ||
ParseLegacyVp9CodecID(codec_id, &profile, &level)) {
return kCodecVP9;
}
if (codec_id == "theora")
return kCodecTheora;
if (ParseAVCCodecId(codec_id, &profile, &level))
return kCodecH264;
#if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER)
if (ParseAVCCodecId(TranslateLegacyAvc1CodecIds(codec_id), &profile, &level))
return kCodecH264;
#endif
#if BUILDFLAG(ENABLE_HEVC_DEMUXING)
if (ParseHEVCCodecId(codec_id, &profile, &level))
return kCodecHEVC;
#endif
#if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
if (ParseDolbyVisionCodecId(codec_id, &profile, &level))
return kCodecDolbyVision;
#endif
return kUnknownVideoCodec;
}
| 1
|
php_apache_sapi_flush(void *server_context)
{
php_struct *ctx;
request_rec *r;
TSRMLS_FETCH();
ctx = server_context;
/* If we haven't registered a server_context yet,
* then don't bother flushing. */
if (!server_context) {
return;
}
r = ctx->r;
sapi_send_headers(TSRMLS_C);
r->status = SG(sapi_headers).http_response_code;
SG(headers_sent) = 1;
if (ap_rflush(r) < 0 || r->connection->aborted) {
php_handle_aborted_connection();
}
}
| 0
|
void FileAPIMessageFilter::OnAppendBlobDataItem(
const GURL& url, const BlobData::Item& item) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (item.type() == BlobData::Item::TYPE_FILE &&
!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(
process_id_, item.path())) {
OnRemoveBlob(url);
return;
}
if (item.length() == 0) {
BadMessageReceived();
return;
}
blob_storage_context_->controller()->AppendBlobDataItem(url, item);
}
| 0
|
static int _nfs4_proc_setclientid_confirm(struct nfs_client *clp, struct rpc_cred *cred)
{
struct nfs_fsinfo fsinfo;
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SETCLIENTID_CONFIRM],
.rpc_argp = clp,
.rpc_resp = &fsinfo,
.rpc_cred = cred,
};
unsigned long now;
int status;
now = jiffies;
status = rpc_call_sync(clp->cl_rpcclient, &msg, 0);
if (status == 0) {
spin_lock(&clp->cl_lock);
clp->cl_lease_time = fsinfo.lease_time * HZ;
clp->cl_last_renewal = now;
spin_unlock(&clp->cl_lock);
}
return status;
}
| 0
|
static void common_hrtimer_rearm(struct k_itimer *timr)
{
struct hrtimer *timer = &timr->it.real.timer;
if (!timr->it_interval)
return;
timr->it_overrun += (unsigned int) hrtimer_forward(timer,
timer->base->get_time(),
timr->it_interval);
hrtimer_restart(timer);
}
| 1
|
static int StreamTcpTest23(void)
{
StreamTcpThread stt;
TcpSession ssn;
Flow f;
TCPHdr tcph;
uint8_t packet[1460] = "";
ThreadVars tv;
PacketQueue pq;
Packet *p = SCMalloc(SIZE_OF_PACKET);
FAIL_IF(p == NULL);
memset(&pq,0,sizeof(PacketQueue));
memset(p, 0, SIZE_OF_PACKET);
memset(&f, 0, sizeof (Flow));
memset(&tcph, 0, sizeof (TCPHdr));
memset(&tv, 0, sizeof (ThreadVars));
StreamTcpUTInit(&stt.ra_ctx);
StreamTcpUTSetupSession(&ssn);
FLOW_INITIALIZE(&f);
ssn.client.os_policy = OS_POLICY_BSD;
f.protoctx = &ssn;
p->src.family = AF_INET;
p->dst.family = AF_INET;
p->proto = IPPROTO_TCP;
p->flow = &f;
tcph.th_win = 5480;
tcph.th_flags = TH_PUSH | TH_ACK;
p->tcph = &tcph;
p->flowflags = FLOW_PKT_TOSERVER;
p->payload = packet;
SET_ISN(&ssn.client, 3184324452UL);
p->tcph->th_seq = htonl(3184324453UL);
p->tcph->th_ack = htonl(3373419609UL);
p->payload_len = 2;
FAIL_IF(StreamTcpReassembleHandleSegment(&tv, stt.ra_ctx, &ssn, &ssn.client, p, &pq) == -1);
p->tcph->th_seq = htonl(3184324455UL);
p->tcph->th_ack = htonl(3373419621UL);
p->payload_len = 2;
FAIL_IF(StreamTcpReassembleHandleSegment(&tv, stt.ra_ctx, &ssn, &ssn.client, p, &pq) == -1);
p->tcph->th_seq = htonl(3184324453UL);
p->tcph->th_ack = htonl(3373419621UL);
p->payload_len = 6;
FAIL_IF(StreamTcpReassembleHandleSegment(&tv, stt.ra_ctx, &ssn, &ssn.client, p, &pq) == -1);
FAIL_IF(ssn.client.seg_list_tail == NULL);
FAIL_IF(TCP_SEG_LEN(ssn.client.seg_list_tail) != 2);
StreamTcpUTClearSession(&ssn);
SCFree(p);
FLOW_DESTROY(&f);
StreamTcpUTDeinit(stt.ra_ctx);
FAIL_IF(SC_ATOMIC_GET(st_memuse) > 0);
PASS;
}
| 0
|
static int xfrm_notify_policy_flush(const struct km_event *c)
{
struct net *net = c->net;
struct nlmsghdr *nlh;
struct sk_buff *skb;
int err;
skb = nlmsg_new(userpolicy_type_attrsize(), GFP_ATOMIC);
if (skb == NULL)
return -ENOMEM;
nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0);
err = -EMSGSIZE;
if (nlh == NULL)
goto out_free_skb;
err = copy_to_user_policy_type(c->data.type, skb);
if (err)
goto out_free_skb;
nlmsg_end(skb, nlh);
return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC);
out_free_skb:
kfree_skb(skb);
return err;
}
| 0
|
void WaitForThrottleWillRedirect() {
if (will_redirect_called_)
return;
will_redirect_loop_runner_ = new MessageLoopRunner();
will_redirect_loop_runner_->Run();
will_redirect_loop_runner_ = nullptr;
}
| 0
|
__ip_vs_unbind_svc(struct ip_vs_dest *dest)
{
struct ip_vs_service *svc = dest->svc;
dest->svc = NULL;
if (atomic_dec_and_test(&svc->refcnt)) {
IP_VS_DBG_BUF(3, "Removing service %u/%s:%u usecnt=%d\n",
svc->fwmark,
IP_VS_DBG_ADDR(svc->af, &svc->addr),
ntohs(svc->port), atomic_read(&svc->usecnt));
free_percpu(svc->stats.cpustats);
kfree(svc);
}
}
| 0
|
static DiceResponseHandler* GetForProfile(Profile* profile) {
return static_cast<DiceResponseHandler*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
| 0
|
int mbedtls_x509_crt_verify_info( char *buf, size_t size, const char *prefix,
uint32_t flags )
{
int ret;
const struct x509_crt_verify_string *cur;
char *p = buf;
size_t n = size;
for( cur = x509_crt_verify_strings; cur->string != NULL ; cur++ )
{
if( ( flags & cur->code ) == 0 )
continue;
ret = mbedtls_snprintf( p, n, "%s%s\n", prefix, cur->string );
MBEDTLS_X509_SAFE_SNPRINTF;
flags ^= cur->code;
}
if( flags != 0 )
{
ret = mbedtls_snprintf( p, n, "%sUnknown reason "
"(this should not happen)\n", prefix );
MBEDTLS_X509_SAFE_SNPRINTF;
}
return( (int) ( size - n ) );
}
| 0
|
void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
{
if (!isValid())
return;
#if ENABLE(WEB_PROCESS_SANDBOX)
for (size_t i = 0; i < fileURLs.size(); ++i) {
SandboxExtension::Handle sandboxExtensionHandle;
SandboxExtension::createHandle(fileURLs[i], SandboxExtension::ReadOnly, sandboxExtensionHandle);
process()->send(Messages::WebPage::ExtendSandboxForFileFromOpenPanel(sandboxExtensionHandle), m_pageID);
}
#endif
process()->send(Messages::WebPage::DidChooseFilesForOpenPanel(fileURLs), m_pageID);
m_openPanelResultListener->invalidate();
m_openPanelResultListener = 0;
}
| 0
|
static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolate());
TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(jsValue, exceptionState), exceptionState);
imp->setActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue);
}
| 0
|
void ScriptController::clearWindowShell(bool)
{
m_proxy->clearForNavigation();
}
| 0
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 12