unique_id
int64 13
189k
| target
int64 0
1
| code
stringlengths 20
241k
| __index_level_0__
int64 0
18.9k
|
|---|---|---|---|
98,490
| 0
|
SendThumbnailTask(HWND aeropeek_window,
const gfx::Rect& content_bounds,
const gfx::Size& aeropeek_size,
const SkBitmap& tab_bitmap,
base::WaitableEvent* ready)
: aeropeek_window_(aeropeek_window),
content_bounds_(content_bounds),
aeropeek_size_(aeropeek_size),
tab_bitmap_(tab_bitmap),
ready_(ready) {
}
| 11,800
|
38,488
| 0
|
static int cma_iw_handler(struct iw_cm_id *iw_id, struct iw_cm_event *iw_event)
{
struct rdma_id_private *id_priv = iw_id->context;
struct rdma_cm_event event;
int ret = 0;
struct sockaddr *laddr = (struct sockaddr *)&iw_event->local_addr;
struct sockaddr *raddr = (struct sockaddr *)&iw_event->remote_addr;
if (cma_disable_callback(id_priv, RDMA_CM_CONNECT))
return 0;
memset(&event, 0, sizeof event);
switch (iw_event->event) {
case IW_CM_EVENT_CLOSE:
event.event = RDMA_CM_EVENT_DISCONNECTED;
break;
case IW_CM_EVENT_CONNECT_REPLY:
memcpy(cma_src_addr(id_priv), laddr,
rdma_addr_size(laddr));
memcpy(cma_dst_addr(id_priv), raddr,
rdma_addr_size(raddr));
switch (iw_event->status) {
case 0:
event.event = RDMA_CM_EVENT_ESTABLISHED;
event.param.conn.initiator_depth = iw_event->ird;
event.param.conn.responder_resources = iw_event->ord;
break;
case -ECONNRESET:
case -ECONNREFUSED:
event.event = RDMA_CM_EVENT_REJECTED;
break;
case -ETIMEDOUT:
event.event = RDMA_CM_EVENT_UNREACHABLE;
break;
default:
event.event = RDMA_CM_EVENT_CONNECT_ERROR;
break;
}
break;
case IW_CM_EVENT_ESTABLISHED:
event.event = RDMA_CM_EVENT_ESTABLISHED;
event.param.conn.initiator_depth = iw_event->ird;
event.param.conn.responder_resources = iw_event->ord;
break;
default:
BUG_ON(1);
}
event.status = iw_event->status;
event.param.conn.private_data = iw_event->private_data;
event.param.conn.private_data_len = iw_event->private_data_len;
ret = id_priv->id.event_handler(&id_priv->id, &event);
if (ret) {
/* Destroy the CM ID by returning a non-zero value. */
id_priv->cm_id.iw = NULL;
cma_exch(id_priv, RDMA_CM_DESTROYING);
mutex_unlock(&id_priv->handler_mutex);
rdma_destroy_id(&id_priv->id);
return ret;
}
mutex_unlock(&id_priv->handler_mutex);
return ret;
}
| 11,801
|
42,557
| 0
|
suspend_hi_store(struct mddev *mddev, const char *buf, size_t len)
{
unsigned long long old, new;
int err;
err = kstrtoull(buf, 10, &new);
if (err < 0)
return err;
if (new != (sector_t)new)
return -EINVAL;
err = mddev_lock(mddev);
if (err)
return err;
err = -EINVAL;
if (mddev->pers == NULL ||
mddev->pers->quiesce == NULL)
goto unlock;
old = mddev->suspend_hi;
mddev->suspend_hi = new;
if (new <= old)
/* Shrinking suspended region */
mddev->pers->quiesce(mddev, 2);
else {
/* Expanding suspended region - need to wait */
mddev->pers->quiesce(mddev, 1);
mddev->pers->quiesce(mddev, 0);
}
err = 0;
unlock:
mddev_unlock(mddev);
return err ?: len;
}
| 11,802
|
110,642
| 0
|
static bool StringIsValidForGLES(const char* str) {
for (; *str; ++str) {
if (!CharacterIsValidForGLES(*str)) {
return false;
}
}
return true;
}
| 11,803
|
48,875
| 0
|
netdev_features_t netdev_increment_features(netdev_features_t all,
netdev_features_t one, netdev_features_t mask)
{
if (mask & NETIF_F_HW_CSUM)
mask |= NETIF_F_CSUM_MASK;
mask |= NETIF_F_VLAN_CHALLENGED;
all |= one & (NETIF_F_ONE_FOR_ALL | NETIF_F_CSUM_MASK) & mask;
all &= one | ~NETIF_F_ALL_FOR_ALL;
/* If one device supports hw checksumming, set for all. */
if (all & NETIF_F_HW_CSUM)
all &= ~(NETIF_F_CSUM_MASK & ~NETIF_F_HW_CSUM);
return all;
}
| 11,804
|
159,070
| 0
|
void ChromeDownloadManagerDelegate::OnDownloadTargetDetermined(
int32_t download_id,
const content::DownloadTargetCallback& callback,
std::unique_ptr<DownloadTargetInfo> target_info) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DownloadItem* item = download_manager_->GetDownload(download_id);
if (item) {
if (!target_info->target_path.empty() &&
IsOpenInBrowserPreferreredForFile(target_info->target_path) &&
target_info->is_filetype_handled_safely)
DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
#if defined(OS_LINUX)
if (item->GetOriginalMimeType() == "application/x-x509-user-cert")
DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true);
#endif
DownloadItemModel(item).SetDangerLevel(target_info->danger_level);
}
if (ShouldBlockFile(target_info->danger_type)) {
target_info->result = content::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED;
target_info->danger_type = content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS;
}
callback.Run(target_info->target_path, target_info->target_disposition,
target_info->danger_type, target_info->intermediate_path,
target_info->result);
}
| 11,805
|
25,626
| 0
|
void __flush_tlb_global(void)
{
flush_tlb_all();
}
| 11,806
|
170,670
| 0
|
uint32_t Visualizer_getDeltaTimeMsFromUpdatedTime(VisualizerContext* pContext) {
uint32_t deltaMs = 0;
if (pContext->mBufferUpdateTime.tv_sec != 0) {
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
time_t secs = ts.tv_sec - pContext->mBufferUpdateTime.tv_sec;
long nsec = ts.tv_nsec - pContext->mBufferUpdateTime.tv_nsec;
if (nsec < 0) {
--secs;
nsec += 1000000000;
}
deltaMs = secs * 1000 + nsec / 1000000;
}
}
return deltaMs;
}
| 11,807
|
43,492
| 0
|
rfc4106_set_hash_subkey(u8 *hash_subkey, const u8 *key, unsigned int key_len)
{
struct crypto_ablkcipher *ctr_tfm;
struct ablkcipher_request *req;
int ret = -EINVAL;
struct aesni_hash_subkey_req_data *req_data;
ctr_tfm = crypto_alloc_ablkcipher("ctr(aes)", 0, 0);
if (IS_ERR(ctr_tfm))
return PTR_ERR(ctr_tfm);
crypto_ablkcipher_clear_flags(ctr_tfm, ~0);
ret = crypto_ablkcipher_setkey(ctr_tfm, key, key_len);
if (ret)
goto out_free_ablkcipher;
ret = -ENOMEM;
req = ablkcipher_request_alloc(ctr_tfm, GFP_KERNEL);
if (!req)
goto out_free_ablkcipher;
req_data = kmalloc(sizeof(*req_data), GFP_KERNEL);
if (!req_data)
goto out_free_request;
memset(req_data->iv, 0, sizeof(req_data->iv));
/* Clear the data in the hash sub key container to zero.*/
/* We want to cipher all zeros to create the hash sub key. */
memset(hash_subkey, 0, RFC4106_HASH_SUBKEY_SIZE);
init_completion(&req_data->result.completion);
sg_init_one(&req_data->sg, hash_subkey, RFC4106_HASH_SUBKEY_SIZE);
ablkcipher_request_set_tfm(req, ctr_tfm);
ablkcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP |
CRYPTO_TFM_REQ_MAY_BACKLOG,
rfc4106_set_hash_subkey_done,
&req_data->result);
ablkcipher_request_set_crypt(req, &req_data->sg,
&req_data->sg, RFC4106_HASH_SUBKEY_SIZE, req_data->iv);
ret = crypto_ablkcipher_encrypt(req);
if (ret == -EINPROGRESS || ret == -EBUSY) {
ret = wait_for_completion_interruptible
(&req_data->result.completion);
if (!ret)
ret = req_data->result.err;
}
kfree(req_data);
out_free_request:
ablkcipher_request_free(req);
out_free_ablkcipher:
crypto_free_ablkcipher(ctr_tfm);
return ret;
}
| 11,808
|
89,626
| 0
|
ghash_internal (gcry_cipher_hd_t c, byte *result, const byte *buf,
size_t nblocks)
{
const unsigned int blocksize = GCRY_GCM_BLOCK_LEN;
unsigned int burn = 0;
prefetch_tables (c);
while (nblocks)
{
burn = GHASH (c, result, buf);
buf += blocksize;
nblocks--;
}
return burn + (burn ? 5*sizeof(void*) : 0);
}
| 11,809
|
137,103
| 0
|
void InputType::SetValueAsDate(double, ExceptionState& exception_state) const {
exception_state.ThrowDOMException(
kInvalidStateError, "This input element does not support Date values.");
}
| 11,810
|
41,697
| 0
|
static int btrfs_writepages(struct address_space *mapping,
struct writeback_control *wbc)
{
struct extent_io_tree *tree;
tree = &BTRFS_I(mapping->host)->io_tree;
return extent_writepages(tree, mapping, btrfs_get_extent, wbc);
}
| 11,811
|
57,319
| 0
|
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name) /* {{{ */
{
return zend_eval_stringl(str, strlen(str), retval_ptr, string_name);
}
/* }}} */
| 11,812
|
121,848
| 0
|
void IOThread::ClearHostCache() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
net::HostCache* host_cache = globals_->host_resolver->GetHostCache();
if (host_cache)
host_cache->clear();
}
| 11,813
|
73,154
| 0
|
buf_new_with_capacity(size_t size)
{
buf_t *b = buf_new();
b->default_chunk_size = preferred_chunk_size(size);
return b;
}
| 11,814
|
102,702
| 0
|
bool CCThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect)
{
TRACE_EVENT("CCThreadPRoxy::compositeAndReadback", this, 0);
ASSERT(isMainThread());
ASSERT(m_layerTreeHost);
if (m_commitRequested) {
OwnPtr<CCMainThread::Task> beginFrameAndCommitTask;
{
CCMainThread::Task* taskPtr = 0;
CCCompletionEvent completion;
s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::obtainBeginFrameAndCommitTaskFromCCThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&taskPtr)));
completion.wait();
beginFrameAndCommitTask = adoptPtr(taskPtr);
}
beginFrameAndCommitTask->performTask();
}
bool success = false;
CCCompletionEvent completion;
s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::drawLayersAndReadbackOnCCThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&success), AllowCrossThreadAccess(pixels), rect));
completion.wait();
return success;
}
| 11,815
|
32,627
| 0
|
static void tg3_napi_fini(struct tg3 *tp)
{
int i;
for (i = 0; i < tp->irq_cnt; i++)
netif_napi_del(&tp->napi[i].napi);
}
| 11,816
|
57,742
| 0
|
static int kvm_read_guest_virt_helper(gva_t addr, void *val, unsigned int bytes,
struct kvm_vcpu *vcpu, u32 access,
struct x86_exception *exception)
{
void *data = val;
int r = X86EMUL_CONTINUE;
while (bytes) {
gpa_t gpa = vcpu->arch.walk_mmu->gva_to_gpa(vcpu, addr, access,
exception);
unsigned offset = addr & (PAGE_SIZE-1);
unsigned toread = min(bytes, (unsigned)PAGE_SIZE - offset);
int ret;
if (gpa == UNMAPPED_GVA)
return X86EMUL_PROPAGATE_FAULT;
ret = kvm_vcpu_read_guest_page(vcpu, gpa >> PAGE_SHIFT, data,
offset, toread);
if (ret < 0) {
r = X86EMUL_IO_NEEDED;
goto out;
}
bytes -= toread;
data += toread;
addr += toread;
}
out:
return r;
}
| 11,817
|
3,091
| 0
|
static int hashciedefspace(i_ctx_t *i_ctx_p, ref *space, gs_md5_state_t *md5)
{
int code = 0;
ref CIEdict1, spacename;
code = array_get(imemory, space, 0, &spacename);
if (code < 0)
return 0;
gs_md5_append(md5, (const gs_md5_byte_t *)&spacename.value.pname, sizeof(spacename.value.pname));
code = array_get(imemory, space, 1, &CIEdict1);
if (code < 0)
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"WhitePoint", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"BlackPoint", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"RangeABC", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"DecodeABC", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"MatrixABC", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"RangeLMN", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"DecodeLMN", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"MatrixMN", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"RangeDEF", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"DecodeDEF", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"RangeHIJ", md5))
return 0;
if (!hashdictkey(i_ctx_p, &CIEdict1, (char *)"Table", md5))
return 0;
return 1;
}
| 11,818
|
127,418
| 0
|
void FileAPIMessageFilter::BadMessageReceived() {
RecordAction(UserMetricsAction("BadMessageTerminate_FAMF"));
BrowserMessageFilter::BadMessageReceived();
}
| 11,819
|
171,562
| 0
|
String8& String8::convertToResPath()
{
#if OS_PATH_SEPARATOR != RES_PATH_SEPARATOR
size_t len = length();
if (len > 0) {
char * buf = lockBuffer(len);
for (char * end = buf + len; buf < end; ++buf) {
if (*buf == OS_PATH_SEPARATOR)
*buf = RES_PATH_SEPARATOR;
}
unlockBuffer(len);
}
#endif
return *this;
}
| 11,820
|
58,781
| 0
|
struct page *__grab_cache_page(struct address_space *mapping, pgoff_t index)
{
int status;
struct page *page;
repeat:
page = find_lock_page(mapping, index);
if (likely(page))
return page;
page = page_cache_alloc(mapping);
if (!page)
return NULL;
status = add_to_page_cache_lru(page, mapping, index, GFP_KERNEL);
if (unlikely(status)) {
page_cache_release(page);
if (status == -EEXIST)
goto repeat;
return NULL;
}
return page;
}
| 11,821
|
104,056
| 0
|
void GLES2DecoderImpl::DoUniform3fv(
GLint location, GLsizei count, const GLfloat* value) {
GLenum type = 0;
if (!PrepForSetUniformByLocation(location, "glUniform3fv", &type, &count)) {
return;
}
if (type == GL_BOOL_VEC3) {
GLsizei num_values = count * 3;
scoped_array<GLint> temp(new GLint[num_values]);
for (GLsizei ii = 0; ii < num_values; ++ii) {
temp[ii] = static_cast<GLint>(value[ii] != 0.0f);
}
glUniform3iv(location, count, temp.get());
} else {
glUniform3fv(location, count, value);
}
}
| 11,822
|
172,505
| 0
|
void CameraSource::DeathNotifier::binderDied(const wp<IBinder>& who __unused) {
ALOGI("Camera recording proxy died");
}
| 11,823
|
122,509
| 0
|
void InspectorResourceAgent::replayXHR(ErrorString*, const String& requestId)
{
String actualRequestId = requestId;
XHRReplayData* xhrReplayData = m_resourcesData->xhrReplayData(requestId);
if (!xhrReplayData)
return;
ExecutionContext* executionContext = xhrReplayData->executionContext();
if (!executionContext) {
m_resourcesData->setXHRReplayData(requestId, 0);
return;
}
RefPtrWillBeRawPtr<XMLHttpRequest> xhr = XMLHttpRequest::create(executionContext);
Resource* cachedResource = memoryCache()->resourceForURL(xhrReplayData->url());
if (cachedResource)
memoryCache()->remove(cachedResource);
xhr->open(xhrReplayData->method(), xhrReplayData->url(), xhrReplayData->async(), IGNORE_EXCEPTION);
HTTPHeaderMap::const_iterator end = xhrReplayData->headers().end();
for (HTTPHeaderMap::const_iterator it = xhrReplayData->headers().begin(); it!= end; ++it)
xhr->setRequestHeader(it->key, it->value, IGNORE_EXCEPTION);
xhr->sendForInspectorXHRReplay(xhrReplayData->formData(), IGNORE_EXCEPTION);
}
| 11,824
|
94,662
| 0
|
X509 *d2i_X509_bio(BIO *bp, X509 **x509)
{
return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509), bp, x509);
}
| 11,825
|
26,841
| 0
|
static ssize_t proc_coredump_filter_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct task_struct *task = get_proc_task(file->f_dentry->d_inode);
struct mm_struct *mm;
char buffer[PROC_NUMBUF];
size_t len;
int ret;
if (!task)
return -ESRCH;
ret = 0;
mm = get_task_mm(task);
if (mm) {
len = snprintf(buffer, sizeof(buffer), "%08lx\n",
((mm->flags & MMF_DUMP_FILTER_MASK) >>
MMF_DUMP_FILTER_SHIFT));
mmput(mm);
ret = simple_read_from_buffer(buf, count, ppos, buffer, len);
}
put_task_struct(task);
return ret;
}
| 11,826
|
115,586
| 0
|
void GraphicsContext::clip(const Path& path)
{
if (paintingDisabled())
return;
const SkPath& p = *path.platformPath();
if (!isPathSkiaSafe(getCTM(), p))
return;
platformContext()->clipPathAntiAliased(p);
}
| 11,827
|
130,916
| 0
|
static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
return;
}
TestObject* imp = V8TestObject::toNative(info.Holder());
V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate()));
if (!oo.isUndefinedOrNull() && !oo.isObject()) {
throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 1 ('oo') is not an object."), info.GetIsolate());
return;
}
V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate()));
if (!ooo.isUndefinedOrNull() && !ooo.isObject()) {
throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 2 ('ooo') is not an object."), info.GetIsolate());
return;
}
imp->optionsObject(oo, ooo);
}
| 11,828
|
111,001
| 0
|
void FileSystemOperation::CreateSnapshotFile(
const GURL& path_url,
const SnapshotFileCallback& callback) {
GetMetadata(path_url, base::Bind(&GetMetadataForSnapshot, callback));
}
| 11,829
|
86,310
| 0
|
static inline struct net *to_net_ns(struct ns_common *ns)
{
return container_of(ns, struct net, ns);
}
| 11,830
|
118,487
| 0
|
void RenderFrameImpl::didAccessInitialDocument(blink::WebLocalFrame* frame) {
DCHECK(!frame_ || frame_ == frame);
if (!frame->parent() && render_view_->page_id_ == -1)
Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_));
}
| 11,831
|
87,974
| 0
|
static int pcd_open(struct cdrom_device_info *cdi, int purpose)
{
struct pcd_unit *cd = cdi->handle;
if (!cd->present)
return -ENODEV;
return 0;
}
| 11,832
|
186,390
| 1
|
void SecureProxyChecker::CheckIfSecureProxyIsAllowed(
SecureProxyCheckerCallback fetcher_callback) {
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation(
"data_reduction_proxy_secure_proxy_check", R"(
semantics {
sender: "Data Reduction Proxy"
description:
"Sends a request to the Data Reduction Proxy server. Proceeds "
"with using a secure connection to the proxy only if the "
"response is not blocked or modified by an intermediary."
trigger:
"A request can be sent whenever the browser is determining how "
"to configure its connection to the data reduction proxy. This "
"happens on startup and network changes."
data: "A specific URL, not related to user data."
destination: GOOGLE_OWNED_SERVICE
}
policy {
cookies_allowed: NO
setting:
"Users can control Data Saver on Android via the 'Data Saver' "
"setting. Data Saver is not available on iOS, and on desktop "
"it is enabled by installing the Data Saver extension."
policy_exception_justification: "Not implemented."
})");
auto resource_request = std::make_unique<network::ResourceRequest>();
resource_request->url = params::GetSecureProxyCheckURL();
resource_request->load_flags =
net::LOAD_DISABLE_CACHE | net::LOAD_BYPASS_PROXY;
resource_request->allow_credentials = false;
url_loader_ = network::SimpleURLLoader::Create(std::move(resource_request),
traffic_annotation);
static const int kMaxRetries = 5;
url_loader_->SetRetryOptions(
kMaxRetries, network::SimpleURLLoader::RETRY_ON_NETWORK_CHANGE |
network::SimpleURLLoader::RETRY_ON_5XX);
url_loader_->SetOnRedirectCallback(base::BindRepeating(
&SecureProxyChecker::OnURLLoaderRedirect, base::Unretained(this)));
fetcher_callback_ = fetcher_callback;
secure_proxy_check_start_time_ = base::Time::Now();
url_loader_->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
url_loader_factory_.get(),
base::BindOnce(&SecureProxyChecker::OnURLLoadComplete,
base::Unretained(this)));
}
| 11,833
|
165,893
| 0
|
void RenderFrameImpl::DidFailLoad(const WebURLError& error,
blink::WebHistoryCommitType commit_type) {
TRACE_EVENT1("navigation,rail", "RenderFrameImpl::didFailLoad",
"id", routing_id_);
WebDocumentLoader* document_loader = frame_->GetDocumentLoader();
DCHECK(document_loader);
const WebURLRequest& failed_request = document_loader->GetRequest();
base::string16 error_description;
GetContentClient()->renderer()->GetErrorDescription(failed_request, error,
&error_description);
Send(new FrameHostMsg_DidFailLoadWithError(
routing_id_, failed_request.Url(), error.reason(), error_description));
}
| 11,834
|
79,807
| 0
|
static int uvesafb_vbe_init(struct fb_info *info)
{
struct uvesafb_ktask *task = NULL;
struct uvesafb_par *par = info->par;
int err;
task = uvesafb_prep();
if (!task)
return -ENOMEM;
err = uvesafb_vbe_getinfo(task, par);
if (err)
goto out;
err = uvesafb_vbe_getmodes(task, par);
if (err)
goto out;
par->nocrtc = nocrtc;
#ifdef CONFIG_X86_32
par->pmi_setpal = pmi_setpal;
par->ypan = ypan;
if (par->pmi_setpal || par->ypan) {
if (__supported_pte_mask & _PAGE_NX) {
par->pmi_setpal = par->ypan = 0;
pr_warn("NX protection is active, better not use the PMI\n");
} else {
uvesafb_vbe_getpmi(task, par);
}
}
#else
/* The protected mode interface is not available on non-x86. */
par->pmi_setpal = par->ypan = 0;
#endif
INIT_LIST_HEAD(&info->modelist);
uvesafb_vbe_getmonspecs(task, info);
uvesafb_vbe_getstatesize(task, par);
out: uvesafb_free(task);
return err;
}
| 11,835
|
81,887
| 0
|
int wc_ecc_get_curve_id_from_params(int fieldSize,
const byte* prime, word32 primeSz, const byte* Af, word32 AfSz,
const byte* Bf, word32 BfSz, const byte* order, word32 orderSz,
const byte* Gx, word32 GxSz, const byte* Gy, word32 GySz, int cofactor)
{
int idx;
int curveSz;
if (prime == NULL || Af == NULL || Bf == NULL || order == NULL ||
Gx == NULL || Gy == NULL)
return BAD_FUNC_ARG;
curveSz = (fieldSize + 1) / 8; /* round up */
for (idx = 0; ecc_sets[idx].size != 0; idx++) {
if (curveSz == ecc_sets[idx].size) {
if ((wc_ecc_cmp_param(ecc_sets[idx].prime, prime,
primeSz) == MP_EQ) &&
(wc_ecc_cmp_param(ecc_sets[idx].Af, Af, AfSz) == MP_EQ) &&
(wc_ecc_cmp_param(ecc_sets[idx].Bf, Bf, BfSz) == MP_EQ) &&
(wc_ecc_cmp_param(ecc_sets[idx].order, order,
orderSz) == MP_EQ) &&
(wc_ecc_cmp_param(ecc_sets[idx].Gx, Gx, GxSz) == MP_EQ) &&
(wc_ecc_cmp_param(ecc_sets[idx].Gy, Gy, GySz) == MP_EQ) &&
(cofactor == ecc_sets[idx].cofactor)) {
break;
}
}
}
if (ecc_sets[idx].size == 0)
return ECC_CURVE_INVALID;
return ecc_sets[idx].id;
}
| 11,836
|
67,532
| 0
|
static int ext4_journalled_write_end(struct file *file,
struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{
handle_t *handle = ext4_journal_current_handle();
struct inode *inode = mapping->host;
loff_t old_size = inode->i_size;
int ret = 0, ret2;
int partial = 0;
unsigned from, to;
int size_changed = 0;
trace_ext4_journalled_write_end(inode, pos, len, copied);
from = pos & (PAGE_SIZE - 1);
to = from + len;
BUG_ON(!ext4_handle_valid(handle));
if (ext4_has_inline_data(inode))
copied = ext4_write_inline_data_end(inode, pos, len,
copied, page);
else {
if (copied < len) {
if (!PageUptodate(page))
copied = 0;
zero_new_buffers(page, from+copied, to);
}
ret = ext4_walk_page_buffers(handle, page_buffers(page), from,
to, &partial, write_end_fn);
if (!partial)
SetPageUptodate(page);
}
size_changed = ext4_update_inode_size(inode, pos + copied);
ext4_set_inode_state(inode, EXT4_STATE_JDATA);
EXT4_I(inode)->i_datasync_tid = handle->h_transaction->t_tid;
unlock_page(page);
put_page(page);
if (old_size < pos)
pagecache_isize_extended(inode, old_size, pos);
if (size_changed) {
ret2 = ext4_mark_inode_dirty(handle, inode);
if (!ret)
ret = ret2;
}
if (pos + len > inode->i_size && ext4_can_truncate(inode))
/* if we have allocated more blocks and copied
* less. We will have blocks allocated outside
* inode->i_size. So truncate them
*/
ext4_orphan_add(handle, inode);
ret2 = ext4_journal_stop(handle);
if (!ret)
ret = ret2;
if (pos + len > inode->i_size) {
ext4_truncate_failed_write(inode);
/*
* If truncate failed early the inode might still be
* on the orphan list; we need to make sure the inode
* is removed from the orphan list in that case.
*/
if (inode->i_nlink)
ext4_orphan_del(NULL, inode);
}
return ret ? ret : copied;
}
| 11,837
|
67,336
| 0
|
static enum lru_status dentry_lru_isolate(struct list_head *item,
struct list_lru_one *lru, spinlock_t *lru_lock, void *arg)
{
struct list_head *freeable = arg;
struct dentry *dentry = container_of(item, struct dentry, d_lru);
/*
* we are inverting the lru lock/dentry->d_lock here,
* so use a trylock. If we fail to get the lock, just skip
* it
*/
if (!spin_trylock(&dentry->d_lock))
return LRU_SKIP;
/*
* Referenced dentries are still in use. If they have active
* counts, just remove them from the LRU. Otherwise give them
* another pass through the LRU.
*/
if (dentry->d_lockref.count) {
d_lru_isolate(lru, dentry);
spin_unlock(&dentry->d_lock);
return LRU_REMOVED;
}
if (dentry->d_flags & DCACHE_REFERENCED) {
dentry->d_flags &= ~DCACHE_REFERENCED;
spin_unlock(&dentry->d_lock);
/*
* The list move itself will be made by the common LRU code. At
* this point, we've dropped the dentry->d_lock but keep the
* lru lock. This is safe to do, since every list movement is
* protected by the lru lock even if both locks are held.
*
* This is guaranteed by the fact that all LRU management
* functions are intermediated by the LRU API calls like
* list_lru_add and list_lru_del. List movement in this file
* only ever occur through this functions or through callbacks
* like this one, that are called from the LRU API.
*
* The only exceptions to this are functions like
* shrink_dentry_list, and code that first checks for the
* DCACHE_SHRINK_LIST flag. Those are guaranteed to be
* operating only with stack provided lists after they are
* properly isolated from the main list. It is thus, always a
* local access.
*/
return LRU_ROTATE;
}
d_lru_shrink_move(lru, dentry, freeable);
spin_unlock(&dentry->d_lock);
return LRU_REMOVED;
}
| 11,838
|
54,172
| 0
|
static int digi_tiocmget(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct digi_port *priv = usb_get_serial_port_data(port);
unsigned int val;
unsigned long flags;
spin_lock_irqsave(&priv->dp_port_lock, flags);
val = priv->dp_modem_signals;
spin_unlock_irqrestore(&priv->dp_port_lock, flags);
return val;
}
| 11,839
|
131,788
| 0
|
static void testInterfacePythonAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
v8SetReturnValueFast(info, WTF::getPtr(imp->testInterfacePythonAttribute()), imp);
}
| 11,840
|
110,777
| 0
|
void AutocompleteEditModel::ClearPopupKeywordMode() const {
if (popup_->IsOpen() &&
popup_->selected_line_state() == AutocompletePopupModel::KEYWORD)
popup_->SetSelectedLineState(AutocompletePopupModel::NORMAL);
}
| 11,841
|
35,864
| 0
|
struct sctp_chunk *sctp_make_datafrag_empty(struct sctp_association *asoc,
const struct sctp_sndrcvinfo *sinfo,
int data_len, __u8 flags, __u16 ssn)
{
struct sctp_chunk *retval;
struct sctp_datahdr dp;
int chunk_len;
/* We assign the TSN as LATE as possible, not here when
* creating the chunk.
*/
dp.tsn = 0;
dp.stream = htons(sinfo->sinfo_stream);
dp.ppid = sinfo->sinfo_ppid;
/* Set the flags for an unordered send. */
if (sinfo->sinfo_flags & SCTP_UNORDERED) {
flags |= SCTP_DATA_UNORDERED;
dp.ssn = 0;
} else
dp.ssn = htons(ssn);
chunk_len = sizeof(dp) + data_len;
retval = sctp_make_data(asoc, flags, chunk_len);
if (!retval)
goto nodata;
retval->subh.data_hdr = sctp_addto_chunk(retval, sizeof(dp), &dp);
memcpy(&retval->sinfo, sinfo, sizeof(struct sctp_sndrcvinfo));
nodata:
return retval;
}
| 11,842
|
38,389
| 0
|
static void cm_get_ack_delay(struct cm_device *cm_dev)
{
struct ib_device_attr attr;
if (ib_query_device(cm_dev->ib_device, &attr))
cm_dev->ack_delay = 0; /* acks will rely on packet life time */
else
cm_dev->ack_delay = attr.local_ca_ack_delay;
}
| 11,843
|
85,946
| 0
|
static void do_deferred_remove(struct work_struct *w)
{
dm_deferred_remove();
}
| 11,844
|
55,203
| 0
|
static int powermate_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int _value)
{
unsigned int command = (unsigned int)_value;
struct powermate_device *pm = input_get_drvdata(dev);
if (type == EV_MSC && code == MSC_PULSELED){
/*
bits 0- 7: 8 bits: LED brightness
bits 8-16: 9 bits: pulsing speed modifier (0 ... 510); 0-254 = slower, 255 = standard, 256-510 = faster.
bits 17-18: 2 bits: pulse table (0, 1, 2 valid)
bit 19: 1 bit : pulse whilst asleep?
bit 20: 1 bit : pulse constantly?
*/
int static_brightness = command & 0xFF; // bits 0-7
int pulse_speed = (command >> 8) & 0x1FF; // bits 8-16
int pulse_table = (command >> 17) & 0x3; // bits 17-18
int pulse_asleep = (command >> 19) & 0x1; // bit 19
int pulse_awake = (command >> 20) & 0x1; // bit 20
powermate_pulse_led(pm, static_brightness, pulse_speed, pulse_table, pulse_asleep, pulse_awake);
}
return 0;
}
| 11,845
|
93,385
| 0
|
static void flush_backlog(struct work_struct *work)
{
struct sk_buff *skb, *tmp;
struct softnet_data *sd;
local_bh_disable();
sd = this_cpu_ptr(&softnet_data);
local_irq_disable();
rps_lock(sd);
skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) {
if (skb->dev->reg_state == NETREG_UNREGISTERING) {
__skb_unlink(skb, &sd->input_pkt_queue);
kfree_skb(skb);
input_queue_head_incr(sd);
}
}
rps_unlock(sd);
local_irq_enable();
skb_queue_walk_safe(&sd->process_queue, skb, tmp) {
if (skb->dev->reg_state == NETREG_UNREGISTERING) {
__skb_unlink(skb, &sd->process_queue);
kfree_skb(skb);
input_queue_head_incr(sd);
}
}
local_bh_enable();
}
| 11,846
|
62,874
| 0
|
static int check_sysreg_table(const struct sys_reg_desc *table, unsigned int n)
{
unsigned int i;
for (i = 1; i < n; i++) {
if (cmp_sys_reg(&table[i-1], &table[i]) >= 0) {
kvm_err("sys_reg table %p out of order (%d)\n", table, i - 1);
return 1;
}
}
return 0;
}
| 11,847
|
149,452
| 0
|
bool isAllowedByAll(const CSPDirectiveListVector& policies,
const KURL& url,
const String& nonce,
RedirectStatus redirectStatus,
SecurityViolationReportingPolicy reportingPolicy) {
if (ContentSecurityPolicy::shouldBypassContentSecurityPolicy(url))
return true;
bool isAllowed = true;
for (const auto& policy : policies) {
isAllowed &= (policy.get()->*allowFromURLWithNonce)(
url, nonce, redirectStatus, reportingPolicy);
}
return isAllowed;
}
| 11,848
|
5,476
| 0
|
static void Ins_WCVTP( INS_ARG )
{
if ( BOUNDS( args[0], CUR.cvtSize ) )
{
CUR.error = TT_Err_Invalid_Reference;
return;
}
CUR_Func_write_cvt( args[0], args[1] );
}
| 11,849
|
187,005
| 1
|
void DownloadResourceHandler::OnRequestRedirected(
const net::RedirectInfo& redirect_info,
network::ResourceResponse* response,
std::unique_ptr<ResourceController> controller) {
url::Origin new_origin(url::Origin::Create(redirect_info.new_url));
if (!follow_cross_origin_redirects_ &&
!first_origin_.IsSameOriginWith(new_origin)) {
base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::UI},
base::BindOnce(
&NavigateOnUIThread, redirect_info.new_url, request()->url_chain(),
Referrer(GURL(redirect_info.new_referrer),
Referrer::NetReferrerPolicyToBlinkReferrerPolicy(
redirect_info.new_referrer_policy)),
GetRequestInfo()->HasUserGesture(),
GetRequestInfo()->GetWebContentsGetterForRequest()));
controller->Cancel();
return;
}
if (core_.OnRequestRedirected()) {
controller->Resume();
} else {
controller->Cancel();
}
}
| 11,850
|
68,101
| 0
|
static void header(RBinFile *arch) {
struct r_bin_dex_obj_t *bin = arch->o->bin_obj;
struct r_bin_t *rbin = arch->rbin;
rbin->cb_printf ("DEX file header:\n");
rbin->cb_printf ("magic : 'dex\\n035\\0'\n");
rbin->cb_printf ("checksum : %x\n", bin->header.checksum);
rbin->cb_printf ("signature : %02x%02x...%02x%02x\n", bin->header.signature[0], bin->header.signature[1], bin->header.signature[18], bin->header.signature[19]);
rbin->cb_printf ("file_size : %d\n", bin->header.size);
rbin->cb_printf ("header_size : %d\n", bin->header.header_size);
rbin->cb_printf ("link_size : %d\n", bin->header.linksection_size);
rbin->cb_printf ("link_off : %d (0x%06x)\n", bin->header.linksection_offset, bin->header.linksection_offset);
rbin->cb_printf ("string_ids_size : %d\n", bin->header.strings_size);
rbin->cb_printf ("string_ids_off : %d (0x%06x)\n", bin->header.strings_offset, bin->header.strings_offset);
rbin->cb_printf ("type_ids_size : %d\n", bin->header.types_size);
rbin->cb_printf ("type_ids_off : %d (0x%06x)\n", bin->header.types_offset, bin->header.types_offset);
rbin->cb_printf ("proto_ids_size : %d\n", bin->header.prototypes_size);
rbin->cb_printf ("proto_ids_off : %d (0x%06x)\n", bin->header.prototypes_offset, bin->header.prototypes_offset);
rbin->cb_printf ("field_ids_size : %d\n", bin->header.fields_size);
rbin->cb_printf ("field_ids_off : %d (0x%06x)\n", bin->header.fields_offset, bin->header.fields_offset);
rbin->cb_printf ("method_ids_size : %d\n", bin->header.method_size);
rbin->cb_printf ("method_ids_off : %d (0x%06x)\n", bin->header.method_offset, bin->header.method_offset);
rbin->cb_printf ("class_defs_size : %d\n", bin->header.class_size);
rbin->cb_printf ("class_defs_off : %d (0x%06x)\n", bin->header.class_offset, bin->header.class_offset);
rbin->cb_printf ("data_size : %d\n", bin->header.data_size);
rbin->cb_printf ("data_off : %d (0x%06x)\n\n", bin->header.data_offset, bin->header.data_offset);
dexdump = true;
bin->methods_list = NULL;
dex_loadcode (arch, bin);
dexdump = false;
}
| 11,851
|
149,394
| 0
|
AwFeatureListCreator::~AwFeatureListCreator() {}
| 11,852
|
162,796
| 0
|
GLuint GetCubeServiceId(const TextureUnit& unit) {
return unit.bound_texture_cube_map.get()
? unit.bound_texture_cube_map->service_id() : 0;
}
| 11,853
|
150,247
| 0
|
TabletModeWindowState::TabletModeWindowState(aura::Window* window,
TabletModeWindowManager* creator,
bool snap,
bool animate_bounds_on_attach,
bool entering_tablet_mode)
: window_(window),
creator_(creator),
animate_bounds_on_attach_(animate_bounds_on_attach) {
wm::WindowState* state = wm::GetWindowState(window);
current_state_type_ = state->GetStateType();
DCHECK(!snap || CanSnapInSplitview(window));
state_type_on_attach_ =
snap ? current_state_type_ : GetMaximizedOrCenteredWindowType(state);
if (entering_tablet_mode)
set_enter_animation_type(IsTopWindow(window) ? DEFAULT : STEP_END);
old_state_.reset(
state->SetStateObject(std::unique_ptr<State>(this)).release());
}
| 11,854
|
83,655
| 0
|
int git_index_add(git_index *index, const git_index_entry *source_entry)
{
git_index_entry *entry = NULL;
int ret;
assert(index && source_entry && source_entry->path);
if (!valid_filemode(source_entry->mode)) {
giterr_set(GITERR_INDEX, "invalid entry mode");
return -1;
}
if ((ret = index_entry_dup(&entry, index, source_entry)) < 0 ||
(ret = index_insert(index, &entry, 1, true, true, false)) < 0)
return ret;
git_tree_cache_invalidate_path(index->tree, entry->path);
return 0;
}
| 11,855
|
167,450
| 0
|
void BaseAudioContext::Uninitialize() {
DCHECK(IsMainThread());
if (!IsDestinationInitialized())
return;
if (destination_node_)
destination_node_->Handler().Uninitialize();
GetDeferredTaskHandler().FinishTailProcessing();
ReleaseActiveSourceNodes();
RejectPendingResolvers();
DCHECK(listener_);
listener_->WaitForHRTFDatabaseLoaderThreadCompletion();
Clear();
}
| 11,856
|
130,135
| 0
|
void HTMLBodyElement::setScrollTop(int scrollTop)
{
Document& document = this->document();
document.updateLayoutIgnorePendingStylesheets();
if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) {
RenderBox* render = renderBox();
if (!render)
return;
if (render->hasOverflowClip()) {
render->setScrollTop(static_cast<int>(scrollTop * render->style()->effectiveZoom()));
return;
}
if (!document.inQuirksMode())
return;
}
LocalFrame* frame = document.frame();
if (!frame)
return;
FrameView* view = frame->view();
if (!view)
return;
view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(scrollTop * frame->pageZoomFactor())));
}
| 11,857
|
1,476
| 0
|
static int coroutine_fn stat_to_v9stat(V9fsPDU *pdu, V9fsPath *path,
const char *basename,
const struct stat *stbuf,
V9fsStat *v9stat)
{
int err;
memset(v9stat, 0, sizeof(*v9stat));
stat_to_qid(stbuf, &v9stat->qid);
v9stat->mode = stat_to_v9mode(stbuf);
v9stat->atime = stbuf->st_atime;
v9stat->mtime = stbuf->st_mtime;
v9stat->length = stbuf->st_size;
v9fs_string_free(&v9stat->uid);
v9fs_string_free(&v9stat->gid);
v9fs_string_free(&v9stat->muid);
v9stat->n_uid = stbuf->st_uid;
v9stat->n_gid = stbuf->st_gid;
v9stat->n_muid = 0;
v9fs_string_free(&v9stat->extension);
if (v9stat->mode & P9_STAT_MODE_SYMLINK) {
err = v9fs_co_readlink(pdu, path, &v9stat->extension);
if (err < 0) {
return err;
}
} else if (v9stat->mode & P9_STAT_MODE_DEVICE) {
v9fs_string_sprintf(&v9stat->extension, "%c %u %u",
S_ISCHR(stbuf->st_mode) ? 'c' : 'b',
major(stbuf->st_rdev), minor(stbuf->st_rdev));
} else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) {
v9fs_string_sprintf(&v9stat->extension, "%s %lu",
"HARDLINKCOUNT", (unsigned long)stbuf->st_nlink);
}
v9fs_string_sprintf(&v9stat->name, "%s", basename);
v9stat->size = 61 +
v9fs_string_size(&v9stat->name) +
v9fs_string_size(&v9stat->uid) +
v9fs_string_size(&v9stat->gid) +
v9fs_string_size(&v9stat->muid) +
v9fs_string_size(&v9stat->extension);
return 0;
}
| 11,858
|
173,677
| 0
|
unsigned pid() const { return mElementaryPID; }
| 11,859
|
177,924
| 1
|
_zip_cdir_new(int nentry, struct zip_error *error)
{
struct zip_cdir *cd;
if ((cd=(struct zip_cdir *)malloc(sizeof(*cd))) == NULL) {
_zip_error_set(error, ZIP_ER_MEMORY, 0);
return NULL;
}
if ((cd->entry=(struct zip_dirent *)malloc(sizeof(*(cd->entry))*nentry))
== NULL) {
_zip_error_set(error, ZIP_ER_MEMORY, 0);
free(cd);
return NULL;
}
/* entries must be initialized by caller */
cd->nentry = nentry;
cd->size = cd->offset = 0;
cd->comment = NULL;
cd->comment_len = 0;
return cd;
}
| 11,860
|
6,794
| 0
|
static int cli_io_handler_show_errors(struct appctx *appctx)
{
struct stream_interface *si = appctx->owner;
extern const char *monthname[12];
if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
return 1;
chunk_reset(&trash);
if (!appctx->ctx.errors.px) {
/* the function had not been called yet, let's prepare the
* buffer for a response.
*/
struct tm tm;
get_localtime(date.tv_sec, &tm);
chunk_appendf(&trash, "Total events captured on [%02d/%s/%04d:%02d:%02d:%02d.%03d] : %u\n",
tm.tm_mday, monthname[tm.tm_mon], tm.tm_year+1900,
tm.tm_hour, tm.tm_min, tm.tm_sec, (int)(date.tv_usec/1000),
error_snapshot_id);
if (ci_putchk(si_ic(si), &trash) == -1) {
/* Socket buffer full. Let's try again later from the same point */
si_applet_cant_put(si);
return 0;
}
appctx->ctx.errors.px = proxies_list;
appctx->ctx.errors.bol = 0;
appctx->ctx.errors.ptr = -1;
}
/* we have two inner loops here, one for the proxy, the other one for
* the buffer.
*/
while (appctx->ctx.errors.px) {
struct error_snapshot *es;
if ((appctx->ctx.errors.flag & 1) == 0) {
es = &appctx->ctx.errors.px->invalid_req;
if (appctx->ctx.errors.flag & 2) // skip req
goto next;
}
else {
es = &appctx->ctx.errors.px->invalid_rep;
if (appctx->ctx.errors.flag & 4) // skip resp
goto next;
}
if (!es->when.tv_sec)
goto next;
if (appctx->ctx.errors.iid >= 0 &&
appctx->ctx.errors.px->uuid != appctx->ctx.errors.iid &&
es->oe->uuid != appctx->ctx.errors.iid)
goto next;
if (appctx->ctx.errors.ptr < 0) {
/* just print headers now */
char pn[INET6_ADDRSTRLEN];
struct tm tm;
int port;
get_localtime(es->when.tv_sec, &tm);
chunk_appendf(&trash, " \n[%02d/%s/%04d:%02d:%02d:%02d.%03d]",
tm.tm_mday, monthname[tm.tm_mon], tm.tm_year+1900,
tm.tm_hour, tm.tm_min, tm.tm_sec, (int)(es->when.tv_usec/1000));
switch (addr_to_str(&es->src, pn, sizeof(pn))) {
case AF_INET:
case AF_INET6:
port = get_host_port(&es->src);
break;
default:
port = 0;
}
switch (appctx->ctx.errors.flag & 1) {
case 0:
chunk_appendf(&trash,
" frontend %s (#%d): invalid request\n"
" backend %s (#%d)",
appctx->ctx.errors.px->id, appctx->ctx.errors.px->uuid,
(es->oe->cap & PR_CAP_BE) ? es->oe->id : "<NONE>",
(es->oe->cap & PR_CAP_BE) ? es->oe->uuid : -1);
break;
case 1:
chunk_appendf(&trash,
" backend %s (#%d): invalid response\n"
" frontend %s (#%d)",
appctx->ctx.errors.px->id, appctx->ctx.errors.px->uuid,
es->oe->id, es->oe->uuid);
break;
}
chunk_appendf(&trash,
", server %s (#%d), event #%u\n"
" src %s:%d, session #%d, session flags 0x%08x\n"
" HTTP msg state %s(%d), msg flags 0x%08x, tx flags 0x%08x\n"
" HTTP chunk len %lld bytes, HTTP body len %lld bytes\n"
" buffer flags 0x%08x, out %d bytes, total %lld bytes\n"
" pending %d bytes, wrapping at %d, error at position %d:\n \n",
es->srv ? es->srv->id : "<NONE>", es->srv ? es->srv->puid : -1,
es->ev_id,
pn, port, es->sid, es->s_flags,
h1_msg_state_str(es->state), es->state, es->m_flags, es->t_flags,
es->m_clen, es->m_blen,
es->b_flags, es->b_out, es->b_tot,
es->len, es->b_wrap, es->pos);
if (ci_putchk(si_ic(si), &trash) == -1) {
/* Socket buffer full. Let's try again later from the same point */
si_applet_cant_put(si);
return 0;
}
appctx->ctx.errors.ptr = 0;
appctx->ctx.errors.sid = es->sid;
}
if (appctx->ctx.errors.sid != es->sid) {
/* the snapshot changed while we were dumping it */
chunk_appendf(&trash,
" WARNING! update detected on this snapshot, dump interrupted. Please re-check!\n");
if (ci_putchk(si_ic(si), &trash) == -1) {
si_applet_cant_put(si);
return 0;
}
goto next;
}
/* OK, ptr >= 0, so we have to dump the current line */
while (es->buf && appctx->ctx.errors.ptr < es->len && appctx->ctx.errors.ptr < global.tune.bufsize) {
int newptr;
int newline;
newline = appctx->ctx.errors.bol;
newptr = dump_text_line(&trash, es->buf, global.tune.bufsize, es->len, &newline, appctx->ctx.errors.ptr);
if (newptr == appctx->ctx.errors.ptr)
return 0;
if (ci_putchk(si_ic(si), &trash) == -1) {
/* Socket buffer full. Let's try again later from the same point */
si_applet_cant_put(si);
return 0;
}
appctx->ctx.errors.ptr = newptr;
appctx->ctx.errors.bol = newline;
};
next:
appctx->ctx.errors.bol = 0;
appctx->ctx.errors.ptr = -1;
appctx->ctx.errors.flag ^= 1;
if (!(appctx->ctx.errors.flag & 1))
appctx->ctx.errors.px = appctx->ctx.errors.px->next;
}
/* dump complete */
return 1;
}
| 11,861
|
77,072
| 0
|
parse_SET_IP_TTL(char *arg, struct ofpbuf *ofpacts,
enum ofputil_protocol *usable_protocols OVS_UNUSED)
{
uint8_t ttl;
char *error;
error = str_to_u8(arg, "TTL", &ttl);
if (error) {
return error;
}
ofpact_put_SET_IP_TTL(ofpacts)->ttl = ttl;
return NULL;
}
| 11,862
|
114,303
| 0
|
void WebGraphicsContext3DCommandBufferImpl::deleteShader(WebGLId shader) {
gl_->DeleteShader(shader);
}
| 11,863
|
102,209
| 0
|
SyncAPIServerConnectionManager* connection_manager() {
return connection_manager_.get();
}
| 11,864
|
126,550
| 0
|
gboolean TabStripGtk::OnDragDataReceived(GtkWidget* widget,
GdkDragContext* context,
gint x, gint y,
GtkSelectionData* data,
guint info, guint time) {
bool success = false;
if (info == ui::TEXT_URI_LIST ||
info == ui::NETSCAPE_URL ||
info == ui::TEXT_PLAIN) {
success = CompleteDrop(gtk_selection_data_get_data(data),
info == ui::TEXT_PLAIN);
}
gtk_drag_finish(context, success, FALSE, time);
return TRUE;
}
| 11,865
|
92,946
| 0
|
mcs_out_domain_params(STREAM s, int max_channels, int max_users, int max_tokens, int max_pdusize)
{
ber_out_header(s, MCS_TAG_DOMAIN_PARAMS, 32);
ber_out_integer(s, max_channels);
ber_out_integer(s, max_users);
ber_out_integer(s, max_tokens);
ber_out_integer(s, 1); /* num_priorities */
ber_out_integer(s, 0); /* min_throughput */
ber_out_integer(s, 1); /* max_height */
ber_out_integer(s, max_pdusize);
ber_out_integer(s, 2); /* ver_protocol */
}
| 11,866
|
11,273
| 0
|
static void write_guest_rom_state(VAPICROMState *s)
{
cpu_physical_memory_write(s->rom_state_paddr, &s->rom_state,
sizeof(GuestROMState));
}
| 11,867
|
144,108
| 0
|
png_set_flush(png_structp png_ptr, int nrows)
{
png_debug(1, "in png_set_flush");
if (png_ptr == NULL)
return;
png_ptr->flush_dist = (nrows < 0 ? 0 : nrows);
}
| 11,868
|
21,244
| 0
|
static int insert_page(struct vm_area_struct *vma, unsigned long addr,
struct page *page, pgprot_t prot)
{
struct mm_struct *mm = vma->vm_mm;
int retval;
pte_t *pte;
spinlock_t *ptl;
retval = -EINVAL;
if (PageAnon(page))
goto out;
retval = -ENOMEM;
flush_dcache_page(page);
pte = get_locked_pte(mm, addr, &ptl);
if (!pte)
goto out;
retval = -EBUSY;
if (!pte_none(*pte))
goto out_unlock;
/* Ok, finally just insert the thing.. */
get_page(page);
inc_mm_counter_fast(mm, MM_FILEPAGES);
page_add_file_rmap(page);
set_pte_at(mm, addr, pte, mk_pte(page, prot));
retval = 0;
pte_unmap_unlock(pte, ptl);
return retval;
out_unlock:
pte_unmap_unlock(pte, ptl);
out:
return retval;
}
| 11,869
|
180,612
| 1
|
void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
unsigned long end, unsigned long vmflag)
{
unsigned long addr;
/* do a global flush by default */
unsigned long base_pages_to_flush = TLB_FLUSH_ALL;
preempt_disable();
if (current->active_mm != mm)
goto out;
if (!current->mm) {
leave_mm(smp_processor_id());
goto out;
}
if ((end != TLB_FLUSH_ALL) && !(vmflag & VM_HUGETLB))
base_pages_to_flush = (end - start) >> PAGE_SHIFT;
if (base_pages_to_flush > tlb_single_page_flush_ceiling) {
base_pages_to_flush = TLB_FLUSH_ALL;
count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
local_flush_tlb();
} else {
/* flush range by one by one 'invlpg' */
for (addr = start; addr < end; addr += PAGE_SIZE) {
count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ONE);
__flush_tlb_single(addr);
}
}
trace_tlb_flush(TLB_LOCAL_MM_SHOOTDOWN, base_pages_to_flush);
out:
if (base_pages_to_flush == TLB_FLUSH_ALL) {
start = 0UL;
end = TLB_FLUSH_ALL;
}
if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
flush_tlb_others(mm_cpumask(mm), mm, start, end);
preempt_enable();
}
| 11,870
|
176,584
| 0
|
xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg)
{
if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
(ctxt->instate == XML_PARSER_EOF))
return;
if (ctxt != NULL)
ctxt->errNo = error;
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
XML_ERR_FATAL, NULL, 0, NULL, NULL, NULL, 0, 0, "%s", msg);
if (ctxt != NULL) {
ctxt->wellFormed = 0;
if (ctxt->recovery == 0)
ctxt->disableSAX = 1;
}
}
| 11,871
|
53,868
| 0
|
acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units)
{
struct semaphore *sem = (struct semaphore *)handle;
if (!acpi_os_initialized)
return AE_OK;
if (!sem || (units < 1))
return AE_BAD_PARAMETER;
if (units > 1)
return AE_SUPPORT;
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Signaling semaphore[%p|%d]\n", handle,
units));
up(sem);
return AE_OK;
}
| 11,872
|
172,578
| 0
|
static size_t GetCPUCoreCount() {
long cpuCoreCount = 1;
#if defined(_SC_NPROCESSORS_ONLN)
cpuCoreCount = sysconf(_SC_NPROCESSORS_ONLN);
#else
cpuCoreCount = sysconf(_SC_NPROC_ONLN);
#endif
CHECK(cpuCoreCount >= 1);
ALOGV("Number of CPU cores: %ld", cpuCoreCount);
return (size_t)cpuCoreCount;
}
| 11,873
|
78,375
| 0
|
des3_encrypt_cbc(const unsigned char *key, int keysize, unsigned char iv[EVP_MAX_IV_LENGTH],
const unsigned char *input, size_t length, unsigned char *output)
{
unsigned char bKey[24] = { 0 };
if (keysize == 16) {
memcpy(&bKey[0], key, 16);
memcpy(&bKey[16], key, 8);
}
else {
memcpy(&bKey[0], key, 24);
}
return openssl_enc(EVP_des_ede3_cbc(), bKey, iv, input, length, output);
}
| 11,874
|
24,728
| 0
|
unsigned long usecs_to_jiffies(const unsigned int u)
{
if (u > jiffies_to_usecs(MAX_JIFFY_OFFSET))
return MAX_JIFFY_OFFSET;
#if HZ <= USEC_PER_SEC && !(USEC_PER_SEC % HZ)
return (u + (USEC_PER_SEC / HZ) - 1) / (USEC_PER_SEC / HZ);
#elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC)
return u * (HZ / USEC_PER_SEC);
#else
return ((u64)USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32)
>> USEC_TO_HZ_SHR32;
#endif
}
| 11,875
|
45,072
| 0
|
static int lua_ap_regex(lua_State *L)
{
request_rec *r;
int i,
rv,
flags;
const char *pattern,
*source;
char *err;
ap_regex_t regex;
ap_regmatch_t matches[MODLUA_MAX_REG_MATCH+1];
luaL_checktype(L, 1, LUA_TUSERDATA);
luaL_checktype(L, 2, LUA_TSTRING);
luaL_checktype(L, 3, LUA_TSTRING);
r = ap_lua_check_request_rec(L, 1);
source = lua_tostring(L, 2);
pattern = lua_tostring(L, 3);
flags = luaL_optinteger(L, 4, 0);
rv = ap_regcomp(®ex, pattern, flags);
if (rv) {
lua_pushboolean(L, 0);
err = apr_palloc(r->pool, 256);
ap_regerror(rv, ®ex, err, 256);
lua_pushstring(L, err);
return 2;
}
if (regex.re_nsub > MODLUA_MAX_REG_MATCH) {
lua_pushboolean(L, 0);
err = apr_palloc(r->pool, 64);
apr_snprintf(err, 64,
"regcomp found %d matches; only %d allowed.",
regex.re_nsub, MODLUA_MAX_REG_MATCH);
lua_pushstring(L, err);
return 2;
}
rv = ap_regexec(®ex, source, MODLUA_MAX_REG_MATCH, matches, 0);
if (rv == AP_REG_NOMATCH) {
lua_pushboolean(L, 0);
return 1;
}
lua_newtable(L);
for (i = 0; i <= regex.re_nsub; i++) {
lua_pushinteger(L, i);
if (matches[i].rm_so >= 0 && matches[i].rm_eo >= 0)
lua_pushstring(L,
apr_pstrndup(r->pool, source + matches[i].rm_so,
matches[i].rm_eo - matches[i].rm_so));
else
lua_pushnil(L);
lua_settable(L, -3);
}
return 1;
}
| 11,876
|
143,700
| 0
|
bool RenderWidgetHostImpl::ScheduleComposite() {
if (is_hidden_ || current_size_.IsEmpty() || repaint_ack_pending_ ||
resize_ack_pending_) {
return false;
}
repaint_start_time_ = TimeTicks::Now();
repaint_ack_pending_ = true;
TRACE_EVENT_ASYNC_BEGIN0(
"renderer_host", "RenderWidgetHostImpl::repaint_ack_pending_", this);
Send(new ViewMsg_Repaint(routing_id_, current_size_));
return true;
}
| 11,877
|
140,206
| 0
|
GaiaCookieManagerService::ExternalCcResultFetcher::~ExternalCcResultFetcher() {
CleanupTransientState();
}
| 11,878
|
187,055
| 1
|
void ImageBitmapFactories::ImageBitmapLoader::Trace(blink::Visitor* visitor) {
visitor->Trace(factory_);
visitor->Trace(resolver_);
visitor->Trace(options_);
}
| 11,879
|
188,108
| 1
|
void impeg2d_dec_hdr(void *pv_dec,impeg2d_video_decode_ip_t *ps_ip,
impeg2d_video_decode_op_t *ps_op)
{
UWORD32 u4_bits_read;
dec_state_t *ps_dec;
UWORD32 u4_size = ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes;
ps_dec = (dec_state_t *)pv_dec;
ps_op->s_ivd_video_decode_op_t.u4_error_code = 0;
if (u4_size > MAX_BITSTREAM_BUFFER_SIZE)
{
u4_size = MAX_BITSTREAM_BUFFER_SIZE;
}
memcpy(ps_dec->pu1_input_buffer, ps_ip->s_ivd_video_decode_ip_t.pv_stream_buffer, u4_size);
impeg2d_bit_stream_init(&(ps_dec->s_bit_stream), ps_dec->pu1_input_buffer,
u4_size);
{
{
IMPEG2D_ERROR_CODES_T e_error;
e_error = impeg2d_process_video_header(ps_dec);
if ((IMPEG2D_ERROR_CODES_T)IVD_ERROR_NONE != e_error)
{
ps_op->s_ivd_video_decode_op_t.u4_error_code = e_error;
u4_bits_read = impeg2d_bit_stream_num_bits_read(&ps_dec->s_bit_stream);
ps_op->s_ivd_video_decode_op_t.u4_num_bytes_consumed = u4_bits_read>> 3;
if(ps_op->s_ivd_video_decode_op_t.u4_num_bytes_consumed > ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes)
{
ps_op->s_ivd_video_decode_op_t.u4_num_bytes_consumed = ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes;
}
if(ps_op->s_ivd_video_decode_op_t.u4_error_code == 0)
ps_op->s_ivd_video_decode_op_t.u4_error_code = e_error;
if (IMPEG2D_UNSUPPORTED_DIMENSIONS == e_error)
{
ps_op->s_ivd_video_decode_op_t.u4_num_bytes_consumed = 0;
ps_dec->u2_header_done = 0;
ps_op->s_ivd_video_decode_op_t.u4_pic_ht = ps_dec->u2_reinit_max_height;
ps_op->s_ivd_video_decode_op_t.u4_pic_wd = ps_dec->u2_reinit_max_width;
}
impeg2d_next_code(ps_dec, SEQUENCE_HEADER_CODE);
return;
}
}
ps_op->s_ivd_video_decode_op_t.u4_pic_ht = ps_dec->u2_vertical_size;
ps_op->s_ivd_video_decode_op_t.u4_pic_wd = ps_dec->u2_horizontal_size;
ps_op->s_ivd_video_decode_op_t.e_pic_type = IV_NA_FRAME;
ps_op->s_ivd_video_decode_op_t.u4_error_code = IV_SUCCESS;
u4_bits_read = impeg2d_bit_stream_num_bits_read(&ps_dec->s_bit_stream);
ps_op->s_ivd_video_decode_op_t.u4_num_bytes_consumed = u4_bits_read>> 3;
if(ps_op->s_ivd_video_decode_op_t.u4_num_bytes_consumed > ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes)
{
ps_op->s_ivd_video_decode_op_t.u4_num_bytes_consumed = ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes;
}
ps_op->s_ivd_video_decode_op_t.u4_frame_decoded_flag = 0;
/* MOD */
ps_dec->u2_header_done = 1;
}
}
| 11,880
|
171,382
| 0
|
status_t OMXCodec::stop() {
CODEC_LOGV("stop mState=%d", mState);
Mutex::Autolock autoLock(mLock);
status_t err = stopOmxComponent_l();
mSource->stop();
CODEC_LOGV("stopped in state %d", mState);
return err;
}
| 11,881
|
169,656
| 0
|
AssertForegroundHelper() : weak_ptr_factory_(this) {}
| 11,882
|
152,454
| 0
|
void RenderFrameImpl::OnSetOverlayRoutingToken(
const base::UnguessableToken& token) {
overlay_routing_token_ = token;
for (const auto& cb : pending_routing_token_callbacks_)
cb.Run(overlay_routing_token_.value());
pending_routing_token_callbacks_.clear();
}
| 11,883
|
109,303
| 0
|
void InspectorPageAgent::getResourceTree(ErrorString*, RefPtr<TypeBuilder::Page::FrameResourceTree>& object)
{
object = buildObjectForFrameTree(m_page->mainFrame());
}
| 11,884
|
183,618
| 1
|
WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
PrefService* prefs, bool is_dom_ui) {
WebPreferences web_prefs;
web_prefs.fixed_font_family =
prefs->GetString(prefs::kWebKitFixedFontFamily);
web_prefs.serif_font_family =
prefs->GetString(prefs::kWebKitSerifFontFamily);
web_prefs.sans_serif_font_family =
prefs->GetString(prefs::kWebKitSansSerifFontFamily);
if (prefs->GetBoolean(prefs::kWebKitStandardFontIsSerif))
web_prefs.standard_font_family = web_prefs.serif_font_family;
else
web_prefs.standard_font_family = web_prefs.sans_serif_font_family;
web_prefs.cursive_font_family =
prefs->GetString(prefs::kWebKitCursiveFontFamily);
web_prefs.fantasy_font_family =
prefs->GetString(prefs::kWebKitFantasyFontFamily);
web_prefs.default_font_size =
prefs->GetInteger(prefs::kWebKitDefaultFontSize);
web_prefs.default_fixed_font_size =
prefs->GetInteger(prefs::kWebKitDefaultFixedFontSize);
web_prefs.minimum_font_size =
prefs->GetInteger(prefs::kWebKitMinimumFontSize);
web_prefs.minimum_logical_font_size =
prefs->GetInteger(prefs::kWebKitMinimumLogicalFontSize);
web_prefs.default_encoding =
WideToASCII(prefs->GetString(prefs::kDefaultCharset));
web_prefs.javascript_can_open_windows_automatically =
prefs->GetBoolean(prefs::kWebKitJavascriptCanOpenWindowsAutomatically);
web_prefs.dom_paste_enabled =
prefs->GetBoolean(prefs::kWebKitDomPasteEnabled);
web_prefs.shrinks_standalone_images_to_fit =
prefs->GetBoolean(prefs::kWebKitShrinksStandaloneImagesToFit);
web_prefs.inspector_settings = WideToUTF8(
prefs->GetString(prefs::kWebKitInspectorSettings));
{ // Command line switches are used for preferences with no user interface.
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
web_prefs.developer_extras_enabled =
!command_line.HasSwitch(switches::kDisableDevTools);
web_prefs.javascript_enabled =
!command_line.HasSwitch(switches::kDisableJavaScript) &&
prefs->GetBoolean(prefs::kWebKitJavascriptEnabled);
web_prefs.web_security_enabled =
!command_line.HasSwitch(switches::kDisableWebSecurity) &&
prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled);
web_prefs.plugins_enabled =
!command_line.HasSwitch(switches::kDisablePlugins) &&
prefs->GetBoolean(prefs::kWebKitPluginsEnabled);
web_prefs.java_enabled =
!command_line.HasSwitch(switches::kDisableJava) &&
prefs->GetBoolean(prefs::kWebKitJavaEnabled);
web_prefs.loads_images_automatically =
!command_line.HasSwitch(switches::kDisableImages) &&
prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically);
web_prefs.uses_page_cache =
command_line.HasSwitch(switches::kEnableFastback);
web_prefs.remote_fonts_enabled =
command_line.HasSwitch(switches::kEnableRemoteFonts);
web_prefs.xss_auditor_enabled =
!command_line.HasSwitch(switches::kDisableXSSAuditor);
web_prefs.application_cache_enabled =
command_line.HasSwitch(switches::kEnableApplicationCache);
web_prefs.local_storage_enabled =
command_line.HasSwitch(switches::kEnableLocalStorage);
web_prefs.databases_enabled =
command_line.HasSwitch(switches::kEnableDatabases);
web_prefs.session_storage_enabled =
command_line.HasSwitch(switches::kEnableSessionStorage);
web_prefs.experimental_webgl_enabled =
command_line.HasSwitch(switches::kEnableExperimentalWebGL);
web_prefs.experimental_notifications_enabled =
command_line.HasSwitch(switches::kEnableDesktopNotifications);
}
web_prefs.uses_universal_detector =
prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector);
web_prefs.text_areas_are_resizable =
prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable);
// User CSS is currently disabled because it crashes chrome. See
// webkit/glue/webpreferences.h for more details.
// Make sure we will set the default_encoding with canonical encoding name.
web_prefs.default_encoding =
CharacterEncoding::GetCanonicalEncodingNameByAliasName(
web_prefs.default_encoding);
if (web_prefs.default_encoding.empty()) {
prefs->ClearPref(prefs::kDefaultCharset);
web_prefs.default_encoding = WideToASCII(
prefs->GetString(prefs::kDefaultCharset));
}
DCHECK(!web_prefs.default_encoding.empty());
if (is_dom_ui) {
web_prefs.loads_images_automatically = true;
web_prefs.javascript_enabled = true;
}
return web_prefs;
}
| 11,885
|
123,424
| 0
|
ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
: profile_(profile),
next_download_id_(0),
download_prefs_(new DownloadPrefs(profile)) {
}
| 11,886
|
151,094
| 0
|
void DevToolsWindow::OpenDevToolsWindowForWorker(
Profile* profile,
const scoped_refptr<DevToolsAgentHost>& worker_agent) {
DevToolsWindow* window = FindDevToolsWindow(worker_agent.get());
if (!window) {
window = DevToolsWindow::CreateDevToolsWindowForWorker(profile);
if (!window)
return;
window->bindings_->AttachTo(worker_agent);
}
window->ScheduleShow(DevToolsToggleAction::Show());
}
| 11,887
|
48,311
| 0
|
TIFFInitPixarLog(TIFF* tif, int scheme)
{
static const char module[] = "TIFFInitPixarLog";
PixarLogState* sp;
assert(scheme == COMPRESSION_PIXARLOG);
/*
* Merge codec-specific tag information.
*/
if (!_TIFFMergeFields(tif, pixarlogFields,
TIFFArrayCount(pixarlogFields))) {
TIFFErrorExt(tif->tif_clientdata, module,
"Merging PixarLog codec-specific tags failed");
return 0;
}
/*
* Allocate state block so tag methods have storage to record values.
*/
tif->tif_data = (uint8*) _TIFFmalloc(sizeof (PixarLogState));
if (tif->tif_data == NULL)
goto bad;
sp = (PixarLogState*) tif->tif_data;
_TIFFmemset(sp, 0, sizeof (*sp));
sp->stream.data_type = Z_BINARY;
sp->user_datafmt = PIXARLOGDATAFMT_UNKNOWN;
/*
* Install codec methods.
*/
tif->tif_fixuptags = PixarLogFixupTags;
tif->tif_setupdecode = PixarLogSetupDecode;
tif->tif_predecode = PixarLogPreDecode;
tif->tif_decoderow = PixarLogDecode;
tif->tif_decodestrip = PixarLogDecode;
tif->tif_decodetile = PixarLogDecode;
tif->tif_setupencode = PixarLogSetupEncode;
tif->tif_preencode = PixarLogPreEncode;
tif->tif_postencode = PixarLogPostEncode;
tif->tif_encoderow = PixarLogEncode;
tif->tif_encodestrip = PixarLogEncode;
tif->tif_encodetile = PixarLogEncode;
tif->tif_close = PixarLogClose;
tif->tif_cleanup = PixarLogCleanup;
/* Override SetField so we can handle our private pseudo-tag */
sp->vgetparent = tif->tif_tagmethods.vgetfield;
tif->tif_tagmethods.vgetfield = PixarLogVGetField; /* hook for codec tags */
sp->vsetparent = tif->tif_tagmethods.vsetfield;
tif->tif_tagmethods.vsetfield = PixarLogVSetField; /* hook for codec tags */
/* Default values for codec-specific fields */
sp->quality = Z_DEFAULT_COMPRESSION; /* default comp. level */
sp->state = 0;
/* we don't wish to use the predictor,
* the default is none, which predictor value 1
*/
(void) TIFFPredictorInit(tif);
/*
* build the companding tables
*/
PixarLogMakeTables(sp);
return (1);
bad:
TIFFErrorExt(tif->tif_clientdata, module,
"No space for PixarLog state block");
return (0);
}
| 11,888
|
151,231
| 0
|
DEFINE_TRACE(InspectorPageAgent) {
visitor->Trace(inspected_frames_);
visitor->Trace(inspector_resource_content_loader_);
InspectorBaseAgent::Trace(visitor);
}
| 11,889
|
106,946
| 0
|
QQuickWebView::QQuickWebView(QQuickItem* parent)
: QQuickItem(parent)
, d_ptr(createPrivateObject(this))
, m_experimental(new QQuickWebViewExperimental(this))
{
Q_D(QQuickWebView);
d->initialize();
}
| 11,890
|
156,603
| 0
|
~FactoryImpl() {}
| 11,891
|
31,165
| 0
|
fbmem_init(void)
{
proc_create("fb", 0, NULL, &fb_proc_fops);
if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
printk("unable to get major %d for fb devs\n", FB_MAJOR);
fb_class = class_create(THIS_MODULE, "graphics");
if (IS_ERR(fb_class)) {
printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class));
fb_class = NULL;
}
return 0;
}
| 11,892
|
161,396
| 0
|
SecurityHandler::SecurityHandler()
: DevToolsDomainHandler(Security::Metainfo::domainName),
enabled_(false),
host_(nullptr) {
}
| 11,893
|
164,776
| 0
|
bool BitReaderCore::SkipBits(int num_bits) {
DCHECK_GE(num_bits, 0);
const int remaining_bits = nbits_ + nbits_next_;
if (remaining_bits >= num_bits)
return SkipBitsSmall(num_bits);
num_bits -= remaining_bits;
bits_read_ += remaining_bits;
nbits_ = 0;
reg_ = 0;
nbits_next_ = 0;
reg_next_ = 0;
const int nbytes = num_bits / 8;
if (nbytes > 0) {
const uint8_t* byte_stream_window;
const int window_size =
byte_stream_provider_->GetBytes(nbytes, &byte_stream_window);
DCHECK_GE(window_size, 0);
DCHECK_LE(window_size, nbytes);
if (window_size < nbytes) {
bits_read_ += 8 * window_size;
return false;
}
num_bits -= 8 * nbytes;
bits_read_ += 8 * nbytes;
}
return SkipBitsSmall(num_bits);
}
| 11,894
|
109,496
| 0
|
void ComputeWebKitPrintParamsInDesiredDpi(
const PrintMsg_Print_Params& print_params,
WebKit::WebPrintParams* webkit_print_params) {
int dpi = GetDPI(&print_params);
webkit_print_params->printerDPI = dpi;
webkit_print_params->printScalingOption = print_params.print_scaling_option;
using printing::ConvertUnit;
webkit_print_params->printContentArea.width =
ConvertUnit(print_params.content_size.width(), dpi,
print_params.desired_dpi);
webkit_print_params->printContentArea.height =
ConvertUnit(print_params.content_size.height(), dpi,
print_params.desired_dpi);
webkit_print_params->printableArea.x =
ConvertUnit(print_params.printable_area.x(), dpi,
print_params.desired_dpi);
webkit_print_params->printableArea.y =
ConvertUnit(print_params.printable_area.y(), dpi,
print_params.desired_dpi);
webkit_print_params->printableArea.width =
ConvertUnit(print_params.printable_area.width(), dpi,
print_params.desired_dpi);
webkit_print_params->printableArea.height =
ConvertUnit(print_params.printable_area.height(),
dpi, print_params.desired_dpi);
webkit_print_params->paperSize.width =
ConvertUnit(print_params.page_size.width(), dpi,
print_params.desired_dpi);
webkit_print_params->paperSize.height =
ConvertUnit(print_params.page_size.height(), dpi,
print_params.desired_dpi);
}
| 11,895
|
18,415
| 0
|
static int ape_read_close(AVFormatContext * s)
{
APEContext *ape = s->priv_data;
av_freep(&ape->frames);
av_freep(&ape->seektable);
return 0;
}
| 11,896
|
179,457
| 1
|
mountpoint_last(struct nameidata *nd, struct path *path)
{
int error = 0;
struct dentry *dentry;
struct dentry *dir = nd->path.dentry;
/* If we're in rcuwalk, drop out of it to handle last component */
if (nd->flags & LOOKUP_RCU) {
if (unlazy_walk(nd, NULL)) {
error = -ECHILD;
goto out;
}
}
nd->flags &= ~LOOKUP_PARENT;
if (unlikely(nd->last_type != LAST_NORM)) {
error = handle_dots(nd, nd->last_type);
if (error)
goto out;
dentry = dget(nd->path.dentry);
goto done;
}
mutex_lock(&dir->d_inode->i_mutex);
dentry = d_lookup(dir, &nd->last);
if (!dentry) {
/*
* No cached dentry. Mounted dentries are pinned in the cache,
* so that means that this dentry is probably a symlink or the
* path doesn't actually point to a mounted dentry.
*/
dentry = d_alloc(dir, &nd->last);
if (!dentry) {
error = -ENOMEM;
mutex_unlock(&dir->d_inode->i_mutex);
goto out;
}
dentry = lookup_real(dir->d_inode, dentry, nd->flags);
error = PTR_ERR(dentry);
if (IS_ERR(dentry)) {
mutex_unlock(&dir->d_inode->i_mutex);
goto out;
}
}
mutex_unlock(&dir->d_inode->i_mutex);
done:
if (!dentry->d_inode || d_is_negative(dentry)) {
error = -ENOENT;
dput(dentry);
goto out;
}
path->dentry = dentry;
path->mnt = mntget(nd->path.mnt);
if (should_follow_link(dentry, nd->flags & LOOKUP_FOLLOW))
return 1;
follow_mount(path);
error = 0;
out:
terminate_walk(nd);
return error;
}
| 11,897
|
171,553
| 0
|
String8::String8(const char32_t* o, size_t len)
: mString(allocFromUTF32(o, len))
{
}
| 11,898
|
99,954
| 0
|
void PluginInstance::NPP_StreamAsFile(NPStream *stream, const char *fname) {
DCHECK(npp_functions_ != 0);
DCHECK(npp_functions_->asfile != 0);
if (npp_functions_->asfile != 0) {
npp_functions_->asfile(npp_, stream, fname);
}
FilePath file_name = FilePath::FromWStringHack(UTF8ToWide(fname));
files_created_.push_back(file_name);
}
| 11,899
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.