unique_id
int64 13
189k
| target
int64 0
1
| code
stringlengths 20
241k
| __index_level_0__
int64 0
18.9k
|
---|---|---|---|
45,085 | 0 | static int lua_ap_started(request_rec* r)
{
return (int)(ap_scoreboard_image->global->restart_time / 1000000);
}
| 17,800 |
64,162 | 0 | grub_ext2_read_symlink (grub_fshelp_node_t node)
{
char *symlink;
struct grub_fshelp_node *diro = node;
if (! diro->inode_read)
{
grub_ext2_read_inode (diro->data, diro->ino, &diro->inode);
if (grub_errno)
return 0;
}
symlink = grub_malloc (grub_le_to_cpu32 (diro->inode.size) + 1);
if (! symlink)
return 0;
/* If the filesize of the symlink is bigger than
60 the symlink is stored in a separate block,
otherwise it is stored in the inode. */
if (grub_le_to_cpu32 (diro->inode.size) <= 60)
grub_strncpy (symlink,
diro->inode.symlink,
grub_le_to_cpu32 (diro->inode.size));
else
{
grub_ext2_read_file (diro, 0, 0, 0, 0,
grub_le_to_cpu32 (diro->inode.size),
symlink);
if (grub_errno)
{
grub_free (symlink);
return 0;
}
}
symlink[grub_le_to_cpu32 (diro->inode.size)] = '\0';
return symlink;
}
| 17,801 |
60,973 | 0 | nautilus_directory_monitor_remove_internal (NautilusDirectory *directory,
NautilusFile *file,
gconstpointer client)
{
g_assert (NAUTILUS_IS_DIRECTORY (directory));
g_assert (file == NULL || NAUTILUS_IS_FILE (file));
g_assert (client != NULL);
remove_monitor (directory, file, client);
if (directory->details->monitor != NULL
&& directory->details->monitor_list == NULL)
{
nautilus_monitor_cancel (directory->details->monitor);
directory->details->monitor = NULL;
}
/* XXX - do we need to remove anything from the work queue? */
nautilus_directory_async_state_changed (directory);
}
| 17,802 |
93,507 | 0 | __acquires(mrt_lock)
{
struct ipmr_vif_iter *iter = seq->private;
struct net *net = seq_file_net(seq);
struct mr6_table *mrt;
mrt = ip6mr_get_table(net, RT6_TABLE_DFLT);
if (!mrt)
return ERR_PTR(-ENOENT);
iter->mrt = mrt;
read_lock(&mrt_lock);
return *pos ? ip6mr_vif_seq_idx(net, seq->private, *pos - 1)
: SEQ_START_TOKEN;
}
| 17,803 |
119,491 | 0 | bool ScriptController::setContextDebugId(int debugId)
{
ASSERT(debugId > 0);
if (!m_windowShell->isContextInitialized())
return false;
v8::HandleScope scope;
v8::Local<v8::Context> context = m_windowShell->context();
return V8PerContextDebugData::setContextDebugData(context, "page", debugId);
}
| 17,804 |
10,992 | 0 | void _xml_processingInstructionHandler(void *userData, const XML_Char *target, const XML_Char *data)
{
xml_parser *parser = (xml_parser *)userData;
if (parser && parser->processingInstructionHandler) {
zval *retval, *args[3];
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(target, 0, parser->target_encoding);
args[2] = _xml_xmlchar_zval(data, 0, parser->target_encoding);
if ((retval = xml_call_handler(parser, parser->processingInstructionHandler, parser->processingInstructionPtr, 3, args))) {
zval_ptr_dtor(&retval);
}
}
}
| 17,805 |
71,733 | 0 | static int SVGIsStandalone(void *context)
{
SVGInfo
*svg_info;
/*
Is this document tagged standalone?
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.SVGIsStandalone()");
svg_info=(SVGInfo *) context;
return(svg_info->document->standalone == 1);
}
| 17,806 |
152,207 | 0 | std::unique_ptr<DocumentState> BuildDocumentStateFromParams(
const CommonNavigationParams& common_params,
const CommitNavigationParams& commit_params,
base::TimeTicks time_commit_requested,
mojom::FrameNavigationControl::CommitNavigationCallback commit_callback,
mojom::NavigationClient::CommitNavigationCallback
per_navigation_mojo_interface_commit_callback,
const network::ResourceResponseHead* head,
std::unique_ptr<NavigationClient> navigation_client,
int request_id,
bool was_initiated_in_this_frame) {
std::unique_ptr<DocumentState> document_state(new DocumentState());
InternalDocumentStateData* internal_data =
InternalDocumentStateData::FromDocumentState(document_state.get());
DCHECK(!common_params.navigation_start.is_null());
DCHECK(!common_params.url.SchemeIs(url::kJavaScriptScheme));
if (common_params.navigation_type == FrameMsg_Navigate_Type::RESTORE) {
internal_data->set_cache_policy_override(
blink::mojom::FetchCacheMode::kDefault);
}
internal_data->set_is_overriding_user_agent(
commit_params.is_overriding_user_agent);
internal_data->set_must_reset_scroll_and_scale_state(
common_params.navigation_type ==
FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL);
internal_data->set_previews_state(common_params.previews_state);
internal_data->set_request_id(request_id);
document_state->set_can_load_local_resources(
commit_params.can_load_local_resources);
if (head) {
if (head->headers)
internal_data->set_http_status_code(head->headers->response_code());
else if (common_params.url.SchemeIs(url::kDataScheme))
internal_data->set_http_status_code(200);
document_state->set_was_fetched_via_spdy(head->was_fetched_via_spdy);
document_state->set_was_alpn_negotiated(head->was_alpn_negotiated);
document_state->set_alpn_negotiated_protocol(
head->alpn_negotiated_protocol);
document_state->set_was_alternate_protocol_available(
head->was_alternate_protocol_available);
document_state->set_connection_info(head->connection_info);
internal_data->set_effective_connection_type(
head->effective_connection_type);
}
bool load_data = !common_params.base_url_for_data_url.is_empty() &&
!common_params.history_url_for_data_url.is_empty() &&
common_params.url.SchemeIs(url::kDataScheme);
document_state->set_was_load_data_with_base_url_request(load_data);
if (load_data)
document_state->set_data_url(common_params.url);
InternalDocumentStateData::FromDocumentState(document_state.get())
->set_navigation_state(NavigationState::CreateBrowserInitiated(
common_params, commit_params, time_commit_requested,
std::move(commit_callback),
std::move(per_navigation_mojo_interface_commit_callback),
std::move(navigation_client), was_initiated_in_this_frame));
return document_state;
}
| 17,807 |
82,038 | 0 | attr_reader(mrb_state *mrb, mrb_value obj)
{
mrb_value name = mrb_proc_cfunc_env_get(mrb, 0);
return mrb_iv_get(mrb, obj, to_sym(mrb, name));
}
| 17,808 |
107,099 | 0 | void tst_QQuickWebView::init()
{
m_window.reset(new TestWindow(newWebView()));
}
| 17,809 |
89,643 | 0 | void mdiobus_free(struct mii_bus *bus)
{
/* For compatibility with error handling in drivers. */
if (bus->state == MDIOBUS_ALLOCATED) {
kfree(bus);
return;
}
BUG_ON(bus->state != MDIOBUS_UNREGISTERED);
bus->state = MDIOBUS_RELEASED;
put_device(&bus->dev);
}
| 17,810 |
123,289 | 0 | gfx::GLSurfaceHandle RenderWidgetHostViewGtk::GetCompositingSurface() {
if (compositing_surface_ == gfx::kNullPluginWindow) {
GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance();
gfx::NativeViewId view_id = GetNativeViewId();
if (!manager->GetPermanentXIDForId(&compositing_surface_, view_id)) {
DLOG(ERROR) << "Can't find XID for view id " << view_id;
}
}
return gfx::GLSurfaceHandle(compositing_surface_, true);
}
| 17,811 |
138,672 | 0 | void RenderFrameHostImpl::ExecuteJavaScriptInIsolatedWorld(
const base::string16& javascript,
const JavaScriptResultCallback& callback,
int world_id) {
if (world_id <= ISOLATED_WORLD_ID_GLOBAL ||
world_id > ISOLATED_WORLD_ID_MAX) {
NOTREACHED();
return;
}
int key = 0;
bool request_reply = false;
if (!callback.is_null()) {
request_reply = true;
key = g_next_javascript_callback_id++;
javascript_callbacks_.insert(std::make_pair(key, callback));
}
Send(new FrameMsg_JavaScriptExecuteRequestInIsolatedWorld(
routing_id_, javascript, key, request_reply, world_id));
}
| 17,812 |
29,918 | 0 | static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns)
{
/* Start with the same capabilities as init but useless for doing
* anything as the capabilities are bound to the new user namespace.
*/
cred->securebits = SECUREBITS_DEFAULT;
cred->cap_inheritable = CAP_EMPTY_SET;
cred->cap_permitted = CAP_FULL_SET;
cred->cap_effective = CAP_FULL_SET;
cred->cap_bset = CAP_FULL_SET;
#ifdef CONFIG_KEYS
key_put(cred->request_key_auth);
cred->request_key_auth = NULL;
#endif
/* tgcred will be cleared in our caller bc CLONE_THREAD won't be set */
cred->user_ns = user_ns;
}
| 17,813 |
43,870 | 0 | list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
{
char size[32];
char date[32];
char uids[16], gids[16];
const char *uname, *gname;
FILE *out = stdout;
const char *fmt;
time_t mtime;
static time_t now;
if (!now)
time(&now);
if (cpio->option_numeric_uid_gid) {
/* Format numeric uid/gid for display. */
strcpy(uids, cpio_i64toa(archive_entry_uid(entry)));
uname = uids;
strcpy(gids, cpio_i64toa(archive_entry_gid(entry)));
gname = gids;
} else {
/* Use uname if it's present, else lookup name from uid. */
uname = archive_entry_uname(entry);
if (uname == NULL)
uname = lookup_uname(cpio, (uid_t)archive_entry_uid(entry));
/* Use gname if it's present, else lookup name from gid. */
gname = archive_entry_gname(entry);
if (gname == NULL)
gname = lookup_gname(cpio, (uid_t)archive_entry_gid(entry));
}
/* Print device number or file size. */
if (archive_entry_filetype(entry) == AE_IFCHR
|| archive_entry_filetype(entry) == AE_IFBLK) {
snprintf(size, sizeof(size), "%lu,%lu",
(unsigned long)archive_entry_rdevmajor(entry),
(unsigned long)archive_entry_rdevminor(entry));
} else {
strcpy(size, cpio_i64toa(archive_entry_size(entry)));
}
/* Format the time using 'ls -l' conventions. */
mtime = archive_entry_mtime(entry);
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Windows' strftime function does not support %e format. */
if (mtime - now > 365*86400/2
|| mtime - now < -365*86400/2)
fmt = cpio->day_first ? "%d %b %Y" : "%b %d %Y";
else
fmt = cpio->day_first ? "%d %b %H:%M" : "%b %d %H:%M";
#else
if (mtime - now > 365*86400/2
|| mtime - now < -365*86400/2)
fmt = cpio->day_first ? "%e %b %Y" : "%b %e %Y";
else
fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
#endif
strftime(date, sizeof(date), fmt, localtime(&mtime));
fprintf(out, "%s%3d %-8s %-8s %8s %12s %s",
archive_entry_strmode(entry),
archive_entry_nlink(entry),
uname, gname, size, date,
archive_entry_pathname(entry));
/* Extra information for links. */
if (archive_entry_hardlink(entry)) /* Hard link */
fprintf(out, " link to %s", archive_entry_hardlink(entry));
else if (archive_entry_symlink(entry)) /* Symbolic link */
fprintf(out, " -> %s", archive_entry_symlink(entry));
fprintf(out, "\n");
}
| 17,814 |
114,785 | 0 | __docbDefaultSAXHandler(void) {
if (IS_MAIN_THREAD)
return (&docbDefaultSAXHandler);
else
return (&xmlGetGlobalState()->docbDefaultSAXHandler);
}
| 17,815 |
130,589 | 0 | static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectV8Internal::activityLoggedAttrSetter1AttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 17,816 |
88,616 | 0 | int mwifiex_set_secure_params(struct mwifiex_private *priv,
struct mwifiex_uap_bss_param *bss_config,
struct cfg80211_ap_settings *params) {
int i;
struct mwifiex_wep_key wep_key;
if (!params->privacy) {
bss_config->protocol = PROTOCOL_NO_SECURITY;
bss_config->key_mgmt = KEY_MGMT_NONE;
bss_config->wpa_cfg.length = 0;
priv->sec_info.wep_enabled = 0;
priv->sec_info.wpa_enabled = 0;
priv->sec_info.wpa2_enabled = 0;
return 0;
}
switch (params->auth_type) {
case NL80211_AUTHTYPE_OPEN_SYSTEM:
bss_config->auth_mode = WLAN_AUTH_OPEN;
break;
case NL80211_AUTHTYPE_SHARED_KEY:
bss_config->auth_mode = WLAN_AUTH_SHARED_KEY;
break;
case NL80211_AUTHTYPE_NETWORK_EAP:
bss_config->auth_mode = WLAN_AUTH_LEAP;
break;
default:
bss_config->auth_mode = MWIFIEX_AUTH_MODE_AUTO;
break;
}
bss_config->key_mgmt_operation |= KEY_MGMT_ON_HOST;
for (i = 0; i < params->crypto.n_akm_suites; i++) {
switch (params->crypto.akm_suites[i]) {
case WLAN_AKM_SUITE_8021X:
if (params->crypto.wpa_versions &
NL80211_WPA_VERSION_1) {
bss_config->protocol = PROTOCOL_WPA;
bss_config->key_mgmt = KEY_MGMT_EAP;
}
if (params->crypto.wpa_versions &
NL80211_WPA_VERSION_2) {
bss_config->protocol |= PROTOCOL_WPA2;
bss_config->key_mgmt = KEY_MGMT_EAP;
}
break;
case WLAN_AKM_SUITE_PSK:
if (params->crypto.wpa_versions &
NL80211_WPA_VERSION_1) {
bss_config->protocol = PROTOCOL_WPA;
bss_config->key_mgmt = KEY_MGMT_PSK;
}
if (params->crypto.wpa_versions &
NL80211_WPA_VERSION_2) {
bss_config->protocol |= PROTOCOL_WPA2;
bss_config->key_mgmt = KEY_MGMT_PSK;
}
break;
default:
break;
}
}
for (i = 0; i < params->crypto.n_ciphers_pairwise; i++) {
switch (params->crypto.ciphers_pairwise[i]) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
break;
case WLAN_CIPHER_SUITE_TKIP:
if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1)
bss_config->wpa_cfg.pairwise_cipher_wpa |=
CIPHER_TKIP;
if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2)
bss_config->wpa_cfg.pairwise_cipher_wpa2 |=
CIPHER_TKIP;
break;
case WLAN_CIPHER_SUITE_CCMP:
if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1)
bss_config->wpa_cfg.pairwise_cipher_wpa |=
CIPHER_AES_CCMP;
if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2)
bss_config->wpa_cfg.pairwise_cipher_wpa2 |=
CIPHER_AES_CCMP;
default:
break;
}
}
switch (params->crypto.cipher_group) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
if (priv->sec_info.wep_enabled) {
bss_config->protocol = PROTOCOL_STATIC_WEP;
bss_config->key_mgmt = KEY_MGMT_NONE;
bss_config->wpa_cfg.length = 0;
for (i = 0; i < NUM_WEP_KEYS; i++) {
wep_key = priv->wep_key[i];
bss_config->wep_cfg[i].key_index = i;
if (priv->wep_key_curr_index == i)
bss_config->wep_cfg[i].is_default = 1;
else
bss_config->wep_cfg[i].is_default = 0;
bss_config->wep_cfg[i].length =
wep_key.key_length;
memcpy(&bss_config->wep_cfg[i].key,
&wep_key.key_material,
wep_key.key_length);
}
}
break;
case WLAN_CIPHER_SUITE_TKIP:
bss_config->wpa_cfg.group_cipher = CIPHER_TKIP;
break;
case WLAN_CIPHER_SUITE_CCMP:
bss_config->wpa_cfg.group_cipher = CIPHER_AES_CCMP;
break;
default:
break;
}
return 0;
}
| 17,817 |
10,801 | 0 | static int tls12_find_nid(int id, tls12_lookup *table, size_t tlen)
{
size_t i;
for (i = 0; i < tlen; i++)
{
if ((table[i].id) == id)
return table[i].nid;
}
return NID_undef;
}
| 17,818 |
91,371 | 0 | static MagickBooleanType ReadPSDChannelZip(Image *image,const size_t channels,
const ssize_t type,const PSDCompressionType compression,
const size_t compact_size,ExceptionInfo *exception)
{
MagickBooleanType
status;
register unsigned char
*p;
size_t
count,
length,
packet_size,
row_size;
ssize_t
y;
unsigned char
*compact_pixels,
*pixels;
z_stream
stream;
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" layer data is ZIP compressed");
if ((MagickSizeType) compact_size > GetBlobSize(image))
ThrowBinaryException(CorruptImageError,"UnexpectedEndOfFile",
image->filename);
compact_pixels=(unsigned char *) AcquireQuantumMemory(compact_size,
sizeof(*compact_pixels));
if (compact_pixels == (unsigned char *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
packet_size=GetPSDPacketSize(image);
row_size=image->columns*packet_size;
count=image->rows*row_size;
pixels=(unsigned char *) AcquireQuantumMemory(count,sizeof(*pixels));
if (pixels == (unsigned char *) NULL)
{
compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels);
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
}
if (ReadBlob(image,compact_size,compact_pixels) != (ssize_t) compact_size)
{
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels);
ThrowBinaryException(CorruptImageError,"UnexpectedEndOfFile",
image->filename);
}
memset(&stream,0,sizeof(stream));
stream.data_type=Z_BINARY;
stream.next_in=(Bytef *)compact_pixels;
stream.avail_in=(uInt) compact_size;
stream.next_out=(Bytef *)pixels;
stream.avail_out=(uInt) count;
if (inflateInit(&stream) == Z_OK)
{
int
ret;
while (stream.avail_out > 0)
{
ret=inflate(&stream,Z_SYNC_FLUSH);
if ((ret != Z_OK) && (ret != Z_STREAM_END))
{
(void) inflateEnd(&stream);
compact_pixels=(unsigned char *) RelinquishMagickMemory(
compact_pixels);
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
return(MagickFalse);
}
if (ret == Z_STREAM_END)
break;
}
(void) inflateEnd(&stream);
}
if (compression == ZipWithPrediction)
{
p=pixels;
while (count > 0)
{
length=image->columns;
while (--length)
{
if (packet_size == 2)
{
p[2]+=p[0]+((p[1]+p[3]) >> 8);
p[3]+=p[1];
}
/*
else if (packet_size == 4)
{
TODO: Figure out what to do there.
}
*/
else
*(p+1)+=*p;
p+=packet_size;
}
p+=packet_size;
count-=row_size;
}
}
status=MagickTrue;
p=pixels;
for (y=0; y < (ssize_t) image->rows; y++)
{
status=ReadPSDChannelPixels(image,channels,y,type,p,exception);
if (status == MagickFalse)
break;
p+=row_size;
}
compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels);
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
return(status);
}
| 17,819 |
13,114 | 0 | static bool ahci_map_fis_address(AHCIDevice *ad)
{
AHCIPortRegs *pr = &ad->port_regs;
map_page(ad->hba->as, &ad->res_fis,
((uint64_t)pr->fis_addr_hi << 32) | pr->fis_addr, 256);
return ad->res_fis != NULL;
}
| 17,820 |
13,881 | 0 | pdf_copy_array(fz_context *ctx, pdf_obj *obj)
{
pdf_document *doc;
pdf_obj *arr;
int i;
int n;
RESOLVE(obj);
if (!OBJ_IS_ARRAY(obj))
fz_throw(ctx, FZ_ERROR_GENERIC, "not an array (%s)", pdf_objkindstr(obj));
doc = ARRAY(obj)->doc;
n = pdf_array_len(ctx, obj);
arr = pdf_new_array(ctx, doc, n);
for (i = 0; i < n; i++)
pdf_array_push(ctx, arr, pdf_array_get(ctx, obj, i));
return arr;
}
| 17,821 |
79,440 | 0 | static int mov_write_wfex_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
{
int ret;
int64_t pos = avio_tell(pb);
avio_wb32(pb, 0);
ffio_wfourcc(pb, "wfex");
if ((ret = ff_put_wav_header(s, pb, track->st->codecpar, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX)) < 0)
return ret;
return update_size(pb, pos);
}
| 17,822 |
112,623 | 0 | void Document::webkitWillEnterFullScreenForElement(Element* element)
{
if (!attached() || inPageCache())
return;
ASSERT(element);
if (!page())
return;
ASSERT(page()->settings()->fullScreenEnabled());
if (m_fullScreenRenderer)
m_fullScreenRenderer->unwrapRenderer();
m_fullScreenElement = element;
#if USE(NATIVE_FULLSCREEN_VIDEO)
if (element && element->isMediaElement())
return;
#endif
RenderObject* renderer = m_fullScreenElement->renderer();
bool shouldCreatePlaceholder = renderer && renderer->isBox();
if (shouldCreatePlaceholder) {
m_savedPlaceholderFrameRect = toRenderBox(renderer)->frameRect();
m_savedPlaceholderRenderStyle = RenderStyle::clone(renderer->style());
}
if (m_fullScreenElement != documentElement())
RenderFullScreen::wrapRenderer(renderer, renderer ? renderer->parent() : 0, this);
m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true);
recalcStyle(Force);
}
| 17,823 |
44,732 | 0 | int keyring_clear(struct key *keyring)
{
struct assoc_array_edit *edit;
int ret;
if (keyring->type != &key_type_keyring)
return -ENOTDIR;
down_write(&keyring->sem);
edit = assoc_array_clear(&keyring->keys, &keyring_assoc_array_ops);
if (IS_ERR(edit)) {
ret = PTR_ERR(edit);
} else {
if (edit)
assoc_array_apply_edit(edit);
key_payload_reserve(keyring, 0);
ret = 0;
}
up_write(&keyring->sem);
return ret;
}
| 17,824 |
55,962 | 0 | static int skcipher_all_sg_nents(struct skcipher_ctx *ctx)
{
struct skcipher_sg_list *sgl;
struct scatterlist *sg;
int nents = 0;
list_for_each_entry(sgl, &ctx->tsgl, list) {
sg = sgl->sg;
while (!sg->length)
sg++;
nents += sg_nents(sg);
}
return nents;
}
| 17,825 |
104,985 | 0 | void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorSpace)
{
if (paintingDisabled())
return;
if (m_data->context)
m_data->context->SetBrush(wxBrush(color));
}
| 17,826 |
153,344 | 0 | void Tab::OnMouseReleased(const ui::MouseEvent& event) {
controller_->OnMouseEventInTab(this, event);
if (controller_->EndDrag(END_DRAG_COMPLETE))
return;
if (event.IsMiddleMouseButton()) {
if (HitTestPoint(event.location())) {
controller_->CloseTab(this, CLOSE_TAB_FROM_MOUSE);
} else if (closing_) {
gfx::Point location_in_parent = event.location();
ConvertPointToTarget(this, parent(), &location_in_parent);
Tab* closest_tab = controller_->GetTabAt(location_in_parent);
if (closest_tab)
controller_->CloseTab(closest_tab, CLOSE_TAB_FROM_MOUSE);
}
} else if (event.IsOnlyLeftMouseButton() && !event.IsShiftDown() &&
!IsSelectionModifierDown(event)) {
controller_->SelectTab(this, event);
}
}
| 17,827 |
10,837 | 0 | int tls1_set_sigalgs_list(CERT *c, const char *str, int client)
{
sig_cb_st sig;
sig.sigalgcnt = 0;
if (!CONF_parse_list(str, ':', 1, sig_cb, &sig))
return 0;
if (c == NULL)
return 1;
return tls1_set_sigalgs(c, sig.sigalgs, sig.sigalgcnt, client);
}
| 17,828 |
181,881 | 1 | jas_matrix_t *jas_seq2d_create(int xstart, int ystart, int xend, int yend)
{
jas_matrix_t *matrix;
assert(xstart <= xend && ystart <= yend);
if (!(matrix = jas_matrix_create(yend - ystart, xend - xstart))) {
return 0;
}
matrix->xstart_ = xstart;
matrix->ystart_ = ystart;
matrix->xend_ = xend;
matrix->yend_ = yend;
return matrix;
}
| 17,829 |
47,782 | 0 | static inline unsigned int div32(unsigned int a, unsigned int b,
unsigned int *r)
{
if (b == 0) {
*r = 0;
return UINT_MAX;
}
*r = a % b;
return a / b;
}
| 17,830 |
15,180 | 0 | PHP_MINIT_FUNCTION(gd)
{
le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number);
le_gd_font = zend_register_list_destructors_ex(php_free_gd_font, NULL, "gd font", module_number);
#if HAVE_GD_FONTMUTEX && HAVE_LIBFREETYPE
gdFontCacheMutexSetup();
#endif
#if HAVE_LIBT1
T1_SetBitmapPad(8);
T1_InitLib(NO_LOGFILE | IGNORE_CONFIGFILE | IGNORE_FONTDATABASE);
T1_SetLogLevel(T1LOG_DEBUG);
le_ps_font = zend_register_list_destructors_ex(php_free_ps_font, NULL, "gd PS font", module_number);
le_ps_enc = zend_register_list_destructors_ex(php_free_ps_enc, NULL, "gd PS encoding", module_number);
#endif
REGISTER_INI_ENTRIES();
REGISTER_LONG_CONSTANT("IMG_GIF", 1, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_JPG", 2, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_JPEG", 2, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT);
#ifdef gdTiled
/* special colours for gd */
REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_COLOR_STYLED", gdStyled, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_COLOR_BRUSHED", gdBrushed, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_COLOR_STYLEDBRUSHED", gdStyledBrushed, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_COLOR_TRANSPARENT", gdTransparent, CONST_CS | CONST_PERSISTENT);
#endif
/* for imagefilledarc */
REGISTER_LONG_CONSTANT("IMG_ARC_ROUNDED", gdArc, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_ARC_PIE", gdPie, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_ARC_CHORD", gdChord, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_ARC_NOFILL", gdNoFill, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_ARC_EDGED", gdEdged, CONST_CS | CONST_PERSISTENT);
/* GD2 image format types */
#ifdef GD2_FMT_RAW
REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef GD2_FMT_COMPRESSED
REGISTER_LONG_CONSTANT("IMG_GD2_COMPRESSED", GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT);
#endif
#if HAVE_GD_BUNDLED
REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_ALPHABLEND", gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_NORMAL", gdEffectNormal, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_EFFECT_OVERLAY", gdEffectOverlay, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GD_BUNDLED", 1, CONST_CS | CONST_PERSISTENT);
#else
REGISTER_LONG_CONSTANT("GD_BUNDLED", 0, CONST_CS | CONST_PERSISTENT);
#endif
/* Section Filters */
REGISTER_LONG_CONSTANT("IMG_FILTER_NEGATE", IMAGE_FILTER_NEGATE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_GRAYSCALE", IMAGE_FILTER_GRAYSCALE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_BRIGHTNESS", IMAGE_FILTER_BRIGHTNESS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_CONTRAST", IMAGE_FILTER_CONTRAST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_COLORIZE", IMAGE_FILTER_COLORIZE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_EDGEDETECT", IMAGE_FILTER_EDGEDETECT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_GAUSSIAN_BLUR", IMAGE_FILTER_GAUSSIAN_BLUR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_SELECTIVE_BLUR", IMAGE_FILTER_SELECTIVE_BLUR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_EMBOSS", IMAGE_FILTER_EMBOSS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_MEAN_REMOVAL", IMAGE_FILTER_MEAN_REMOVAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_SMOOTH", IMAGE_FILTER_SMOOTH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IMG_FILTER_PIXELATE", IMAGE_FILTER_PIXELATE, CONST_CS | CONST_PERSISTENT);
/* End Section Filters */
#ifdef GD_VERSION_STRING
REGISTER_STRING_CONSTANT("GD_VERSION", GD_VERSION_STRING, CONST_CS | CONST_PERSISTENT);
#endif
#if defined(GD_MAJOR_VERSION) && defined(GD_MINOR_VERSION) && defined(GD_RELEASE_VERSION) && defined(GD_EXTRA_VERSION)
REGISTER_LONG_CONSTANT("GD_MAJOR_VERSION", GD_MAJOR_VERSION, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GD_MINOR_VERSION", GD_MINOR_VERSION, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GD_RELEASE_VERSION", GD_RELEASE_VERSION, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("GD_EXTRA_VERSION", GD_EXTRA_VERSION, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef HAVE_GD_PNG
/*
* cannot include #include "png.h"
* /usr/include/pngconf.h:310:2: error: #error png.h already includes setjmp.h with some additional fixup.
* as error, use the values for now...
*/
REGISTER_LONG_CONSTANT("PNG_NO_FILTER", 0x00, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PNG_FILTER_NONE", 0x08, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PNG_FILTER_SUB", 0x10, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PNG_FILTER_UP", 0x20, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PNG_FILTER_AVG", 0x40, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PNG_FILTER_PAETH", 0x80, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PNG_ALL_FILTERS", 0x08 | 0x10 | 0x20 | 0x40 | 0x80, CONST_CS | CONST_PERSISTENT);
#endif
return SUCCESS;
}
| 17,831 |
161,842 | 0 | ClientDiscardableSharedMemoryManager::GetStatistics() const {
base::AutoLock lock(lock_);
Statistics stats;
stats.total_size = heap_->GetSize();
stats.freelist_size = heap_->GetSizeOfFreeLists();
return stats;
}
| 17,832 |
67,199 | 0 | static nodemask_t *policy_nodemask(gfp_t gfp, struct mempolicy *policy)
{
/* Lower zones don't get a nodemask applied for MPOL_BIND */
if (unlikely(policy->mode == MPOL_BIND) &&
apply_policy_zone(policy, gfp_zone(gfp)) &&
cpuset_nodemask_valid_mems_allowed(&policy->v.nodes))
return &policy->v.nodes;
return NULL;
}
| 17,833 |
109,957 | 0 | void H264DPB::RemoveUnused() {
for (Pictures::iterator it = pics_.begin(); it != pics_.end(); ) {
if ((*it)->outputted && !(*it)->ref)
pics_.erase(it++);
else
++it;
}
}
| 17,834 |
33,631 | 0 | crypto_load_certs(krb5_context context,
pkinit_plg_crypto_context plg_cryptoctx,
pkinit_req_crypto_context req_cryptoctx,
pkinit_identity_opts *idopts,
pkinit_identity_crypto_context id_cryptoctx,
krb5_principal princ)
{
krb5_error_code retval;
switch(idopts->idtype) {
case IDTYPE_FILE:
retval = pkinit_get_certs_fs(context, plg_cryptoctx,
req_cryptoctx, idopts,
id_cryptoctx, princ);
break;
case IDTYPE_DIR:
retval = pkinit_get_certs_dir(context, plg_cryptoctx,
req_cryptoctx, idopts,
id_cryptoctx, princ);
break;
#ifndef WITHOUT_PKCS11
case IDTYPE_PKCS11:
retval = pkinit_get_certs_pkcs11(context, plg_cryptoctx,
req_cryptoctx, idopts,
id_cryptoctx, princ);
break;
#endif
case IDTYPE_PKCS12:
retval = pkinit_get_certs_pkcs12(context, plg_cryptoctx,
req_cryptoctx, idopts,
id_cryptoctx, princ);
break;
default:
retval = EINVAL;
}
if (retval)
goto cleanup;
cleanup:
return retval;
}
| 17,835 |
167,954 | 0 | void LocalFrame::Navigate(const FrameLoadRequest& request) {
loader_.StartNavigation(request);
}
| 17,836 |
165,796 | 0 | Node::InsertionNotificationRequest SVGElement::InsertedInto(
ContainerNode& root_parent) {
Element::InsertedInto(root_parent);
UpdateRelativeLengthsInformation();
const AtomicString& nonce_value = FastGetAttribute(kNonceAttr);
if (!nonce_value.IsEmpty()) {
setNonce(nonce_value);
if (InActiveDocument() &&
GetDocument().GetContentSecurityPolicy()->HasHeaderDeliveredPolicy()) {
setAttribute(kNonceAttr, g_empty_atom);
}
}
return kInsertionDone;
}
| 17,837 |
65,570 | 0 | nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct nfsd4_close *close)
{
__be32 status;
struct nfs4_ol_stateid *stp;
struct net *net = SVC_NET(rqstp);
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
dprintk("NFSD: nfsd4_close on file %pd\n",
cstate->current_fh.fh_dentry);
status = nfs4_preprocess_seqid_op(cstate, close->cl_seqid,
&close->cl_stateid,
NFS4_OPEN_STID|NFS4_CLOSED_STID,
&stp, nn);
nfsd4_bump_seqid(cstate, status);
if (status)
goto out;
nfs4_inc_and_copy_stateid(&close->cl_stateid, &stp->st_stid);
mutex_unlock(&stp->st_mutex);
nfsd4_close_open_stateid(stp);
/* put reference from nfs4_preprocess_seqid_op */
nfs4_put_stid(&stp->st_stid);
out:
return status;
}
| 17,838 |
109,673 | 0 | void Document::executeScriptsWaitingForResourcesIfNeeded()
{
if (!haveStylesheetsAndImportsLoaded())
return;
if (ScriptableDocumentParser* parser = scriptableDocumentParser())
parser->executeScriptsWaitingForResources();
}
| 17,839 |
20,078 | 0 | mii_get_media (struct net_device *dev)
{
__u16 negotiate;
__u16 bmsr;
__u16 mscr;
__u16 mssr;
int phy_addr;
struct netdev_private *np;
np = netdev_priv(dev);
phy_addr = np->phy_addr;
bmsr = mii_read (dev, phy_addr, MII_BMSR);
if (np->an_enable) {
if (!(bmsr & BMSR_ANEGCOMPLETE)) {
/* Auto-Negotiation not completed */
return -1;
}
negotiate = mii_read (dev, phy_addr, MII_ADVERTISE) &
mii_read (dev, phy_addr, MII_LPA);
mscr = mii_read (dev, phy_addr, MII_CTRL1000);
mssr = mii_read (dev, phy_addr, MII_STAT1000);
if (mscr & ADVERTISE_1000FULL && mssr & LPA_1000FULL) {
np->speed = 1000;
np->full_duplex = 1;
printk (KERN_INFO "Auto 1000 Mbps, Full duplex\n");
} else if (mscr & ADVERTISE_1000HALF && mssr & LPA_1000HALF) {
np->speed = 1000;
np->full_duplex = 0;
printk (KERN_INFO "Auto 1000 Mbps, Half duplex\n");
} else if (negotiate & ADVERTISE_100FULL) {
np->speed = 100;
np->full_duplex = 1;
printk (KERN_INFO "Auto 100 Mbps, Full duplex\n");
} else if (negotiate & ADVERTISE_100HALF) {
np->speed = 100;
np->full_duplex = 0;
printk (KERN_INFO "Auto 100 Mbps, Half duplex\n");
} else if (negotiate & ADVERTISE_10FULL) {
np->speed = 10;
np->full_duplex = 1;
printk (KERN_INFO "Auto 10 Mbps, Full duplex\n");
} else if (negotiate & ADVERTISE_10HALF) {
np->speed = 10;
np->full_duplex = 0;
printk (KERN_INFO "Auto 10 Mbps, Half duplex\n");
}
if (negotiate & ADVERTISE_PAUSE_CAP) {
np->tx_flow &= 1;
np->rx_flow &= 1;
} else if (negotiate & ADVERTISE_PAUSE_ASYM) {
np->tx_flow = 0;
np->rx_flow &= 1;
}
/* else tx_flow, rx_flow = user select */
} else {
__u16 bmcr = mii_read (dev, phy_addr, MII_BMCR);
switch (bmcr & (BMCR_SPEED100 | BMCR_SPEED1000)) {
case BMCR_SPEED1000:
printk (KERN_INFO "Operating at 1000 Mbps, ");
break;
case BMCR_SPEED100:
printk (KERN_INFO "Operating at 100 Mbps, ");
break;
case 0:
printk (KERN_INFO "Operating at 10 Mbps, ");
}
if (bmcr & BMCR_FULLDPLX) {
printk (KERN_CONT "Full duplex\n");
} else {
printk (KERN_CONT "Half duplex\n");
}
}
if (np->tx_flow)
printk(KERN_INFO "Enable Tx Flow Control\n");
else
printk(KERN_INFO "Disable Tx Flow Control\n");
if (np->rx_flow)
printk(KERN_INFO "Enable Rx Flow Control\n");
else
printk(KERN_INFO "Disable Rx Flow Control\n");
return 0;
}
| 17,840 |
116,529 | 0 | void ChromeContentClient::AddNPAPIPlugins(
webkit::npapi::PluginList* plugin_list) {
}
| 17,841 |
103,768 | 0 | void RenderThread::WidgetRestored() {
DCHECK_GT(hidden_widget_count_, 0);
hidden_widget_count_--;
if (!content::GetContentClient()->renderer()->
RunIdleHandlerWhenWidgetsHidden()) {
return;
}
idle_timer_.Stop();
}
| 17,842 |
163,037 | 0 | void ProfilingProcessHost::RequestProcessReport(std::string trigger_name) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (!connector_) {
DLOG(ERROR)
<< "Requesting process dump when profiling process hasn't started.";
return;
}
bool result = content::TracingController::GetInstance()->StartTracing(
GetBackgroundTracingConfig(), base::Closure());
if (!result)
return;
auto finish_sink_callback = base::Bind(
[](std::string trigger_name,
std::unique_ptr<const base::DictionaryValue> metadata,
base::RefCountedString* in) {
std::string result;
result.swap(in->data());
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI)
->PostTask(FROM_HERE, base::BindOnce(&UploadTraceToCrashServer,
std::move(result),
std::move(trigger_name)));
},
std::move(trigger_name));
scoped_refptr<content::TracingController::TraceDataEndpoint> sink =
content::TracingController::CreateStringEndpoint(
std::move(finish_sink_callback));
base::OnceClosure stop_tracing_closure = base::BindOnce(
base::IgnoreResult<bool (content::TracingController::*)( // NOLINT
const scoped_refptr<content::TracingController::TraceDataEndpoint>&)>(
&content::TracingController::StopTracing),
base::Unretained(content::TracingController::GetInstance()), sink);
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, std::move(stop_tracing_closure),
base::TimeDelta::FromSeconds(10));
}
| 17,843 |
26,346 | 0 | int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
{
unsigned long flags;
struct rq *rq;
unsigned int dest_cpu;
int ret = 0;
rq = task_rq_lock(p, &flags);
if (cpumask_equal(&p->cpus_allowed, new_mask))
goto out;
if (!cpumask_intersects(new_mask, cpu_active_mask)) {
ret = -EINVAL;
goto out;
}
if (unlikely((p->flags & PF_THREAD_BOUND) && p != current)) {
ret = -EINVAL;
goto out;
}
do_set_cpus_allowed(p, new_mask);
/* Can the task run on the task's current CPU? If so, we're done */
if (cpumask_test_cpu(task_cpu(p), new_mask))
goto out;
dest_cpu = cpumask_any_and(cpu_active_mask, new_mask);
if (p->on_rq) {
struct migration_arg arg = { p, dest_cpu };
/* Need help from migration thread: drop lock and wait. */
task_rq_unlock(rq, p, &flags);
stop_one_cpu(cpu_of(rq), migration_cpu_stop, &arg);
tlb_migrate_finish(p->mm);
return 0;
}
out:
task_rq_unlock(rq, p, &flags);
return ret;
}
| 17,844 |
118,831 | 0 | int WebContentsImpl::CreateOpenerRenderViewsForRenderManager(
SiteInstance* instance) {
if (!opener_)
return MSG_ROUTING_NONE;
return opener_->CreateOpenerRenderViews(instance);
}
| 17,845 |
78,466 | 0 | sc_get_driver(void)
{
struct sc_card_driver *iso_drv;
iso_drv = sc_get_iso7816_driver();
iso_ops = iso_drv->ops;
gpk_ops = *iso_ops;
gpk_ops.match_card = gpk_match_card;
gpk_ops.init = gpk_init;
gpk_ops.finish = gpk_finish;
gpk_ops.select_file = gpk_select_file;
gpk_ops.read_binary = gpk_read_binary;
gpk_ops.write_binary = gpk_write_binary;
gpk_ops.update_binary = gpk_update_binary;
gpk_ops.create_file = gpk_create_file;
/* gpk_ops.check_sw = gpk_check_sw; */
gpk_ops.card_ctl = gpk_card_ctl;
gpk_ops.set_security_env= gpk_set_security_env;
gpk_ops.restore_security_env= gpk_restore_security_env;
gpk_ops.compute_signature= gpk_compute_signature;
gpk_ops.decipher = gpk_decipher;
gpk_ops.pin_cmd = gpk_pin_cmd;
return &gpk_drv;
}
| 17,846 |
135,691 | 0 | void FrameSelection::UpdateStyleAndLayoutIfNeeded() {
frame_caret_->UpdateStyleAndLayoutIfNeeded();
}
| 17,847 |
132,152 | 0 | void RenderViewTest::GoBack(const PageState& state) {
GoToOffset(-1, state);
}
| 17,848 |
131,438 | 0 | static void limitedWithInvalidMissingDefaultAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
TestObjectPythonV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetter(jsValue, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 17,849 |
184,252 | 1 | void BlobURLRegistry::unregisterURL(const KURL& url)
{
ThreadableBlobRegistry::unregisterBlobURL(url);
}
| 17,850 |
147,384 | 0 | void V8TestObject::EnforceRangeLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_enforceRangeLongAttribute_Getter");
test_object_v8_internal::EnforceRangeLongAttributeAttributeGetter(info);
}
| 17,851 |
145,680 | 0 | bool ImageInputType::canBeSuccessfulSubmitButton()
{
return true;
}
| 17,852 |
185,516 | 1 | void PartialMagnificationController::OnWidgetDestroying(views::Widget* widget) {
DCHECK_EQ(widget, zoom_widget_);
RemoveZoomWidgetObservers();
zoom_widget_ = NULL;
}
| 17,853 |
16,205 | 0 | GahpClient::gt4_gram_client_job_start(const char * job_contact)
{
static const char* command = "GT4_GRAM_JOB_START";
if (server->m_commands_supported->contains_anycase(command)==FALSE) {
return GAHPCLIENT_COMMAND_NOT_SUPPORTED;
}
if (!job_contact) job_contact=NULLSTRING;
std::string reqline;
int x = sprintf(reqline,"%s",escapeGahpString(job_contact));
ASSERT( x > 0 );
const char *buf = reqline.c_str();
if ( !is_pending(command,buf) ) {
if ( m_mode == results_only ) {
return GAHPCLIENT_COMMAND_NOT_SUBMITTED;
}
now_pending(command,buf,normal_proxy);
}
Gahp_Args* result = get_pending_result(command,buf);
if ( result ) {
if (result->argc != 3) {
EXCEPT("Bad %s Result",command);
}
int rc = atoi(result->argv[1]);
if ( strcasecmp(result->argv[2], NULLSTRING) ) {
error_string = result->argv[2];
} else {
error_string = "";
}
delete result;
return rc;
}
if ( check_pending_timeout(command,buf) ) {
sprintf( error_string, "%s timed out", command );
return GAHPCLIENT_COMMAND_TIMED_OUT;
}
return GAHPCLIENT_COMMAND_PENDING;
}
| 17,854 |
105,317 | 0 | AutofillDownloadTestHelper()
: download_manager(&profile),
request_context_getter(new TestURLRequestContextGetter()) {
download_manager.SetObserver(this);
}
| 17,855 |
118,979 | 0 | void WebContentsImpl::OnDocumentLoadedInFrame(int64 frame_id) {
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DocumentLoadedInFrame(frame_id, message_source_));
}
| 17,856 |
107,183 | 0 | void AutoFillManager::OnInfoBarClosed(bool should_save) {
if (should_save)
personal_data_->SaveImportedCreditCard();
}
| 17,857 |
160,536 | 0 | WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
: delegate_(nullptr),
controller_(this, browser_context),
render_view_host_delegate_view_(nullptr),
created_with_opener_(false),
frame_tree_(new NavigatorImpl(&controller_, this),
this,
this,
this,
this),
node_(this),
is_load_to_different_document_(false),
crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING),
crashed_error_code_(0),
waiting_for_response_(false),
load_state_(net::LOAD_STATE_IDLE, base::string16()),
upload_size_(0),
upload_position_(0),
is_resume_pending_(false),
interstitial_page_(nullptr),
has_accessed_initial_document_(false),
theme_color_(SK_ColorTRANSPARENT),
last_sent_theme_color_(SK_ColorTRANSPARENT),
did_first_visually_non_empty_paint_(false),
capturer_count_(0),
should_normally_be_visible_(true),
should_normally_be_occluded_(false),
did_first_set_visible_(false),
is_being_destroyed_(false),
is_notifying_observers_(false),
notify_disconnection_(false),
dialog_manager_(nullptr),
is_showing_before_unload_dialog_(false),
last_active_time_(base::TimeTicks::Now()),
closed_by_user_gesture_(false),
minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)),
maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)),
zoom_scroll_remainder_(0),
fullscreen_widget_process_id_(ChildProcessHost::kInvalidUniqueID),
fullscreen_widget_routing_id_(MSG_ROUTING_NONE),
fullscreen_widget_had_focus_at_shutdown_(false),
is_subframe_(false),
force_disable_overscroll_content_(false),
last_dialog_suppressed_(false),
accessibility_mode_(
BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()),
audio_stream_monitor_(this),
bluetooth_connected_device_count_(0),
#if !defined(OS_ANDROID)
page_scale_factor_is_one_(true),
#endif // !defined(OS_ANDROID)
mouse_lock_widget_(nullptr),
is_overlay_content_(false),
showing_context_menu_(false),
loading_weak_factory_(this),
weak_factory_(this) {
frame_tree_.SetFrameRemoveListener(
base::Bind(&WebContentsImpl::OnFrameRemoved,
base::Unretained(this)));
#if defined(OS_ANDROID)
media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this));
#else
media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
#endif
#if BUILDFLAG(ENABLE_PLUGINS)
pepper_playback_observer_.reset(new PepperPlaybackObserver(this));
#endif
loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this));
#if !defined(OS_ANDROID)
host_zoom_map_observer_.reset(new HostZoomMapObserver(this));
#endif // !defined(OS_ANDROID)
registry_.AddInterface(base::BindRepeating(
&WebContentsImpl::OnColorChooserFactoryRequest, base::Unretained(this)));
}
| 17,858 |
93,379 | 0 | void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
{
struct packet_type *ptype;
struct sk_buff *skb2 = NULL;
struct packet_type *pt_prev = NULL;
struct list_head *ptype_list = &ptype_all;
rcu_read_lock();
again:
list_for_each_entry_rcu(ptype, ptype_list, list) {
/* Never send packets back to the socket
* they originated from - MvS ([email protected])
*/
if (skb_loop_sk(ptype, skb))
continue;
if (pt_prev) {
deliver_skb(skb2, pt_prev, skb->dev);
pt_prev = ptype;
continue;
}
/* need to clone skb, done only once */
skb2 = skb_clone(skb, GFP_ATOMIC);
if (!skb2)
goto out_unlock;
net_timestamp_set(skb2);
/* skb->nh should be correctly
* set by sender, so that the second statement is
* just protection against buggy protocols.
*/
skb_reset_mac_header(skb2);
if (skb_network_header(skb2) < skb2->data ||
skb_network_header(skb2) > skb_tail_pointer(skb2)) {
net_crit_ratelimited("protocol %04x is buggy, dev %s\n",
ntohs(skb2->protocol),
dev->name);
skb_reset_network_header(skb2);
}
skb2->transport_header = skb2->network_header;
skb2->pkt_type = PACKET_OUTGOING;
pt_prev = ptype;
}
if (ptype_list == &ptype_all) {
ptype_list = &dev->ptype_all;
goto again;
}
out_unlock:
if (pt_prev) {
if (!skb_orphan_frags_rx(skb2, GFP_ATOMIC))
pt_prev->func(skb2, skb->dev, pt_prev, skb->dev);
else
kfree_skb(skb2);
}
rcu_read_unlock();
}
| 17,859 |
10,031 | 0 | LogMessage( const char* fmt, ... )
{
va_list ap;
va_start( ap, fmt );
vfprintf( stderr, fmt, ap );
va_end( ap );
}
| 17,860 |
95,686 | 0 | void CL_LoadTransTable( const char *fileName ) {
char translated[MAX_LANGUAGES][MAX_VA_STRING];
char original[MAX_VA_STRING];
qboolean aborted;
char *text;
fileHandle_t f;
char *text_p;
char *token;
int len, i;
trans_t *t;
int count;
count = 0;
aborted = qfalse;
cl.corruptedTranslationFile = qfalse;
len = FS_FOpenFileByMode( fileName, &f, FS_READ );
if ( len <= 0 ) {
return;
}
text = malloc( len + 1 );
if ( !text ) {
return;
}
FS_Read( text, len, f );
text[len] = 0;
FS_FCloseFile( f );
text_p = text;
do {
token = COM_Parse( &text_p );
if ( Q_stricmp( "{", token ) ) {
if ( !Q_stricmp( "#version", token ) ) {
token = COM_Parse( &text_p );
strcpy( cl.translationVersion, token );
continue;
}
break;
}
token = COM_Parse( &text_p );
if ( Q_stricmp( "english", token ) ) {
aborted = qtrue;
break;
}
token = COM_Parse( &text_p );
strcpy( original, token );
if ( cl_debugTranslation->integer == 3 ) {
Com_Printf( "%i Loading: \"%s\"\n", count, original );
}
token = COM_Parse( &text_p );
if ( Q_stricmp( "french", token ) ) {
aborted = qtrue;
break;
}
token = COM_Parse( &text_p );
strcpy( translated[LANGUAGE_FRENCH], token );
if ( !CL_CheckTranslationString( original, translated[LANGUAGE_FRENCH] ) ) {
Com_Printf( S_COLOR_YELLOW "WARNING: Translation formatting doesn't match up with English version!\n" );
aborted = qtrue;
break;
}
token = COM_Parse( &text_p );
if ( Q_stricmp( "german", token ) ) {
aborted = qtrue;
break;
}
token = COM_Parse( &text_p );
strcpy( translated[LANGUAGE_GERMAN], token );
if ( !CL_CheckTranslationString( original, translated[LANGUAGE_GERMAN] ) ) {
Com_Printf( S_COLOR_YELLOW "WARNING: Translation formatting doesn't match up with English version!\n" );
aborted = qtrue;
break;
}
token = COM_Parse( &text_p );
if ( Q_stricmp( "italian", token ) ) {
aborted = qtrue;
break;
}
token = COM_Parse( &text_p );
strcpy( translated[LANGUAGE_ITALIAN], token );
if ( !CL_CheckTranslationString( original, translated[LANGUAGE_ITALIAN] ) ) {
Com_Printf( S_COLOR_YELLOW "WARNING: Translation formatting doesn't match up with English version!\n" );
aborted = qtrue;
break;
}
token = COM_Parse( &text_p );
if ( Q_stricmp( "spanish", token ) ) {
aborted = qtrue;
break;
}
token = COM_Parse( &text_p );
strcpy( translated[LANGUAGE_SPANISH], token );
if ( !CL_CheckTranslationString( original, translated[LANGUAGE_SPANISH] ) ) {
Com_Printf( S_COLOR_YELLOW "WARNING: Translation formatting doesn't match up with English version!\n" );
aborted = qtrue;
break;
}
t = LookupTrans( original, NULL, qtrue );
if ( t ) {
t->fromFile = qtrue;
for ( i = 0; i < MAX_LANGUAGES; i++ )
strncpy( t->translated[i], translated[i], MAX_TRANS_STRING );
}
token = COM_Parse( &text_p );
if ( !Q_stricmp( "offset", token ) ) {
if ( t )
{
token = COM_Parse( &text_p );
t->x_offset = atof( token );
token = COM_Parse( &text_p );
t->y_offset = atof( token );
token = COM_Parse( &text_p );
}
}
if ( Q_stricmp( "}", token ) ) {
aborted = qtrue;
break;
}
count++;
} while ( token );
if ( aborted ) {
int i, line = 1;
for ( i = 0; i < len && ( text + i ) < text_p; i++ ) {
if ( text[i] == '\n' ) {
line++;
}
}
Com_Printf( S_COLOR_YELLOW "WARNING: Problem loading %s on line %i\n", fileName, line );
cl.corruptedTranslationFile = qtrue;
} else {
Com_Printf( "Loaded %i translation strings from %s\n", count, fileName );
}
free( text );
}
| 17,861 |
20,232 | 0 | static ssize_t hugetlbfs_read(struct file *filp, char __user *buf,
size_t len, loff_t *ppos)
{
struct hstate *h = hstate_file(filp);
struct address_space *mapping = filp->f_mapping;
struct inode *inode = mapping->host;
unsigned long index = *ppos >> huge_page_shift(h);
unsigned long offset = *ppos & ~huge_page_mask(h);
unsigned long end_index;
loff_t isize;
ssize_t retval = 0;
/* validate length */
if (len == 0)
goto out;
for (;;) {
struct page *page;
unsigned long nr, ret;
int ra;
/* nr is the maximum number of bytes to copy from this page */
nr = huge_page_size(h);
isize = i_size_read(inode);
if (!isize)
goto out;
end_index = (isize - 1) >> huge_page_shift(h);
if (index >= end_index) {
if (index > end_index)
goto out;
nr = ((isize - 1) & ~huge_page_mask(h)) + 1;
if (nr <= offset)
goto out;
}
nr = nr - offset;
/* Find the page */
page = find_lock_page(mapping, index);
if (unlikely(page == NULL)) {
/*
* We have a HOLE, zero out the user-buffer for the
* length of the hole or request.
*/
ret = len < nr ? len : nr;
if (clear_user(buf, ret))
ra = -EFAULT;
else
ra = 0;
} else {
unlock_page(page);
/*
* We have the page, copy it to user space buffer.
*/
ra = hugetlbfs_read_actor(page, offset, buf, len, nr);
ret = ra;
page_cache_release(page);
}
if (ra < 0) {
if (retval == 0)
retval = ra;
goto out;
}
offset += ret;
retval += ret;
len -= ret;
index += offset >> huge_page_shift(h);
offset &= ~huge_page_mask(h);
/* short read or no more work */
if ((ret != nr) || (len == 0))
break;
}
out:
*ppos = ((loff_t)index << huge_page_shift(h)) + offset;
return retval;
}
| 17,862 |
145,536 | 0 | void ResourceDispatcherHostImpl::UpdateRequestForTransfer(
int child_id,
int route_id,
int request_id,
const ResourceHostMsg_Request& request_data,
LoaderMap::iterator iter) {
ResourceRequestInfoImpl* info = iter->second->GetRequestInfo();
GlobalRoutingID old_routing_id(
request_data.transferred_request_child_id, info->GetRouteID());
GlobalRequestID old_request_id(request_data.transferred_request_child_id,
request_data.transferred_request_request_id);
GlobalRoutingID new_routing_id(child_id, route_id);
GlobalRequestID new_request_id(child_id, request_id);
IncrementOutstandingRequestsMemory(-1, *info);
bool should_update_count = info->counted_as_in_flight_request();
if (should_update_count)
IncrementOutstandingRequestsCount(-1, info);
DCHECK(pending_loaders_.find(old_request_id) == iter);
scoped_ptr<ResourceLoader> loader = std::move(iter->second);
ResourceLoader* loader_ptr = loader.get();
pending_loaders_.erase(iter);
info->UpdateForTransfer(child_id, route_id, request_data.render_frame_id,
request_data.origin_pid, request_id,
filter_->GetWeakPtr());
pending_loaders_[new_request_id] = std::move(loader);
IncrementOutstandingRequestsMemory(1, *info);
if (should_update_count)
IncrementOutstandingRequestsCount(1, info);
if (old_routing_id != new_routing_id) {
if (blocked_loaders_map_.find(old_routing_id) !=
blocked_loaders_map_.end()) {
blocked_loaders_map_[new_routing_id] =
std::move(blocked_loaders_map_[old_routing_id]);
blocked_loaders_map_.erase(old_routing_id);
}
}
if (old_request_id != new_request_id) {
DelegateMap::iterator it = delegate_map_.find(old_request_id);
if (it != delegate_map_.end()) {
base::ObserverList<ResourceMessageDelegate>::Iterator del_it(it->second);
ResourceMessageDelegate* delegate;
while ((delegate = del_it.GetNext()) != NULL) {
delegate->set_request_id(new_request_id);
}
delegate_map_[new_request_id] = delegate_map_[old_request_id];
delegate_map_.erase(old_request_id);
}
}
AppCacheInterceptor::CompleteCrossSiteTransfer(
loader_ptr->request(),
child_id,
request_data.appcache_host_id,
filter_);
ServiceWorkerRequestHandler* handler =
ServiceWorkerRequestHandler::GetHandler(loader_ptr->request());
if (handler) {
if (!handler->SanityCheckIsSameContext(filter_->service_worker_context())) {
bad_message::ReceivedBadMessage(
filter_, bad_message::RDHI_WRONG_STORAGE_PARTITION);
} else {
handler->CompleteCrossSiteTransfer(
child_id, request_data.service_worker_provider_id);
}
}
DCHECK(info->cross_site_handler());
}
| 17,863 |
54,980 | 0 | static void commit_list_insert_by_date_cached(struct commit *p, struct commit_list **head,
struct commit_list *cached_base, struct commit_list **cache)
{
struct commit_list *new_entry;
if (cached_base && p->date < cached_base->item->date)
new_entry = commit_list_insert_by_date(p, &cached_base->next);
else
new_entry = commit_list_insert_by_date(p, head);
if (cache && (!*cache || p->date < (*cache)->item->date))
*cache = new_entry;
}
| 17,864 |
180,646 | 1 | void set_fat(DOS_FS * fs, uint32_t cluster, int32_t new)
{
unsigned char *data = NULL;
int size;
loff_t offs;
if (new == -1)
new = FAT_EOF(fs);
else if ((long)new == -2)
new = FAT_BAD(fs);
switch (fs->fat_bits) {
case 12:
data = fs->fat + cluster * 3 / 2;
offs = fs->fat_start + cluster * 3 / 2;
if (cluster & 1) {
FAT_ENTRY prevEntry;
get_fat(&prevEntry, fs->fat, cluster - 1, fs);
data[0] = ((new & 0xf) << 4) | (prevEntry.value >> 8);
data[1] = new >> 4;
} else {
FAT_ENTRY subseqEntry;
if (cluster != fs->clusters - 1)
get_fat(&subseqEntry, fs->fat, cluster + 1, fs);
else
subseqEntry.value = 0;
data[0] = new & 0xff;
data[1] = (new >> 8) | ((0xff & subseqEntry.value) << 4);
}
size = 2;
break;
case 16:
data = fs->fat + cluster * 2;
offs = fs->fat_start + cluster * 2;
*(unsigned short *)data = htole16(new);
size = 2;
break;
case 32:
{
FAT_ENTRY curEntry;
get_fat(&curEntry, fs->fat, cluster, fs);
data = fs->fat + cluster * 4;
offs = fs->fat_start + cluster * 4;
/* According to M$, the high 4 bits of a FAT32 entry are reserved and
* are not part of the cluster number. So we never touch them. */
*(uint32_t *)data = htole32((new & 0xfffffff) |
(curEntry.reserved << 28));
size = 4;
}
break;
default:
die("Bad FAT entry size: %d bits.", fs->fat_bits);
}
fs_write(offs, size, data);
if (fs->nfats > 1) {
fs_write(offs + fs->fat_size, size, data);
}
}
| 17,865 |
13,139 | 0 | static NOINLINE void send_NAK(struct dhcp_packet *oldpacket)
{
struct dhcp_packet packet;
init_packet(&packet, oldpacket, DHCPNAK);
log1("sending %s", "NAK");
send_packet(&packet, /*force_bcast:*/ 1);
}
| 17,866 |
80,868 | 0 | GF_Err tfxd_dump(GF_Box *a, FILE * trace)
{
GF_MSSTimeExtBox *ptr = (GF_MSSTimeExtBox*)a;
if (!a) return GF_BAD_PARAM;
gf_isom_box_dump_start(a, "MSSTimeExtensionBox", trace);
fprintf(trace, "AbsoluteTime=\""LLU"\" FragmentDuration=\""LLU"\">\n", ptr->absolute_time_in_track_timescale, ptr->fragment_duration_in_track_timescale);
fprintf(trace, "<FullBoxInfo Version=\"%d\" Flags=\"%d\"/>\n", ptr->version, ptr->flags);
gf_isom_box_dump_done("MSSTimeExtensionBox", a, trace);
return GF_OK;
}
| 17,867 |
97,868 | 0 | void RenderView::AltErrorPageFinished(WebFrame* frame,
const WebURLError& original_error,
const std::string& html) {
const std::string* html_to_load = &html;
if (html.empty()) {
NavigationState* navigation_state =
NavigationState::FromDataSource(frame->dataSource());
html_to_load = &navigation_state->postponed_data();
}
LoadNavigationErrorPage(
frame, WebURLRequest(), original_error, *html_to_load, true);
}
| 17,868 |
11,349 | 0 | fbCombineConjointOutPart (CARD8 a, CARD8 b)
{
/* max (1-b/a,0) */
/* = 1-min(b/a,1) */
/* min (1, (1-b) / a) */
if (b >= a) /* b >= a -> b/a >= 1 */
return 0x00; /* 0 */
return ~FbIntDiv(b,a); /* 1 - b/a */
}
| 17,869 |
8,586 | 0 | static int ssh_receive(Plug plug, int urgent, char *data, int len)
{
Ssh ssh = (Ssh) plug;
ssh_gotdata(ssh, (unsigned char *)data, len);
if (ssh->state == SSH_STATE_CLOSED) {
ssh_do_close(ssh, TRUE);
return 0;
}
return 1;
}
| 17,870 |
68,944 | 0 | static int slab_offline_cpu(unsigned int cpu)
{
/*
* Shutdown cache reaper. Note that the slab_mutex is held so
* that if cache_reap() is invoked it cannot do anything
* expensive but will only modify reap_work and reschedule the
* timer.
*/
cancel_delayed_work_sync(&per_cpu(slab_reap_work, cpu));
/* Now the cache_reaper is guaranteed to be not running. */
per_cpu(slab_reap_work, cpu).work.func = NULL;
return 0;
}
| 17,871 |
94,522 | 0 | static void l2cap_sock_destruct(struct sock *sk)
{
BT_DBG("sk %p", sk);
l2cap_chan_put(l2cap_pi(sk)->chan);
if (l2cap_pi(sk)->rx_busy_skb) {
kfree_skb(l2cap_pi(sk)->rx_busy_skb);
l2cap_pi(sk)->rx_busy_skb = NULL;
}
skb_queue_purge(&sk->sk_receive_queue);
skb_queue_purge(&sk->sk_write_queue);
}
| 17,872 |
26,370 | 0 | static void update_rq_clock_task(struct rq *rq, s64 delta)
{
rq->clock_task += delta;
}
| 17,873 |
92,930 | 0 | cssp_encode_tspasswordcreds(char *username, char *password, char *domain)
{
STREAM out, h1, h2;
struct stream tmp = { 0 };
struct stream message = { 0 };
memset(&tmp, 0, sizeof(tmp));
memset(&message, 0, sizeof(message));
s_realloc(&tmp, 512 * 4);
s_reset(&tmp);
out_utf16s(&tmp, domain);
s_mark_end(&tmp);
h2 = ber_wrap_hdr_data(BER_TAG_OCTET_STRING, &tmp);
h1 = ber_wrap_hdr_data(BER_TAG_CTXT_SPECIFIC | BER_TAG_CONSTRUCTED | 0, h2);
s_realloc(&message, s_length(&message) + s_length(h1));
out_uint8p(&message, h1->data, s_length(h1));
s_mark_end(&message);
s_free(h2);
s_free(h1);
s_reset(&tmp);
out_utf16s(&tmp, username);
s_mark_end(&tmp);
h2 = ber_wrap_hdr_data(BER_TAG_OCTET_STRING, &tmp);
h1 = ber_wrap_hdr_data(BER_TAG_CTXT_SPECIFIC | BER_TAG_CONSTRUCTED | 1, h2);
s_realloc(&message, s_length(&message) + s_length(h1));
out_uint8p(&message, h1->data, s_length(h1));
s_mark_end(&message);
s_free(h2);
s_free(h1);
s_reset(&tmp);
out_utf16s(&tmp, password);
s_mark_end(&tmp);
h2 = ber_wrap_hdr_data(BER_TAG_OCTET_STRING, &tmp);
h1 = ber_wrap_hdr_data(BER_TAG_CTXT_SPECIFIC | BER_TAG_CONSTRUCTED | 2, h2);
s_realloc(&message, s_length(&message) + s_length(h1));
out_uint8p(&message, h1->data, s_length(h1));
s_mark_end(&message);
s_free(h2);
s_free(h1);
out = ber_wrap_hdr_data(BER_TAG_SEQUENCE | BER_TAG_CONSTRUCTED, &message);
xfree(tmp.data);
xfree(message.data);
return out;
}
| 17,874 |
134,949 | 0 | DriveFsHost::DriveFsHost(const base::FilePath& profile_path,
DriveFsHost::Delegate* delegate)
: profile_path_(profile_path),
delegate_(delegate) {
chromeos::disks::DiskMountManager::GetInstance()->AddObserver(this);
}
| 17,875 |
92,778 | 0 | update_stats_wait_start(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
u64 wait_start, prev_wait_start;
if (!schedstat_enabled())
return;
wait_start = rq_clock(rq_of(cfs_rq));
prev_wait_start = schedstat_val(se->statistics.wait_start);
if (entity_is_task(se) && task_on_rq_migrating(task_of(se)) &&
likely(wait_start > prev_wait_start))
wait_start -= prev_wait_start;
__schedstat_set(se->statistics.wait_start, wait_start);
}
| 17,876 |
148,893 | 0 | bool RenderFrameHostManager::IsRendererTransferNeededForNavigation(
RenderFrameHostImpl* rfh,
const GURL& dest_url) {
if (!rfh->GetSiteInstance()->HasSite())
return false;
if (rfh->GetSiteInstance()->GetSiteURL().SchemeIs(kGuestScheme))
return false;
BrowserContext* context = rfh->GetSiteInstance()->GetBrowserContext();
if (IsCurrentlySameSite(rfh, dest_url)) {
return false;
}
if (rfh->GetSiteInstance()->RequiresDedicatedProcess() ||
SiteInstanceImpl::DoesSiteRequireDedicatedProcess(context,
dest_url)) {
return true;
}
if (SiteIsolationPolicy::IsTopDocumentIsolationEnabled() &&
(!frame_tree_node_->IsMainFrame() ||
rfh->GetSiteInstance()->IsDefaultSubframeSiteInstance())) {
return true;
}
return false;
}
| 17,877 |
16,841 | 0 | int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res, BdrvCheckMode fix)
{
if (bs->drv->bdrv_check == NULL) {
return -ENOTSUP;
}
memset(res, 0, sizeof(*res));
return bs->drv->bdrv_check(bs, res, fix);
}
| 17,878 |
92,697 | 0 | static inline struct cfs_rq *task_cfs_rq(struct task_struct *p)
{
return p->se.cfs_rq;
}
| 17,879 |
154,208 | 0 | error::Error GLES2DecoderImpl::HandleCoverFillPathInstancedCHROMIUM(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
static const char kFunctionName[] = "glCoverFillPathInstancedCHROMIUM";
const volatile gles2::cmds::CoverFillPathInstancedCHROMIUM& c =
*static_cast<const volatile gles2::cmds::CoverFillPathInstancedCHROMIUM*>(
cmd_data);
if (!features().chromium_path_rendering)
return error::kUnknownCommand;
PathCommandValidatorContext v(this, kFunctionName);
GLuint num_paths = 0;
GLenum path_name_type = GL_NONE;
GLenum cover_mode = GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM;
GLenum transform_type = GL_NONE;
if (!v.GetPathCountAndType(c, &num_paths, &path_name_type) ||
!v.GetCoverMode(c, &cover_mode) ||
!v.GetTransformType(c, &transform_type))
return v.error();
if (num_paths == 0)
return error::kNoError;
std::unique_ptr<GLuint[]> paths;
if (!v.GetPathNameData(c, num_paths, path_name_type, &paths))
return v.error();
const GLfloat* transforms = nullptr;
if (!v.GetTransforms(c, num_paths, transform_type, &transforms))
return v.error();
if (!CheckBoundDrawFramebufferValid(kFunctionName))
return error::kNoError;
ApplyDirtyState();
api()->glCoverFillPathInstancedNVFn(num_paths, GL_UNSIGNED_INT, paths.get(),
0, cover_mode, transform_type,
transforms);
return error::kNoError;
}
| 17,880 |
11,409 | 0 | fbFetchPixel_a2b2g2r2 (const FbBits *bits, int offset, miIndexedPtr indexed)
{
CARD32 pixel = READ((CARD8 *) bits + offset);
CARD32 a,r,g,b;
a = ((pixel & 0xc0) * 0x55) << 18;
b = ((pixel & 0x30) * 0x55) >> 6;
g = ((pixel & 0x0c) * 0x55) << 6;
r = ((pixel & 0x03) * 0x55) << 16;
return a|r|g|b;
}
| 17,881 |
101,625 | 0 | void Browser::DidNavigateMainFramePostCommit(TabContents* tab) {
if (tab == GetSelectedTabContents())
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
}
| 17,882 |
31,229 | 0 | static int setkey(struct crypto_aead *tfm, const u8 *key, unsigned int keylen)
{
struct aead_alg *aead = crypto_aead_alg(tfm);
unsigned long alignmask = crypto_aead_alignmask(tfm);
if ((unsigned long)key & alignmask)
return setkey_unaligned(tfm, key, keylen);
return aead->setkey(tfm, key, keylen);
}
| 17,883 |
74,516 | 0 | int regulator_is_enabled(struct regulator *regulator)
{
int ret;
if (regulator->always_on)
return 1;
mutex_lock(®ulator->rdev->mutex);
ret = _regulator_is_enabled(regulator->rdev);
mutex_unlock(®ulator->rdev->mutex);
return ret;
}
| 17,884 |
185,752 | 1 | void PrintWebViewHelper::OnPrintForSystemDialog() {
blink::WebLocalFrame* frame = print_preview_context_.source_frame();
if (!frame) {
NOTREACHED();
return;
}
Print(frame, print_preview_context_.source_node(), false);
}
| 17,885 |
12,244 | 0 | int ssl_prepare_serverhello_tlsext(SSL *s)
{
#ifndef OPENSSL_NO_EC
/* If we are server and using an ECC cipher suite, send the point formats we support
* if the client sent us an ECPointsFormat extension. Note that the server is not
* supposed to send an EllipticCurves extension.
*/
unsigned long alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
unsigned long alg_a = s->s3->tmp.new_cipher->algorithm_auth;
int using_ecc = (alg_k & (SSL_kEECDH|SSL_kECDHr|SSL_kECDHe)) || (alg_a & SSL_aECDSA);
using_ecc = using_ecc && (s->session->tlsext_ecpointformatlist != NULL);
if (using_ecc)
{
if (s->tlsext_ecpointformatlist != NULL) OPENSSL_free(s->tlsext_ecpointformatlist);
if ((s->tlsext_ecpointformatlist = OPENSSL_malloc(3)) == NULL)
{
SSLerr(SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT,ERR_R_MALLOC_FAILURE);
return -1;
}
s->tlsext_ecpointformatlist_length = 3;
s->tlsext_ecpointformatlist[0] = TLSEXT_ECPOINTFORMAT_uncompressed;
s->tlsext_ecpointformatlist[1] = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime;
s->tlsext_ecpointformatlist[2] = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2;
}
#endif /* OPENSSL_NO_EC */
return 1;
}
| 17,886 |
100,825 | 0 | void HttpUtil::AppendHeaderIfMissing(const char* header_name,
const std::string& header_value,
std::string* headers) {
if (header_value.empty())
return;
if (net::HttpUtil::HasHeader(*headers, header_name))
return;
*headers += std::string(header_name) + ": " + header_value + "\r\n";
}
| 17,887 |
164,133 | 0 | std::string SerializeOrigin(const url::Origin& origin) {
return origin.GetURL().spec();
}
| 17,888 |
40,260 | 0 | mISDN_sock_create(struct net *net, struct socket *sock, int proto, int kern)
{
int err = -EPROTONOSUPPORT;
switch (proto) {
case ISDN_P_BASE:
err = base_sock_create(net, sock, proto);
break;
case ISDN_P_TE_S0:
case ISDN_P_NT_S0:
case ISDN_P_TE_E1:
case ISDN_P_NT_E1:
case ISDN_P_LAPD_TE:
case ISDN_P_LAPD_NT:
case ISDN_P_B_RAW:
case ISDN_P_B_HDLC:
case ISDN_P_B_X75SLP:
case ISDN_P_B_L2DTMF:
case ISDN_P_B_L2DSP:
case ISDN_P_B_L2DSPHDLC:
err = data_sock_create(net, sock, proto);
break;
default:
return err;
}
return err;
}
| 17,889 |
135,697 | 0 | const VisibleSelectionInFlatTree& GetVisibleSelectionInFlatTree() const {
return Selection().GetSelectionInFlatTree();
}
| 17,890 |
109,550 | 0 | printing::PreviewMetafile* PrintWebViewHelper::PrintPreviewContext::metafile() {
DCHECK(IsRendering());
return metafile_.get();
}
| 17,891 |
165,950 | 0 | void RTCPeerConnectionHandler::AddTransceiverWithTrackOnSignalingThread(
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> webrtc_track,
webrtc::RtpTransceiverInit init,
TransceiverStateSurfacer* transceiver_state_surfacer,
webrtc::RTCErrorOr<rtc::scoped_refptr<webrtc::RtpTransceiverInterface>>*
error_or_transceiver) {
*error_or_transceiver =
native_peer_connection_->AddTransceiver(webrtc_track, init);
std::vector<rtc::scoped_refptr<webrtc::RtpTransceiverInterface>> transceivers;
if (error_or_transceiver->ok())
transceivers.push_back(error_or_transceiver->value());
transceiver_state_surfacer->Initialize(track_adapter_map_, transceivers);
}
| 17,892 |
105,162 | 0 | void Range::textRects(Vector<IntRect>& rects, bool useSelectionHeight, RangeInFixedPosition* inFixed)
{
Node* startContainer = m_start.container();
Node* endContainer = m_end.container();
if (!startContainer || !endContainer) {
if (inFixed)
*inFixed = NotFixedPosition;
return;
}
bool allFixed = true;
bool someFixed = false;
Node* stopNode = pastLastNode();
for (Node* node = firstNode(); node != stopNode; node = node->traverseNextNode()) {
RenderObject* r = node->renderer();
if (!r || !r->isText())
continue;
RenderText* renderText = toRenderText(r);
int startOffset = node == startContainer ? m_start.offset() : 0;
int endOffset = node == endContainer ? m_end.offset() : numeric_limits<int>::max();
bool isFixed = false;
renderText->absoluteRectsForRange(rects, startOffset, endOffset, useSelectionHeight, &isFixed);
allFixed &= isFixed;
someFixed |= isFixed;
}
if (inFixed)
*inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixedPosition : NotFixedPosition);
}
| 17,893 |
94,069 | 0 | static int cx24116_sleep(struct dvb_frontend *fe)
{
struct cx24116_state *state = fe->demodulator_priv;
struct cx24116_cmd cmd;
int ret;
dprintk("%s()\n", __func__);
/* Firmware CMD 36: Power config */
cmd.args[0x00] = CMD_TUNERSLEEP;
cmd.args[0x01] = 1;
cmd.len = 0x02;
ret = cx24116_cmd_execute(fe, &cmd);
if (ret != 0)
return ret;
/* Power off (Shutdown clocks) */
cx24116_writereg(state, 0xea, 0xff);
cx24116_writereg(state, 0xe1, 1);
cx24116_writereg(state, 0xe0, 1);
return 0;
}
| 17,894 |
103,294 | 0 | bool ExtensionPrefs::ReadExtensionPrefList(
const std::string& extension_id, const std::string& pref_key,
const ListValue** out_value) {
const DictionaryValue* ext = GetExtensionPref(extension_id);
ListValue* out = NULL;
if (!ext || !ext->GetList(pref_key, &out))
return false;
*out_value = out;
return out_value != NULL;
}
| 17,895 |
80,078 | 0 | GF_Err edts_Read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_box_array_read(s, bs, edts_AddBox);
}
| 17,896 |
182,025 | 1 | static MagickBooleanType SkipDXTMipmaps(Image *image,DDSInfo *dds_info,
int texel_size,ExceptionInfo *exception)
{
register ssize_t
i;
MagickOffsetType
offset;
size_t
h,
w;
/*
Only skip mipmaps for textures and cube maps
*/
if (EOFBlob(image) != MagickFalse)
{
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
image->filename);
return(MagickFalse);
}
if (dds_info->ddscaps1 & DDSCAPS_MIPMAP
&& (dds_info->ddscaps1 & DDSCAPS_TEXTURE
|| dds_info->ddscaps2 & DDSCAPS2_CUBEMAP))
{
w = DIV2(dds_info->width);
h = DIV2(dds_info->height);
/*
Mipmapcount includes the main image, so start from one
*/
for (i = 1; (i < (ssize_t) dds_info->mipmapcount) && w && h; i++)
{
offset = (MagickOffsetType) ((w + 3) / 4) * ((h + 3) / 4) * texel_size;
(void) SeekBlob(image, offset, SEEK_CUR);
w = DIV2(w);
h = DIV2(h);
}
}
return(MagickTrue);
}
| 17,897 |
30,219 | 0 | static void ftrace_run_update_code(int command)
{
int ret;
ret = ftrace_arch_code_modify_prepare();
FTRACE_WARN_ON(ret);
if (ret)
return;
/*
* Do not call function tracer while we update the code.
* We are in stop machine.
*/
function_trace_stop++;
/*
* By default we use stop_machine() to modify the code.
* But archs can do what ever they want as long as it
* is safe. The stop_machine() is the safest, but also
* produces the most overhead.
*/
arch_ftrace_update_code(command);
function_trace_stop--;
ret = ftrace_arch_code_modify_post_process();
FTRACE_WARN_ON(ret);
}
| 17,898 |
157,830 | 0 | void WebContentsImpl::PasteAndMatchStyle() {
RenderFrameHostImpl* focused_frame = GetFocusedFrame();
if (!focused_frame)
return;
focused_frame->GetFrameInputHandler()->PasteAndMatchStyle();
RecordAction(base::UserMetricsAction("PasteAndMatchStyle"));
}
| 17,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.