unique_id
int64 13
189k
| target
int64 0
1
| code
stringlengths 20
241k
| __index_level_0__
int64 0
18.9k
|
---|---|---|---|
35,569 | 0 | void emulator_invalidate_register_cache(struct x86_emulate_ctxt *ctxt)
{
invalidate_registers(ctxt);
}
| 18,500 |
88,966 | 0 | MagickExport Image *ForwardFourierTransformImage(const Image *image,
const MagickBooleanType modulus,ExceptionInfo *exception)
{
Image
*fourier_image;
fourier_image=NewImageList();
#if !defined(MAGICKCORE_FFTW_DELEGATE)
(void) modulus;
(void) ThrowMagickException(exception,GetMagickModule(),
MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","`%s' (FFTW)",
image->filename);
#else
{
Image
*magnitude_image;
size_t
height,
width;
width=image->columns;
height=image->rows;
if ((image->columns != image->rows) || ((image->columns % 2) != 0) ||
((image->rows % 2) != 0))
{
size_t extent=image->columns < image->rows ? image->rows :
image->columns;
width=(extent & 0x01) == 1 ? extent+1UL : extent;
}
height=width;
magnitude_image=CloneImage(image,width,height,MagickTrue,exception);
if (magnitude_image != (Image *) NULL)
{
Image
*phase_image;
magnitude_image->storage_class=DirectClass;
magnitude_image->depth=32UL;
phase_image=CloneImage(image,width,height,MagickTrue,exception);
if (phase_image == (Image *) NULL)
magnitude_image=DestroyImage(magnitude_image);
else
{
MagickBooleanType
is_gray,
status;
phase_image->storage_class=DirectClass;
phase_image->depth=32UL;
AppendImageToList(&fourier_image,magnitude_image);
AppendImageToList(&fourier_image,phase_image);
status=MagickTrue;
is_gray=IsImageGray(image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel sections
#endif
{
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp section
#endif
{
MagickBooleanType
thread_status;
if (is_gray != MagickFalse)
thread_status=ForwardFourierTransformChannel(image,
GrayPixelChannel,modulus,fourier_image,exception);
else
thread_status=ForwardFourierTransformChannel(image,
RedPixelChannel,modulus,fourier_image,exception);
if (thread_status == MagickFalse)
status=thread_status;
}
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp section
#endif
{
MagickBooleanType
thread_status;
thread_status=MagickTrue;
if (is_gray == MagickFalse)
thread_status=ForwardFourierTransformChannel(image,
GreenPixelChannel,modulus,fourier_image,exception);
if (thread_status == MagickFalse)
status=thread_status;
}
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp section
#endif
{
MagickBooleanType
thread_status;
thread_status=MagickTrue;
if (is_gray == MagickFalse)
thread_status=ForwardFourierTransformChannel(image,
BluePixelChannel,modulus,fourier_image,exception);
if (thread_status == MagickFalse)
status=thread_status;
}
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp section
#endif
{
MagickBooleanType
thread_status;
thread_status=MagickTrue;
if (image->colorspace == CMYKColorspace)
thread_status=ForwardFourierTransformChannel(image,
BlackPixelChannel,modulus,fourier_image,exception);
if (thread_status == MagickFalse)
status=thread_status;
}
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp section
#endif
{
MagickBooleanType
thread_status;
thread_status=MagickTrue;
if (image->alpha_trait != UndefinedPixelTrait)
thread_status=ForwardFourierTransformChannel(image,
AlphaPixelChannel,modulus,fourier_image,exception);
if (thread_status == MagickFalse)
status=thread_status;
}
}
if (status == MagickFalse)
fourier_image=DestroyImageList(fourier_image);
fftw_cleanup();
}
}
}
#endif
return(fourier_image);
}
| 18,501 |
168,405 | 0 | int TestBrowserWindow::GetRenderViewHeightInsetWithDetachedBookmarkBar() {
return 0;
}
| 18,502 |
80,064 | 0 | GF_Err dmed_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_DMEDBox *ptr = (GF_DMEDBox *)s;
if (ptr == NULL) return GF_BAD_PARAM;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
gf_bs_write_u64(bs, ptr->nbBytes);
return GF_OK;
}
| 18,503 |
6,335 | 0 | static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
{
/* Checking configure timezone */
if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
return DATEG(timezone);
}
/* Check config setting for default timezone */
if (!DATEG(default_timezone)) {
/* Special case: ext/date wasn't initialized yet */
zval ztz;
if (SUCCESS == zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz)
&& Z_TYPE(ztz) == IS_STRING && Z_STRLEN(ztz) > 0 && timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
return Z_STRVAL(ztz);
}
} else if (*DATEG(default_timezone)) {
if (DATEG(timezone_valid) == 1) {
return DATEG(default_timezone);
}
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
return "UTC";
}
DATEG(timezone_valid) = 1;
return DATEG(default_timezone);
}
/* Fallback to UTC */
php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
return "UTC";
}
| 18,504 |
55,344 | 0 | static void atl2_setup_mac_ctrl(struct atl2_adapter *adapter)
{
u32 value;
struct atl2_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev;
/* Config MAC CTRL Register */
value = MAC_CTRL_TX_EN | MAC_CTRL_RX_EN | MAC_CTRL_MACLP_CLK_PHY;
/* duplex */
if (FULL_DUPLEX == adapter->link_duplex)
value |= MAC_CTRL_DUPLX;
/* flow control */
value |= (MAC_CTRL_TX_FLOW | MAC_CTRL_RX_FLOW);
/* PAD & CRC */
value |= (MAC_CTRL_ADD_CRC | MAC_CTRL_PAD);
/* preamble length */
value |= (((u32)adapter->hw.preamble_len & MAC_CTRL_PRMLEN_MASK) <<
MAC_CTRL_PRMLEN_SHIFT);
/* vlan */
__atl2_vlan_mode(netdev->features, &value);
/* filter mode */
value |= MAC_CTRL_BC_EN;
if (netdev->flags & IFF_PROMISC)
value |= MAC_CTRL_PROMIS_EN;
else if (netdev->flags & IFF_ALLMULTI)
value |= MAC_CTRL_MC_ALL_EN;
/* half retry buffer */
value |= (((u32)(adapter->hw.retry_buf &
MAC_CTRL_HALF_LEFT_BUF_MASK)) << MAC_CTRL_HALF_LEFT_BUF_SHIFT);
ATL2_WRITE_REG(hw, REG_MAC_CTRL, value);
}
| 18,505 |
166,499 | 0 | void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line,
int child_process_id) {
#if defined(OS_MACOSX)
std::unique_ptr<metrics::ClientInfo> client_info =
GoogleUpdateSettings::LoadMetricsClientInfo();
if (client_info) {
command_line->AppendSwitchASCII(switches::kMetricsClientID,
client_info->client_id);
}
#elif defined(OS_POSIX)
if (breakpad::IsCrashReporterEnabled()) {
std::string switch_value;
std::unique_ptr<metrics::ClientInfo> client_info =
GoogleUpdateSettings::LoadMetricsClientInfo();
if (client_info)
switch_value = client_info->client_id;
switch_value.push_back(',');
switch_value.append(chrome::GetChannelName());
command_line->AppendSwitchASCII(switches::kEnableCrashReporter,
switch_value);
}
#endif
if (logging::DialogsAreSuppressed())
command_line->AppendSwitch(switches::kNoErrorDialogs);
std::string process_type =
command_line->GetSwitchValueASCII(switches::kProcessType);
const base::CommandLine& browser_command_line =
*base::CommandLine::ForCurrentProcess();
static const char* const kCommonSwitchNames[] = {
switches::kUserAgent,
switches::kUserDataDir, // Make logs go to the right file.
};
command_line->CopySwitchesFrom(browser_command_line, kCommonSwitchNames,
arraysize(kCommonSwitchNames));
static const char* const kDinosaurEasterEggSwitches[] = {
error_page::switches::kDisableDinosaurEasterEgg,
};
command_line->CopySwitchesFrom(browser_command_line,
kDinosaurEasterEggSwitches,
arraysize(kDinosaurEasterEggSwitches));
#if defined(OS_CHROMEOS)
base::FilePath homedir;
base::PathService::Get(base::DIR_HOME, &homedir);
command_line->AppendSwitchASCII(chromeos::switches::kHomedir,
homedir.value().c_str());
#endif
if (process_type == switches::kRendererProcess) {
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(child_process_id);
Profile* profile =
process ? Profile::FromBrowserContext(process->GetBrowserContext())
: NULL;
for (size_t i = 0; i < extra_parts_.size(); ++i) {
extra_parts_[i]->AppendExtraRendererCommandLineSwitches(
command_line, process, profile);
}
#if defined(OS_CHROMEOS)
const std::string& login_profile =
browser_command_line.GetSwitchValueASCII(
chromeos::switches::kLoginProfile);
if (!login_profile.empty())
command_line->AppendSwitchASCII(
chromeos::switches::kLoginProfile, login_profile);
#endif
MaybeCopyDisableWebRtcEncryptionSwitch(command_line,
browser_command_line,
chrome::GetChannel());
if (process) {
PrefService* prefs = profile->GetPrefs();
if (prefs->HasPrefPath(prefs::kDisable3DAPIs) &&
prefs->GetBoolean(prefs::kDisable3DAPIs)) {
command_line->AppendSwitch(switches::kDisable3DAPIs);
}
const base::ListValue* switches =
prefs->GetList(prefs::kEnableDeprecatedWebPlatformFeatures);
if (switches) {
for (auto it = switches->begin(); it != switches->end(); ++it) {
std::string switch_to_enable;
if (it->GetAsString(&switch_to_enable))
command_line->AppendSwitch(switch_to_enable);
}
}
if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) ||
!g_browser_process->safe_browsing_detection_service()) {
command_line->AppendSwitch(
switches::kDisableClientSidePhishingDetection);
}
if (prefs->GetBoolean(prefs::kPrintPreviewDisabled))
command_line->AppendSwitch(switches::kDisablePrintPreview);
#if !defined(OS_ANDROID)
InstantService* instant_service =
InstantServiceFactory::GetForProfile(profile);
if (instant_service &&
instant_service->IsInstantProcess(process->GetID())) {
command_line->AppendSwitch(switches::kInstantProcess);
}
#endif
if (prefs->HasPrefPath(prefs::kAllowDinosaurEasterEgg) &&
!prefs->GetBoolean(prefs::kAllowDinosaurEasterEgg)) {
command_line->AppendSwitch(
error_page::switches::kDisableDinosaurEasterEgg);
}
if (prefs->HasPrefPath(prefs::kUnsafelyTreatInsecureOriginAsSecure)) {
command_line->AppendSwitchASCII(
switches::kUnsafelyTreatInsecureOriginAsSecure,
prefs->GetString(prefs::kUnsafelyTreatInsecureOriginAsSecure));
}
}
if (IsAutoReloadEnabled())
command_line->AppendSwitch(switches::kEnableOfflineAutoReload);
if (IsAutoReloadVisibleOnlyEnabled()) {
command_line->AppendSwitch(
switches::kEnableOfflineAutoReloadVisibleOnly);
}
{
const std::string& show_saved_copy_value =
browser_command_line.GetSwitchValueASCII(
error_page::switches::kShowSavedCopy);
if (show_saved_copy_value ==
error_page::switches::kEnableShowSavedCopyPrimary ||
show_saved_copy_value ==
error_page::switches::kEnableShowSavedCopySecondary ||
show_saved_copy_value ==
error_page::switches::kDisableShowSavedCopy) {
command_line->AppendSwitchASCII(error_page::switches::kShowSavedCopy,
show_saved_copy_value);
}
}
MaybeAppendBlinkSettingsSwitchForFieldTrial(
browser_command_line, command_line);
#if defined(OS_ANDROID)
command_line->AppendSwitch(switches::kEnableDistillabilityService);
#endif
static const char* const kSwitchNames[] = {
autofill::switches::kEnableSuggestionsWithSubstringMatch,
autofill::switches::kIgnoreAutocompleteOffForAutofill,
autofill::switches::kShowAutofillSignatures,
#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::switches::kAllowHTTPBackgroundPage,
extensions::switches::kAllowLegacyExtensionManifests,
extensions::switches::kDisableExtensionsHttpThrottling,
extensions::switches::kEnableEmbeddedExtensionOptions,
extensions::switches::kEnableExperimentalExtensionApis,
extensions::switches::kExtensionsOnChromeURLs,
extensions::switches::kSetExtensionThrottleTestParams, // For tests only.
extensions::switches::kWhitelistedExtensionID,
#endif
switches::kAllowInsecureLocalhost,
switches::kAppsGalleryURL,
switches::kCloudPrintURL,
switches::kCloudPrintXmppEndpoint,
switches::kDisableBundledPpapiFlash,
switches::kDisableCastStreamingHWEncoding,
switches::kDisableJavaScriptHarmonyShipping,
variations::switches::kEnableBenchmarking,
switches::kEnableDistillabilityService,
switches::kEnableNaCl,
#if BUILDFLAG(ENABLE_NACL)
switches::kEnableNaClDebug,
switches::kEnableNaClNonSfiMode,
#endif
switches::kEnableNetBenchmarking,
#if BUILDFLAG(ENABLE_NACL)
switches::kForcePNaClSubzero,
#endif
switches::kForceUIDirection,
switches::kJavaScriptHarmony,
switches::kOriginTrialDisabledFeatures,
switches::kOriginTrialDisabledTokens,
switches::kOriginTrialPublicKey,
switches::kPpapiFlashArgs,
switches::kPpapiFlashPath,
switches::kPpapiFlashVersion,
switches::kReaderModeHeuristics,
translate::switches::kTranslateSecurityOrigin,
};
command_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
arraysize(kSwitchNames));
} else if (process_type == switches::kUtilityProcess) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
static const char* const kSwitchNames[] = {
extensions::switches::kAllowHTTPBackgroundPage,
extensions::switches::kEnableExperimentalExtensionApis,
extensions::switches::kExtensionsOnChromeURLs,
extensions::switches::kWhitelistedExtensionID,
};
command_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
arraysize(kSwitchNames));
#endif
} else if (process_type == service_manager::switches::kZygoteProcess) {
static const char* const kSwitchNames[] = {
switches::kDisableBundledPpapiFlash,
#if BUILDFLAG(ENABLE_NACL)
switches::kEnableNaClDebug,
switches::kEnableNaClNonSfiMode,
switches::kForcePNaClSubzero,
switches::kNaClDangerousNoSandboxNonSfi,
#endif
switches::kPpapiFlashPath,
switches::kPpapiFlashVersion,
};
command_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
arraysize(kSwitchNames));
} else if (process_type == switches::kGpuProcess) {
if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) &&
!command_line->HasSwitch(switches::kDisableBreakpad))
command_line->AppendSwitch(switches::kDisableBreakpad);
}
StackSamplingConfiguration::Get()->AppendCommandLineSwitchForChildProcess(
process_type,
command_line);
}
| 18,506 |
118,285 | 0 | void AutofillDialogViews::OnWidgetClosing(views::Widget* widget) {
observer_.Remove(widget);
if (error_bubble_ && error_bubble_->GetWidget() == widget)
error_bubble_ = NULL;
}
| 18,507 |
56,676 | 0 | void *ext4_kvzalloc(size_t size, gfp_t flags)
{
void *ret;
ret = kzalloc(size, flags | __GFP_NOWARN);
if (!ret)
ret = __vmalloc(size, flags | __GFP_ZERO, PAGE_KERNEL);
return ret;
}
| 18,508 |
89,552 | 0 | static int SWFInput_file_read(SWFInput input, unsigned char *buffer, int count)
{ int len = fread(buffer, 1, count, (FILE *)input->data);
input->offset += len;
return len;
}
| 18,509 |
63,227 | 0 | void _WM_do_control_channel_hold(struct _mdi *mdi, struct _event_data *data) {
struct _note *note_data = mdi->note;
uint8_t ch = data->channel;
MIDI_EVENT_DEBUG(__FUNCTION__,ch, data->data.value);
if (data->data.value > 63) {
mdi->channel[ch].hold = 1;
} else {
mdi->channel[ch].hold = 0;
if (note_data) {
do {
if ((note_data->noteid >> 8) == ch) {
if (note_data->hold & HOLD_OFF) {
if (note_data->modes & SAMPLE_ENVELOPE) {
if (note_data->modes & SAMPLE_CLAMPED) {
if (note_data->env < 5) {
note_data->env = 5;
if (note_data->env_level
> note_data->sample->env_target[5]) {
note_data->env_inc =
-note_data->sample->env_rate[5];
} else {
note_data->env_inc =
note_data->sample->env_rate[5];
}
}
/*
} else if (note_data->modes & SAMPLE_SUSTAIN) {
if (note_data->env < 3) {
note_data->env = 3;
if (note_data->env_level
> note_data->sample->env_target[3]) {
note_data->env_inc =
-note_data->sample->env_rate[3];
} else {
note_data->env_inc =
note_data->sample->env_rate[3];
}
}
*/
} else if (note_data->env < 3) {
note_data->env = 3;
if (note_data->env_level
> note_data->sample->env_target[3]) {
note_data->env_inc =
-note_data->sample->env_rate[3];
} else {
note_data->env_inc =
note_data->sample->env_rate[3];
}
}
} else {
if (note_data->modes & SAMPLE_LOOP) {
note_data->modes ^= SAMPLE_LOOP;
}
note_data->env_inc = 0;
}
}
note_data->hold = 0x00;
}
note_data = note_data->next;
} while (note_data);
}
}
}
| 18,510 |
149,479 | 0 | void ContentSecurityPolicy::setOverrideURLForSelf(const KURL& url) {
RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url);
m_selfProtocol = origin->protocol();
m_selfSource =
new CSPSource(this, m_selfProtocol, origin->host(), origin->port(),
String(), CSPSource::NoWildcard, CSPSource::NoWildcard);
}
| 18,511 |
165,699 | 0 | std::wstring UTF8ToUTF16(const std::string& source) {
if (source.empty() ||
static_cast<int>(source.size()) > std::numeric_limits<int>::max()) {
return std::wstring();
}
int size = ::MultiByteToWideChar(CP_UTF8, 0, &source[0],
static_cast<int>(source.size()), nullptr, 0);
std::wstring result(size, L'\0');
if (::MultiByteToWideChar(CP_UTF8, 0, &source[0],
static_cast<int>(source.size()), &result[0],
size) != size) {
assert(false);
return std::wstring();
}
return result;
}
| 18,512 |
35,781 | 0 | void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
{
/* Address WBINVD may be executed by guest */
if (need_emulate_wbinvd(vcpu)) {
if (kvm_x86_ops->has_wbinvd_exit())
cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask);
else if (vcpu->cpu != -1 && vcpu->cpu != cpu)
smp_call_function_single(vcpu->cpu,
wbinvd_ipi, NULL, 1);
}
kvm_x86_ops->vcpu_load(vcpu, cpu);
/* Apply any externally detected TSC adjustments (due to suspend) */
if (unlikely(vcpu->arch.tsc_offset_adjustment)) {
adjust_tsc_offset_host(vcpu, vcpu->arch.tsc_offset_adjustment);
vcpu->arch.tsc_offset_adjustment = 0;
kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
}
if (unlikely(vcpu->cpu != cpu) || check_tsc_unstable()) {
s64 tsc_delta = !vcpu->arch.last_host_tsc ? 0 :
native_read_tsc() - vcpu->arch.last_host_tsc;
if (tsc_delta < 0)
mark_tsc_unstable("KVM discovered backwards TSC");
if (check_tsc_unstable()) {
u64 offset = kvm_x86_ops->compute_tsc_offset(vcpu,
vcpu->arch.last_guest_tsc);
kvm_x86_ops->write_tsc_offset(vcpu, offset);
vcpu->arch.tsc_catchup = 1;
}
/*
* On a host with synchronized TSC, there is no need to update
* kvmclock on vcpu->cpu migration
*/
if (!vcpu->kvm->arch.use_master_clock || vcpu->cpu == -1)
kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu);
if (vcpu->cpu != cpu)
kvm_migrate_timers(vcpu);
vcpu->cpu = cpu;
}
accumulate_steal_time(vcpu);
kvm_make_request(KVM_REQ_STEAL_UPDATE, vcpu);
}
| 18,513 |
162,893 | 0 | void ProfilingService::OnStart() {
ref_factory_.reset(new service_manager::ServiceContextRefFactory(base::Bind(
&ProfilingService::MaybeRequestQuitDelayed, base::Unretained(this))));
registry_.AddInterface(
base::Bind(&ProfilingService::OnProfilingServiceRequest,
base::Unretained(this), ref_factory_.get()));
}
| 18,514 |
40,661 | 0 | static void prb_thaw_queue(struct tpacket_kbdq_core *pkc)
{
pkc->reset_pending_on_curr_blk = 0;
}
| 18,515 |
103,840 | 0 | void RenderView::OnSwapOut(const ViewMsg_SwapOut_Params& params) {
if (is_swapped_out_)
return;
SyncNavigationState();
webview()->dispatchUnloadEvent();
SetSwappedOut(true);
webview()->mainFrame()->loadHTMLString(std::string(),
GURL("about:swappedout"),
GURL("about:swappedout"),
false);
Send(new ViewHostMsg_SwapOut_ACK(routing_id_, params));
}
| 18,516 |
148,925 | 0 | RenderFrameHostManager::~RenderFrameHostManager() {
if (pending_render_frame_host_)
UnsetPendingRenderFrameHost();
if (speculative_render_frame_host_)
UnsetSpeculativeRenderFrameHost();
ResetProxyHosts();
SetRenderFrameHost(std::unique_ptr<RenderFrameHostImpl>());
}
| 18,517 |
167,787 | 0 | void WebRuntimeFeatures::EnableWebBluetooth(bool enable) {
RuntimeEnabledFeatures::SetWebBluetoothEnabled(enable);
}
| 18,518 |
101,794 | 0 | void Browser::SaveWindowPlacement(const gfx::Rect& bounds,
ui::WindowShowState show_state) {
SessionService* session_service =
SessionServiceFactory::GetForProfileIfExisting(profile());
if (session_service)
session_service->SetWindowBounds(session_id_, bounds, show_state);
}
| 18,519 |
45,535 | 0 | static void authenc_esn_geniv_ahash_update_done(struct crypto_async_request *areq,
int err)
{
struct aead_request *req = areq->data;
struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn);
struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
struct ahash_request *ahreq = (void *)(areq_ctx->tail + ctx->reqoff);
if (err)
goto out;
ahash_request_set_crypt(ahreq, areq_ctx->sg, ahreq->result,
areq_ctx->cryptlen);
ahash_request_set_callback(ahreq, aead_request_flags(req) &
CRYPTO_TFM_REQ_MAY_SLEEP,
areq_ctx->update_complete2, req);
err = crypto_ahash_update(ahreq);
if (err)
goto out;
ahash_request_set_crypt(ahreq, areq_ctx->tsg, ahreq->result,
areq_ctx->trailen);
ahash_request_set_callback(ahreq, aead_request_flags(req) &
CRYPTO_TFM_REQ_MAY_SLEEP,
areq_ctx->complete, req);
err = crypto_ahash_finup(ahreq);
if (err)
goto out;
scatterwalk_map_and_copy(ahreq->result, areq_ctx->sg,
areq_ctx->cryptlen,
crypto_aead_authsize(authenc_esn), 1);
out:
authenc_esn_request_complete(req, err);
}
| 18,520 |
9,981 | 0 | void TIFF_MetaHandler::UpdateFile ( bool doSafeUpdate )
{
XMP_Assert ( ! doSafeUpdate ); // This should only be called for "unsafe" updates.
XMP_IO* destRef = this->parent->ioRef;
XMP_AbortProc abortProc = this->parent->abortProc;
void * abortArg = this->parent->abortArg;
XMP_Int64 oldPacketOffset = this->packetInfo.offset;
XMP_Int32 oldPacketLength = this->packetInfo.length;
if ( oldPacketOffset == kXMPFiles_UnknownOffset ) oldPacketOffset = 0; // ! Simplify checks.
if ( oldPacketLength == kXMPFiles_UnknownLength ) oldPacketLength = 0;
bool fileHadXMP = ((oldPacketOffset != 0) && (oldPacketLength != 0));
ExportPhotoData ( kXMP_TIFFFile, &this->xmpObj, &this->tiffMgr, this->iptcMgr, this->psirMgr );
try {
XMP_OptionBits options = kXMP_UseCompactFormat;
if ( fileHadXMP ) options |= kXMP_ExactPacketLength;
this->xmpObj.SerializeToBuffer ( &this->xmpPacket, options, oldPacketLength );
} catch ( ... ) {
this->xmpObj.SerializeToBuffer ( &this->xmpPacket, kXMP_UseCompactFormat );
}
bool doInPlace = (fileHadXMP && (this->xmpPacket.size() <= (size_t)oldPacketLength));
if ( this->tiffMgr.IsLegacyChanged() ) doInPlace = false;
bool localProgressTracking = false;
XMP_ProgressTracker* progressTracker = this->parent->progressTracker;
if ( ! doInPlace ) {
#if GatherPerformanceData
sAPIPerf->back().extraInfo += ", TIFF append update";
#endif
if ( (progressTracker != 0) && (! progressTracker->WorkInProgress()) ) {
localProgressTracking = true;
progressTracker->BeginWork();
}
this->tiffMgr.SetTag ( kTIFF_PrimaryIFD, kTIFF_XMP, kTIFF_UndefinedType, (XMP_Uns32)this->xmpPacket.size(), this->xmpPacket.c_str() );
this->tiffMgr.UpdateFileStream ( destRef, progressTracker );
} else {
#if GatherPerformanceData
sAPIPerf->back().extraInfo += ", TIFF in-place update";
#endif
if ( this->xmpPacket.size() < (size_t)this->packetInfo.length ) {
size_t extraSpace = (size_t)this->packetInfo.length - this->xmpPacket.size();
this->xmpPacket.append ( extraSpace, ' ' );
}
XMP_IO* liveFile = this->parent->ioRef;
XMP_Assert ( this->xmpPacket.size() == (size_t)oldPacketLength ); // ! Done by common PutXMP logic.
if ( progressTracker != 0 ) {
if ( progressTracker->WorkInProgress() ) {
progressTracker->AddTotalWork ( this->xmpPacket.size() );
} else {
localProgressTracking = true;
progressTracker->BeginWork ( this->xmpPacket.size() );
}
}
liveFile->Seek ( oldPacketOffset, kXMP_SeekFromStart );
liveFile->Write ( this->xmpPacket.c_str(), (XMP_Int32)this->xmpPacket.size() );
}
if ( localProgressTracking ) progressTracker->WorkComplete();
this->needsUpdate = false;
} // TIFF_MetaHandler::UpdateFile
| 18,521 |
149,421 | 0 | bool ContentSecurityPolicy::allowStyleFromSource(
const KURL& url,
const String& nonce,
RedirectStatus redirectStatus,
SecurityViolationReportingPolicy reportingPolicy) const {
if (shouldBypassContentSecurityPolicy(url, SchemeRegistry::PolicyAreaStyle))
return true;
return isAllowedByAll<&CSPDirectiveList::allowStyleFromSource>(
m_policies, url, nonce, redirectStatus, reportingPolicy);
}
| 18,522 |
138,291 | 0 | void AXObjectCacheImpl::updateCacheAfterNodeIsAttached(Node* node) {
get(node);
if (node->isElementNode())
updateTreeIfElementIdIsAriaOwned(toElement(node));
}
| 18,523 |
121,597 | 0 | static inline void foldQuoteMarksAndSoftHyphens(UChar* data, size_t length)
{
for (size_t i = 0; i < length; ++i)
data[i] = foldQuoteMarkOrSoftHyphen(data[i]);
}
| 18,524 |
95,665 | 0 | static float CL_DemoFrameDurationSDev( void )
{
int i;
int numFrames;
float mean = 0.0f;
float variance = 0.0f;
if( ( clc.timeDemoFrames - 1 ) > MAX_TIMEDEMO_DURATIONS )
numFrames = MAX_TIMEDEMO_DURATIONS;
else
numFrames = clc.timeDemoFrames - 1;
for( i = 0; i < numFrames; i++ )
mean += clc.timeDemoDurations[ i ];
mean /= numFrames;
for( i = 0; i < numFrames; i++ )
{
float x = clc.timeDemoDurations[ i ];
variance += ( ( x - mean ) * ( x - mean ) );
}
variance /= numFrames;
return sqrt( variance );
}
| 18,525 |
36,097 | 0 | isofs_hash_ms(const struct dentry *dentry, struct qstr *qstr)
{
return isofs_hash_common(qstr, 1);
}
| 18,526 |
1,378 | 0 | XcursorFileLoadImages (FILE *file, int size)
{
XcursorFile f;
if (!file)
return NULL;
_XcursorStdioFileInitialize (file, &f);
return XcursorXcFileLoadImages (&f, size);
}
| 18,527 |
28,405 | 0 | static int fib6_dump_done(struct netlink_callback *cb)
{
fib6_dump_end(cb);
return cb->done ? cb->done(cb) : 0;
}
| 18,528 |
107,261 | 0 | void PopulateProxyConfig(const DictionaryValue& dict, net::ProxyConfig* pc) {
DCHECK(pc);
bool no_proxy = false;
if (dict.GetBoolean(automation::kJSONProxyNoProxy, &no_proxy)) {
return;
}
bool auto_config;
if (dict.GetBoolean(automation::kJSONProxyAutoconfig, &auto_config)) {
pc->set_auto_detect(true);
}
std::string pac_url;
if (dict.GetString(automation::kJSONProxyPacUrl, &pac_url)) {
pc->set_pac_url(GURL(pac_url));
}
std::string proxy_bypass_list;
if (dict.GetString(automation::kJSONProxyBypassList, &proxy_bypass_list)) {
pc->proxy_rules().bypass_rules.ParseFromString(proxy_bypass_list);
}
std::string proxy_server;
if (dict.GetString(automation::kJSONProxyServer, &proxy_server)) {
pc->proxy_rules().ParseFromString(proxy_server);
}
}
| 18,529 |
116,083 | 0 | void SyncManager::DoneRefreshNigori(const base::Closure& done_callback,
bool is_ready) {
if (is_ready)
data_->RefreshEncryption();
done_callback.Run();
}
| 18,530 |
32,555 | 0 | static void tg3_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
struct tg3 *tp = netdev_priv(dev);
strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
strlcpy(info->fw_version, tp->fw_ver, sizeof(info->fw_version));
strlcpy(info->bus_info, pci_name(tp->pdev), sizeof(info->bus_info));
}
| 18,531 |
126,567 | 0 | void TabStripGtk::SchedulePaint() {
gtk_widget_queue_draw(tabstrip_.get());
}
| 18,532 |
80,360 | 0 | GF_Err rtp_hnti_Size(GF_Box *s)
{
GF_RTPBox *ptr = (GF_RTPBox *)s;
ptr->size += 4 + strlen(ptr->sdpText);
return GF_OK;
}
| 18,533 |
42,997 | 0 | static void virtnet_free_queues(struct virtnet_info *vi)
{
int i;
for (i = 0; i < vi->max_queue_pairs; i++) {
napi_hash_del(&vi->rq[i].napi);
netif_napi_del(&vi->rq[i].napi);
}
kfree(vi->rq);
kfree(vi->sq);
}
| 18,534 |
123,752 | 0 | MemoryMappedFile::MemoryMappedFile()
: file_(base::kInvalidPlatformFileValue),
data_(NULL),
length_(0) {
}
| 18,535 |
90,728 | 0 | static void emit(JF, int value)
{
emitraw(J, F, F->lastline);
emitraw(J, F, value);
}
| 18,536 |
45,041 | 0 | static int task_switch_16(struct x86_emulate_ctxt *ctxt,
u16 tss_selector, u16 old_tss_sel,
ulong old_tss_base, struct desc_struct *new_desc)
{
const struct x86_emulate_ops *ops = ctxt->ops;
struct tss_segment_16 tss_seg;
int ret;
u32 new_tss_base = get_desc_base(new_desc);
ret = ops->read_std(ctxt, old_tss_base, &tss_seg, sizeof tss_seg,
&ctxt->exception);
if (ret != X86EMUL_CONTINUE)
return ret;
save_state_to_tss16(ctxt, &tss_seg);
ret = ops->write_std(ctxt, old_tss_base, &tss_seg, sizeof tss_seg,
&ctxt->exception);
if (ret != X86EMUL_CONTINUE)
return ret;
ret = ops->read_std(ctxt, new_tss_base, &tss_seg, sizeof tss_seg,
&ctxt->exception);
if (ret != X86EMUL_CONTINUE)
return ret;
if (old_tss_sel != 0xffff) {
tss_seg.prev_task_link = old_tss_sel;
ret = ops->write_std(ctxt, new_tss_base,
&tss_seg.prev_task_link,
sizeof tss_seg.prev_task_link,
&ctxt->exception);
if (ret != X86EMUL_CONTINUE)
return ret;
}
return load_state_from_tss16(ctxt, &tss_seg);
}
| 18,537 |
184,032 | 1 | EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestInterface::s_info))
return throwVMTypeError(exec);
JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestInterface::s_info);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
if (exec->argumentCount() < 2)
return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
ExceptionCode ec = 0;
ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
if (!scriptContext)
return JSValue::encode(jsUndefined());
const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(impl, scriptContext, strArg, objArg, ec)));
setDOMException(exec, ec);
return JSValue::encode(result);
}
| 18,538 |
77,558 | 0 | ofputil_encode_bundle_ctrl_request(enum ofp_version ofp_version,
struct ofputil_bundle_ctrl_msg *bc)
{
struct ofpbuf *request;
struct ofp14_bundle_ctrl_msg *m;
switch (ofp_version) {
case OFP10_VERSION:
case OFP11_VERSION:
case OFP12_VERSION:
ovs_fatal(0, "bundles need OpenFlow 1.3 or later "
"(\'-O OpenFlow14\')");
case OFP13_VERSION:
case OFP14_VERSION:
case OFP15_VERSION:
case OFP16_VERSION:
request = ofpraw_alloc(ofp_version == OFP13_VERSION
? OFPRAW_ONFT13_BUNDLE_CONTROL
: OFPRAW_OFPT14_BUNDLE_CONTROL, ofp_version, 0);
m = ofpbuf_put_zeros(request, sizeof *m);
m->bundle_id = htonl(bc->bundle_id);
m->type = htons(bc->type);
m->flags = htons(bc->flags);
break;
default:
OVS_NOT_REACHED();
}
return request;
}
| 18,539 |
1,298 | 0 | SplashError Splash::xorFill(SplashPath *path, GBool eo) {
SplashPipe pipe;
SplashXPath *xPath;
SplashXPathScanner *scanner;
int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y;
SplashClipResult clipRes, clipRes2;
SplashBlendFunc origBlendFunc;
if (path->length == 0) {
return splashErrEmptyPath;
}
xPath = new SplashXPath(path, state->matrix, state->flatness, gTrue);
xPath->sort();
scanner = new SplashXPathScanner(xPath, eo);
scanner->getBBox(&xMinI, &yMinI, &xMaxI, &yMaxI);
if ((clipRes = state->clip->testRect(xMinI, yMinI, xMaxI, yMaxI))
!= splashClipAllOutside) {
if (yMinI < state->clip->getYMinI()) {
yMinI = state->clip->getYMinI();
}
if (yMaxI > state->clip->getYMaxI()) {
yMaxI = state->clip->getYMaxI();
}
origBlendFunc = state->blendFunc;
state->blendFunc = &blendXor;
pipeInit(&pipe, 0, yMinI, state->fillPattern, NULL, 1, gFalse, gFalse);
for (y = yMinI; y <= yMaxI; ++y) {
while (scanner->getNextSpan(y, &x0, &x1)) {
if (clipRes == splashClipAllInside) {
drawSpan(&pipe, x0, x1, y, gTrue);
} else {
if (x0 < state->clip->getXMinI()) {
x0 = state->clip->getXMinI();
}
if (x1 > state->clip->getXMaxI()) {
x1 = state->clip->getXMaxI();
}
clipRes2 = state->clip->testSpan(x0, x1, y);
drawSpan(&pipe, x0, x1, y, clipRes2 == splashClipAllInside);
}
}
}
state->blendFunc = origBlendFunc;
}
opClipRes = clipRes;
delete scanner;
delete xPath;
return splashOk;
}
| 18,540 |
134,780 | 0 | void EventConverterEvdevImpl::ReleaseMouseButtons() {
base::TimeDelta timestamp = ui::EventTimeForNow();
for (int code = BTN_MOUSE; code < BTN_JOYSTICK; ++code)
OnButtonChange(code, false /* down */, timestamp);
}
| 18,541 |
143,242 | 0 | MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const LayoutPoint& documentPoint, const PlatformMouseEvent& event)
{
DCHECK(!layoutView() || layoutView()->isLayoutView());
if (!layoutView() || !view() || !view()->didFirstLayout())
return MouseEventWithHitTestResults(event, HitTestResult(request, LayoutPoint()));
HitTestResult result(request, documentPoint);
layoutView()->hitTest(result);
if (!request.readOnly())
updateHoverActiveState(request, result.innerElement());
if (isHTMLCanvasElement(result.innerNode())) {
PlatformMouseEvent eventWithRegion = event;
std::pair<Element*, String> regionInfo = toHTMLCanvasElement(result.innerNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame());
if (regionInfo.first)
result.setInnerNode(regionInfo.first);
eventWithRegion.setRegion(regionInfo.second);
return MouseEventWithHitTestResults(eventWithRegion, result);
}
return MouseEventWithHitTestResults(event, result);
}
| 18,542 |
44,847 | 0 | static int uv__process_init_stdio(uv_stdio_container_t* container, int fds[2]) {
int mask;
int fd;
mask = UV_IGNORE | UV_CREATE_PIPE | UV_INHERIT_FD | UV_INHERIT_STREAM;
switch (container->flags & mask) {
case UV_IGNORE:
return 0;
case UV_CREATE_PIPE:
assert(container->data.stream != NULL);
if (container->data.stream->type != UV_NAMED_PIPE)
return -EINVAL;
else
return uv__make_socketpair(fds, 0);
case UV_INHERIT_FD:
case UV_INHERIT_STREAM:
if (container->flags & UV_INHERIT_FD)
fd = container->data.fd;
else
fd = uv__stream_fd(container->data.stream);
if (fd == -1)
return -EINVAL;
fds[1] = fd;
return 0;
default:
assert(0 && "Unexpected flags");
return -EINVAL;
}
}
| 18,543 |
166,413 | 0 | void GLClearFramebufferTest::SetDrawColor(GLfloat r,
GLfloat g,
GLfloat b,
GLfloat a) {
glUniform4f(color_handle_, r, g, b, a);
}
| 18,544 |
30,728 | 0 | static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int flags)
{
DECLARE_WAITQUEUE(wait, current);
struct sock *sk = sock->sk, *nsk;
long timeo;
int err = 0;
lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
if (sk->sk_type != SOCK_STREAM) {
err = -EINVAL;
goto done;
}
timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
BT_DBG("sk %p timeo %ld", sk, timeo);
/* Wait for an incoming connection. (wake-one). */
add_wait_queue_exclusive(sk_sleep(sk), &wait);
while (1) {
set_current_state(TASK_INTERRUPTIBLE);
if (sk->sk_state != BT_LISTEN) {
err = -EBADFD;
break;
}
nsk = bt_accept_dequeue(sk, newsock);
if (nsk)
break;
if (!timeo) {
err = -EAGAIN;
break;
}
if (signal_pending(current)) {
err = sock_intr_errno(timeo);
break;
}
release_sock(sk);
timeo = schedule_timeout(timeo);
lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
}
__set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(sk), &wait);
if (err)
goto done;
newsock->state = SS_CONNECTED;
BT_DBG("new socket %p", nsk);
done:
release_sock(sk);
return err;
}
| 18,545 |
92,264 | 0 | XML_ParserFree(XML_Parser parser)
{
TAG *tagList;
OPEN_INTERNAL_ENTITY *entityList;
if (parser == NULL)
return;
/* free m_tagStack and m_freeTagList */
tagList = parser->m_tagStack;
for (;;) {
TAG *p;
if (tagList == NULL) {
if (parser->m_freeTagList == NULL)
break;
tagList = parser->m_freeTagList;
parser->m_freeTagList = NULL;
}
p = tagList;
tagList = tagList->parent;
FREE(parser, p->buf);
destroyBindings(p->bindings, parser);
FREE(parser, p);
}
/* free m_openInternalEntities and m_freeInternalEntities */
entityList = parser->m_openInternalEntities;
for (;;) {
OPEN_INTERNAL_ENTITY *openEntity;
if (entityList == NULL) {
if (parser->m_freeInternalEntities == NULL)
break;
entityList = parser->m_freeInternalEntities;
parser->m_freeInternalEntities = NULL;
}
openEntity = entityList;
entityList = entityList->next;
FREE(parser, openEntity);
}
destroyBindings(parser->m_freeBindingList, parser);
destroyBindings(parser->m_inheritedBindings, parser);
poolDestroy(&parser->m_tempPool);
poolDestroy(&parser->m_temp2Pool);
FREE(parser, (void *)parser->m_protocolEncodingName);
#ifdef XML_DTD
/* external parameter entity parsers share the DTD structure
parser->m_dtd with the root parser, so we must not destroy it
*/
if (!parser->m_isParamEntity && parser->m_dtd)
#else
if (parser->m_dtd)
#endif /* XML_DTD */
dtdDestroy(parser->m_dtd, (XML_Bool)!parser->m_parentParser, &parser->m_mem);
FREE(parser, (void *)parser->m_atts);
#ifdef XML_ATTR_INFO
FREE(parser, (void *)parser->m_attInfo);
#endif
FREE(parser, parser->m_groupConnector);
FREE(parser, parser->m_buffer);
FREE(parser, parser->m_dataBuf);
FREE(parser, parser->m_nsAtts);
FREE(parser, parser->m_unknownEncodingMem);
if (parser->m_unknownEncodingRelease)
parser->m_unknownEncodingRelease(parser->m_unknownEncodingData);
FREE(parser, parser);
}
| 18,546 |
155,082 | 0 | const std::string& SendTabToSelfEntry::GetGUID() const {
return guid_;
}
| 18,547 |
160,564 | 0 | RenderWidgetFullscreenPepper* RenderFrameImpl::CreatePepperFullscreenContainer(
PepperPluginInstanceImpl* plugin) {
GURL active_url;
if (render_view()->webview())
active_url = render_view()->GetURLForGraphicsContext3D();
mojom::WidgetPtr widget_channel;
mojom::WidgetRequest widget_channel_request =
mojo::MakeRequest(&widget_channel);
int32_t fullscreen_widget_routing_id = MSG_ROUTING_NONE;
if (!RenderThreadImpl::current_render_message_filter()
->CreateFullscreenWidget(render_view()->routing_id(),
std::move(widget_channel),
&fullscreen_widget_routing_id)) {
return nullptr;
}
RenderWidget::ShowCallback show_callback =
base::Bind(&RenderViewImpl::ShowCreatedFullscreenWidget,
render_view()->GetWeakPtr());
RenderWidgetFullscreenPepper* widget = RenderWidgetFullscreenPepper::Create(
fullscreen_widget_routing_id, show_callback,
GetRenderWidget()->compositor_deps(), plugin, active_url,
GetRenderWidget()->screen_info(), std::move(widget_channel_request));
widget->Show(blink::kWebNavigationPolicyIgnore);
return widget;
}
| 18,548 |
127,599 | 0 | bool GetWindowManagerName(std::string* wm_name) {
DCHECK(wm_name);
int wm_window = 0;
if (!GetIntProperty(GetX11RootWindow(),
"_NET_SUPPORTING_WM_CHECK",
&wm_window)) {
return false;
}
gdk_error_trap_push();
int wm_window_property = 0;
bool result = GetIntProperty(
wm_window, "_NET_SUPPORTING_WM_CHECK", &wm_window_property);
gdk_flush();
bool got_error = gdk_error_trap_pop();
if (got_error || !result || wm_window_property != wm_window)
return false;
gdk_error_trap_push();
result = GetStringProperty(
static_cast<XID>(wm_window), "_NET_WM_NAME", wm_name);
gdk_flush();
got_error = gdk_error_trap_pop();
return !got_error && result;
}
| 18,549 |
161,030 | 0 | WebWindowFeatures GetWindowFeaturesFromString(const String& feature_string) {
WebWindowFeatures window_features;
if (feature_string.IsEmpty())
return window_features;
window_features.menu_bar_visible = false;
window_features.status_bar_visible = false;
window_features.tool_bar_visible = false;
window_features.scrollbars_visible = false;
unsigned key_begin, key_end;
unsigned value_begin, value_end;
String buffer = feature_string.DeprecatedLower();
unsigned length = buffer.length();
for (unsigned i = 0; i < length;) {
while (i < length && IsWindowFeaturesSeparator(buffer[i]))
i++;
key_begin = i;
while (i < length && !IsWindowFeaturesSeparator(buffer[i]))
i++;
key_end = i;
SECURITY_DCHECK(i <= length);
while (i < length && buffer[i] != '=') {
if (buffer[i] == ',' || !IsWindowFeaturesSeparator(buffer[i]))
break;
i++;
}
if (i < length && IsWindowFeaturesSeparator(buffer[i])) {
while (i < length && IsWindowFeaturesSeparator(buffer[i])) {
if (buffer[i] == ',')
break;
i++;
}
value_begin = i;
SECURITY_DCHECK(i <= length);
while (i < length && !IsWindowFeaturesSeparator(buffer[i]))
i++;
value_end = i;
SECURITY_DCHECK(i <= length);
} else {
value_begin = i;
value_end = i;
}
String key_string(
buffer.Substring(key_begin, key_end - key_begin).LowerASCII());
String value_string(
buffer.Substring(value_begin, value_end - value_begin).LowerASCII());
int value;
if (value_string.IsEmpty() || value_string == "yes")
value = 1;
else
value = value_string.ToInt();
if (key_string.IsEmpty())
continue;
if (key_string == "left" || key_string == "screenx") {
window_features.x_set = true;
window_features.x = value;
} else if (key_string == "top" || key_string == "screeny") {
window_features.y_set = true;
window_features.y = value;
} else if (key_string == "width" || key_string == "innerwidth") {
window_features.width_set = true;
window_features.width = value;
} else if (key_string == "height" || key_string == "innerheight") {
window_features.height_set = true;
window_features.height = value;
} else if (key_string == "menubar") {
window_features.menu_bar_visible = value;
} else if (key_string == "toolbar" || key_string == "location") {
window_features.tool_bar_visible |= static_cast<bool>(value);
} else if (key_string == "status") {
window_features.status_bar_visible = value;
} else if (key_string == "scrollbars") {
window_features.scrollbars_visible = value;
} else if (key_string == "resizable") {
window_features.resizable = value;
} else if (key_string == "noopener") {
window_features.noopener = true;
} else if (key_string == "background") {
window_features.background = true;
} else if (key_string == "persistent") {
window_features.persistent = true;
}
}
return window_features;
}
| 18,550 |
136,521 | 0 | void PaintController::EnsureRasterInvalidationTracking() {
if (!raster_invalidation_tracking_info_) {
raster_invalidation_tracking_info_ =
std::make_unique<RasterInvalidationTrackingInfo>();
}
}
| 18,551 |
44,357 | 0 | static bool rt_cache_route(struct fib_nh *nh, struct rtable *rt)
{
struct rtable *orig, *prev, **p;
bool ret = true;
if (rt_is_input_route(rt)) {
p = (struct rtable **)&nh->nh_rth_input;
} else {
p = (struct rtable **)raw_cpu_ptr(nh->nh_pcpu_rth_output);
}
orig = *p;
prev = cmpxchg(p, orig, rt);
if (prev == orig) {
if (orig)
rt_free(orig);
} else
ret = false;
return ret;
}
| 18,552 |
144,759 | 0 | void LocalSiteCharacteristicsWebContentsObserver::OnLoadingStateChange(
content::WebContents* contents,
LoadingState old_loading_state,
LoadingState new_loading_state) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (web_contents() != contents)
return;
if (!writer_)
return;
if (new_loading_state == LoadingState::LOADED) {
writer_->NotifySiteLoaded();
} else if (old_loading_state == LoadingState::LOADED) {
writer_->NotifySiteUnloaded();
}
}
| 18,553 |
55,602 | 0 | static void sched_domains_numa_masks_set(unsigned int cpu)
{
int node = cpu_to_node(cpu);
int i, j;
for (i = 0; i < sched_domains_numa_levels; i++) {
for (j = 0; j < nr_node_ids; j++) {
if (node_distance(j, node) <= sched_domains_numa_distance[i])
cpumask_set_cpu(cpu, sched_domains_numa_masks[i][j]);
}
}
}
| 18,554 |
178,650 | 1 | static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
{
php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
php_stream *file;
size_t memsize;
char *membuf;
off_t pos;
assert(ts != NULL);
if (!ts->innerstream) {
return FAILURE;
}
if (php_stream_is(ts->innerstream, PHP_STREAM_IS_STDIO)) {
return php_stream_cast(ts->innerstream, castas, ret, 0);
}
/* we are still using a memory based backing. If they are if we can be
* a FILE*, say yes because we can perform the conversion.
* If they actually want to perform the conversion, we need to switch
* the memory stream to a tmpfile stream */
if (ret == NULL && castas == PHP_STREAM_AS_STDIO) {
return SUCCESS;
}
/* say "no" to other stream forms */
if (ret == NULL) {
return FAILURE;
}
/* perform the conversion and then pass the request on to the innerstream */
membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize);
file = php_stream_fopen_tmpfile();
php_stream_write(file, membuf, memsize);
pos = php_stream_tell(ts->innerstream);
php_stream_free_enclosed(ts->innerstream, PHP_STREAM_FREE_CLOSE);
ts->innerstream = file;
php_stream_encloses(stream, ts->innerstream);
php_stream_seek(ts->innerstream, pos, SEEK_SET);
return php_stream_cast(ts->innerstream, castas, ret, 1);
}
| 18,555 |
79,167 | 0 | mspack_create_kwaj_decompressor(struct mspack_system *sys)
{
struct mskwaj_decompressor_p *self = NULL;
if (!sys) sys = mspack_default_system;
if (!mspack_valid_system(sys)) return NULL;
if ((self = (struct mskwaj_decompressor_p *) sys->alloc(sys, sizeof(struct mskwaj_decompressor_p)))) {
self->base.open = &kwajd_open;
self->base.close = &kwajd_close;
self->base.extract = &kwajd_extract;
self->base.decompress = &kwajd_decompress;
self->base.last_error = &kwajd_error;
self->system = sys;
self->error = MSPACK_ERR_OK;
}
return (struct mskwaj_decompressor *) self;
}
| 18,556 |
100,280 | 0 | static NetworkRoamingState ParseRoamingState(
const std::string& roaming_state) {
if (roaming_state == kRoamingStateHome)
return ROAMING_STATE_HOME;
if (roaming_state == kRoamingStateRoaming)
return ROAMING_STATE_ROAMING;
if (roaming_state == kRoamingStateUnknown)
return ROAMING_STATE_UNKNOWN;
return ROAMING_STATE_UNKNOWN;
}
| 18,557 |
145,758 | 0 | ModuleSystem::~ModuleSystem() {
}
| 18,558 |
31,573 | 0 | sctp_disposition_t sctp_sf_cookie_wait_abort(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
unsigned int len;
__be16 error = SCTP_ERROR_NO_ERROR;
if (!sctp_vtag_verify_either(chunk, asoc))
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
/* Make sure that the ABORT chunk has a valid length.
* Since this is an ABORT chunk, we have to discard it
* because of the following text:
* RFC 2960, Section 3.3.7
* If an endpoint receives an ABORT with a format error or for an
* association that doesn't exist, it MUST silently discard it.
* Because the length is "invalid", we can't really discard just
* as we do not know its true length. So, to be safe, discard the
* packet.
*/
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_abort_chunk_t)))
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
/* See if we have an error cause code in the chunk. */
len = ntohs(chunk->chunk_hdr->length);
if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr))
error = ((sctp_errhdr_t *)chunk->skb->data)->cause;
return sctp_stop_t1_and_abort(net, commands, error, ECONNREFUSED, asoc,
chunk->transport);
}
| 18,559 |
126,064 | 0 | void BrowserOpenedNotificationObserver::set_for_browser_command(
bool for_browser_command) {
for_browser_command_ = for_browser_command;
}
| 18,560 |
166,249 | 0 | explicit TestBrowserClient(MediaObserver* media_observer)
: media_observer_(media_observer) {}
| 18,561 |
1,838 | 0 | static void migrate_timeout(void *opaque)
{
spice_info(NULL);
spice_assert(reds->mig_wait_connect || reds->mig_wait_disconnect);
if (reds->mig_wait_connect) {
/* we will fall back to the switch host scheme when migration completes */
main_channel_migrate_cancel_wait(reds->main_channel);
/* in case part of the client haven't yet completed the previous migration, disconnect them */
reds_mig_target_client_disconnect_all();
reds_mig_cleanup();
} else {
reds_mig_disconnect();
}
}
| 18,562 |
69,361 | 0 | WORK_STATE ossl_statem_client_post_process_message(SSL *s, WORK_STATE wst)
{
OSSL_STATEM *st = &s->statem;
switch (st->hand_state) {
case TLS_ST_CR_CERT_REQ:
return tls_prepare_client_certificate(s, wst);
#ifndef OPENSSL_NO_SCTP
case TLS_ST_CR_SRVR_DONE:
/* We only get here if we are using SCTP and we are renegotiating */
if (BIO_dgram_sctp_msg_waiting(SSL_get_rbio(s))) {
s->s3->in_read_app_data = 2;
s->rwstate = SSL_READING;
BIO_clear_retry_flags(SSL_get_rbio(s));
BIO_set_retry_read(SSL_get_rbio(s));
ossl_statem_set_sctp_read_sock(s, 1);
return WORK_MORE_A;
}
ossl_statem_set_sctp_read_sock(s, 0);
return WORK_FINISHED_STOP;
#endif
default:
break;
}
/* Shouldn't happen */
return WORK_ERROR;
}
| 18,563 |
44,164 | 0 | unsigned long iov_iter_alignment(const struct iov_iter *i)
{
const struct iovec *iov = i->iov;
unsigned long res;
size_t size = i->count;
size_t n;
if (!size)
return 0;
res = (unsigned long)iov->iov_base + i->iov_offset;
n = iov->iov_len - i->iov_offset;
if (n >= size)
return res | size;
size -= n;
res |= n;
while (size > (++iov)->iov_len) {
res |= (unsigned long)iov->iov_base | iov->iov_len;
size -= iov->iov_len;
}
res |= (unsigned long)iov->iov_base | size;
return res;
}
| 18,564 |
65,442 | 0 | find_blocked_lock(struct nfs4_lockowner *lo, struct knfsd_fh *fh,
struct nfsd_net *nn)
{
struct nfsd4_blocked_lock *cur, *found = NULL;
spin_lock(&nn->blocked_locks_lock);
list_for_each_entry(cur, &lo->lo_blocked, nbl_list) {
if (fh_match(fh, &cur->nbl_fh)) {
list_del_init(&cur->nbl_list);
list_del_init(&cur->nbl_lru);
found = cur;
break;
}
}
spin_unlock(&nn->blocked_locks_lock);
if (found)
posix_unblock_lock(&found->nbl_lock);
return found;
}
| 18,565 |
80,976 | 0 | static bool nested_cr4_valid(struct kvm_vcpu *vcpu, unsigned long val)
{
u64 fixed0 = to_vmx(vcpu)->nested.msrs.cr4_fixed0;
u64 fixed1 = to_vmx(vcpu)->nested.msrs.cr4_fixed1;
return fixed_bits_valid(val, fixed0, fixed1);
}
| 18,566 |
104,496 | 0 | GLvoid StubGLVertexAttribPointer(GLuint indx, GLint size, GLenum type,
GLboolean normalized, GLsizei stride,
const void* ptr) {
glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
}
| 18,567 |
160,211 | 0 | void PDFiumEngine::KillFormFocus() {
FORM_ForceToKillFocus(form_);
SetInFormTextArea(false);
}
| 18,568 |
3,815 | 0 | _dbus_send_credentials_socket (int handle,
DBusError *error)
{
/* FIXME: for the session bus credentials shouldn't matter (?), but
* for the system bus they are presumably essential. A rough outline
* of a way to implement the credential transfer would be this:
*
* client waits to *read* a byte.
*
* server creates a named pipe with a random name, sends a byte
* contining its length, and its name.
*
* client reads the name, connects to it (using Win32 API).
*
* server waits for connection to the named pipe, then calls
* ImpersonateNamedPipeClient(), notes its now-current credentials,
* calls RevertToSelf(), closes its handles to the named pipe, and
* is done. (Maybe there is some other way to get the SID of a named
* pipe client without having to use impersonation?)
*
* client closes its handles and is done.
*
* Ralf: Why not sending credentials over the given this connection ?
* Using named pipes makes it impossible to be connected from a unix client.
*
*/
int bytes_written;
DBusString buf;
_dbus_string_init_const_len (&buf, "\0", 1);
again:
bytes_written = _dbus_write_socket (handle, &buf, 0, 1 );
if (bytes_written < 0 && errno == EINTR)
goto again;
if (bytes_written < 0)
{
dbus_set_error (error, _dbus_error_from_errno (errno),
"Failed to write credentials byte: %s",
_dbus_strerror_from_errno ());
return FALSE;
}
else if (bytes_written == 0)
{
dbus_set_error (error, DBUS_ERROR_IO_ERROR,
"wrote zero bytes writing credentials byte");
return FALSE;
}
else
{
_dbus_assert (bytes_written == 1);
_dbus_verbose ("wrote 1 zero byte, credential sending isn't implemented yet\n");
return TRUE;
}
return TRUE;
}
| 18,569 |
36,075 | 0 | void __init postgresql_init(void)
{
dissect_add("postgresql", APP_LAYER_TCP, 5432, dissector_postgresql);
}
| 18,570 |
183,907 | 1 | static void webkit_web_view_update_settings(WebKitWebView* webView)
{
WebKitWebViewPrivate* priv = webView->priv;
WebKitWebSettings* webSettings = priv->webSettings.get();
Settings* settings = core(webView)->settings();
gchar* defaultEncoding, *cursiveFontFamily, *defaultFontFamily, *fantasyFontFamily, *monospaceFontFamily, *sansSerifFontFamily, *serifFontFamily, *userStylesheetUri, *defaultSpellCheckingLanguages;
gboolean autoLoadImages, autoShrinkImages, printBackgrounds,
enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas,
enablePrivateBrowsing, enableCaretBrowsing, enableHTML5Database, enableHTML5LocalStorage,
enableXSSAuditor, enableSpatialNavigation, enableFrameFlattening, javascriptCanOpenWindows,
javaScriptCanAccessClipboard, enableOfflineWebAppCache,
enableUniversalAccessFromFileURI, enableFileAccessFromFileURI,
enableDOMPaste, tabKeyCyclesThroughElements, enableWebGL,
enableSiteSpecificQuirks, usePageCache, enableJavaApplet,
enableHyperlinkAuditing, enableFullscreen, enableDNSPrefetching;
WebKitEditingBehavior editingBehavior;
g_object_get(webSettings,
"default-encoding", &defaultEncoding,
"cursive-font-family", &cursiveFontFamily,
"default-font-family", &defaultFontFamily,
"fantasy-font-family", &fantasyFontFamily,
"monospace-font-family", &monospaceFontFamily,
"sans-serif-font-family", &sansSerifFontFamily,
"serif-font-family", &serifFontFamily,
"auto-load-images", &autoLoadImages,
"auto-shrink-images", &autoShrinkImages,
"print-backgrounds", &printBackgrounds,
"enable-scripts", &enableScripts,
"enable-plugins", &enablePlugins,
"resizable-text-areas", &resizableTextAreas,
"user-stylesheet-uri", &userStylesheetUri,
"enable-developer-extras", &enableDeveloperExtras,
"enable-private-browsing", &enablePrivateBrowsing,
"enable-caret-browsing", &enableCaretBrowsing,
"enable-html5-database", &enableHTML5Database,
"enable-html5-local-storage", &enableHTML5LocalStorage,
"enable-xss-auditor", &enableXSSAuditor,
"enable-spatial-navigation", &enableSpatialNavigation,
"enable-frame-flattening", &enableFrameFlattening,
"javascript-can-open-windows-automatically", &javascriptCanOpenWindows,
"javascript-can-access-clipboard", &javaScriptCanAccessClipboard,
"enable-offline-web-application-cache", &enableOfflineWebAppCache,
"editing-behavior", &editingBehavior,
"enable-universal-access-from-file-uris", &enableUniversalAccessFromFileURI,
"enable-file-access-from-file-uris", &enableFileAccessFromFileURI,
"enable-dom-paste", &enableDOMPaste,
"tab-key-cycles-through-elements", &tabKeyCyclesThroughElements,
"enable-site-specific-quirks", &enableSiteSpecificQuirks,
"enable-page-cache", &usePageCache,
"enable-java-applet", &enableJavaApplet,
"enable-hyperlink-auditing", &enableHyperlinkAuditing,
"spell-checking-languages", &defaultSpellCheckingLanguages,
"enable-fullscreen", &enableFullscreen,
"enable-dns-prefetching", &enableDNSPrefetching,
"enable-webgl", &enableWebGL,
NULL);
settings->setDefaultTextEncodingName(defaultEncoding);
settings->setCursiveFontFamily(cursiveFontFamily);
settings->setStandardFontFamily(defaultFontFamily);
settings->setFantasyFontFamily(fantasyFontFamily);
settings->setFixedFontFamily(monospaceFontFamily);
settings->setSansSerifFontFamily(sansSerifFontFamily);
settings->setSerifFontFamily(serifFontFamily);
settings->setLoadsImagesAutomatically(autoLoadImages);
settings->setShrinksStandaloneImagesToFit(autoShrinkImages);
settings->setShouldPrintBackgrounds(printBackgrounds);
settings->setJavaScriptEnabled(enableScripts);
settings->setPluginsEnabled(enablePlugins);
settings->setTextAreasAreResizable(resizableTextAreas);
settings->setUserStyleSheetLocation(KURL(KURL(), userStylesheetUri));
settings->setDeveloperExtrasEnabled(enableDeveloperExtras);
settings->setPrivateBrowsingEnabled(enablePrivateBrowsing);
settings->setCaretBrowsingEnabled(enableCaretBrowsing);
#if ENABLE(DATABASE)
AbstractDatabase::setIsAvailable(enableHTML5Database);
#endif
settings->setLocalStorageEnabled(enableHTML5LocalStorage);
settings->setXSSAuditorEnabled(enableXSSAuditor);
settings->setSpatialNavigationEnabled(enableSpatialNavigation);
settings->setFrameFlatteningEnabled(enableFrameFlattening);
settings->setJavaScriptCanOpenWindowsAutomatically(javascriptCanOpenWindows);
settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
settings->setOfflineWebApplicationCacheEnabled(enableOfflineWebAppCache);
settings->setEditingBehaviorType(static_cast<WebCore::EditingBehaviorType>(editingBehavior));
settings->setAllowUniversalAccessFromFileURLs(enableUniversalAccessFromFileURI);
settings->setAllowFileAccessFromFileURLs(enableFileAccessFromFileURI);
settings->setDOMPasteAllowed(enableDOMPaste);
settings->setNeedsSiteSpecificQuirks(enableSiteSpecificQuirks);
settings->setUsesPageCache(usePageCache);
settings->setJavaEnabled(enableJavaApplet);
settings->setHyperlinkAuditingEnabled(enableHyperlinkAuditing);
settings->setDNSPrefetchingEnabled(enableDNSPrefetching);
#if ENABLE(FULLSCREEN_API)
settings->setFullScreenEnabled(enableFullscreen);
#endif
#if ENABLE(SPELLCHECK)
WebKit::EditorClient* client = static_cast<WebKit::EditorClient*>(core(webView)->editorClient());
static_cast<WebKit::TextCheckerClientEnchant*>(client->textChecker())->updateSpellCheckingLanguage(defaultSpellCheckingLanguages);
#endif
#if ENABLE(WEBGL)
settings->setWebGLEnabled(enableWebGL);
#endif
Page* page = core(webView);
if (page)
page->setTabKeyCyclesThroughElements(tabKeyCyclesThroughElements);
g_free(defaultEncoding);
g_free(cursiveFontFamily);
g_free(defaultFontFamily);
g_free(fantasyFontFamily);
g_free(monospaceFontFamily);
g_free(sansSerifFontFamily);
g_free(serifFontFamily);
g_free(userStylesheetUri);
webkit_web_view_screen_changed(GTK_WIDGET(webView), NULL);
}
| 18,571 |
141,290 | 0 | void Document::UpdateTitle(const String& title) {
if (raw_title_ == title)
return;
raw_title_ = title;
String old_title = title_;
if (raw_title_.IsEmpty())
title_ = String();
else if (raw_title_.Is8Bit())
title_ = CanonicalizedTitle<LChar>(this, raw_title_);
else
title_ = CanonicalizedTitle<UChar>(this, raw_title_);
if (!frame_ || old_title == title_)
return;
DispatchDidReceiveTitle();
if (AXObjectCache* cache = ExistingAXObjectCache())
cache->DocumentTitleChanged();
}
| 18,572 |
115,711 | 0 | void ScreenRecorder::DoStart() {
DCHECK_EQ(capture_loop_, MessageLoop::current());
if (is_recording_) {
NOTREACHED() << "Record session already started.";
return;
}
is_recording_ = true;
DoCapture();
}
| 18,573 |
148,024 | 0 | void V8TestObject::VoidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg");
test_object_v8_internal::VoidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethod(info);
}
| 18,574 |
185,338 | 1 | FrameView::FrameView(LocalFrame* frame)
: m_frame(frame)
, m_canHaveScrollbars(true)
, m_slowRepaintObjectCount(0)
, m_hasPendingLayout(false)
, m_layoutSubtreeRoot(0)
, m_inSynchronousPostLayout(false)
, m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
, m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired)
, m_isTransparent(false)
, m_baseBackgroundColor(Color::white)
, m_mediaType("screen")
, m_overflowStatusDirty(true)
, m_viewportRenderer(0)
, m_wasScrolledByUser(false)
, m_inProgrammaticScroll(false)
, m_safeToPropagateScrollToParent(true)
, m_isTrackingPaintInvalidations(false)
, m_scrollCorner(nullptr)
, m_hasSoftwareFilters(false)
, m_visibleContentScaleFactor(1)
, m_inputEventsScaleFactorForEmulation(1)
, m_layoutSizeFixedToFrameSize(true)
, m_didScrollTimer(this, &FrameView::didScrollTimerFired)
{
ASSERT(m_frame);
init();
if (!m_frame->isMainFrame())
return;
ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed);
ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed);
}
| 18,575 |
42,779 | 0 | static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
{
#ifdef CONFIG_X86_64
unsigned long a;
#endif
int i;
/* I/O */
vmcs_write64(IO_BITMAP_A, __pa(vmx_io_bitmap_a));
vmcs_write64(IO_BITMAP_B, __pa(vmx_io_bitmap_b));
if (enable_shadow_vmcs) {
vmcs_write64(VMREAD_BITMAP, __pa(vmx_vmread_bitmap));
vmcs_write64(VMWRITE_BITMAP, __pa(vmx_vmwrite_bitmap));
}
if (cpu_has_vmx_msr_bitmap())
vmcs_write64(MSR_BITMAP, __pa(vmx_msr_bitmap_legacy));
vmcs_write64(VMCS_LINK_POINTER, -1ull); /* 22.3.1.5 */
/* Control */
vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, vmx_pin_based_exec_ctrl(vmx));
vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, vmx_exec_control(vmx));
if (cpu_has_secondary_exec_ctrls())
vmcs_write32(SECONDARY_VM_EXEC_CONTROL,
vmx_secondary_exec_control(vmx));
if (vmx_cpu_uses_apicv(&vmx->vcpu)) {
vmcs_write64(EOI_EXIT_BITMAP0, 0);
vmcs_write64(EOI_EXIT_BITMAP1, 0);
vmcs_write64(EOI_EXIT_BITMAP2, 0);
vmcs_write64(EOI_EXIT_BITMAP3, 0);
vmcs_write16(GUEST_INTR_STATUS, 0);
vmcs_write64(POSTED_INTR_NV, POSTED_INTR_VECTOR);
vmcs_write64(POSTED_INTR_DESC_ADDR, __pa((&vmx->pi_desc)));
}
if (ple_gap) {
vmcs_write32(PLE_GAP, ple_gap);
vmx->ple_window = ple_window;
vmx->ple_window_dirty = true;
}
vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, 0);
vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, 0);
vmcs_write32(CR3_TARGET_COUNT, 0); /* 22.2.1 */
vmcs_write16(HOST_FS_SELECTOR, 0); /* 22.2.4 */
vmcs_write16(HOST_GS_SELECTOR, 0); /* 22.2.4 */
vmx_set_constant_host_state(vmx);
#ifdef CONFIG_X86_64
rdmsrl(MSR_FS_BASE, a);
vmcs_writel(HOST_FS_BASE, a); /* 22.2.4 */
rdmsrl(MSR_GS_BASE, a);
vmcs_writel(HOST_GS_BASE, a); /* 22.2.4 */
#else
vmcs_writel(HOST_FS_BASE, 0); /* 22.2.4 */
vmcs_writel(HOST_GS_BASE, 0); /* 22.2.4 */
#endif
vmcs_write32(VM_EXIT_MSR_STORE_COUNT, 0);
vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, 0);
vmcs_write64(VM_EXIT_MSR_LOAD_ADDR, __pa(vmx->msr_autoload.host));
vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, 0);
vmcs_write64(VM_ENTRY_MSR_LOAD_ADDR, __pa(vmx->msr_autoload.guest));
if (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_PAT)
vmcs_write64(GUEST_IA32_PAT, vmx->vcpu.arch.pat);
for (i = 0; i < ARRAY_SIZE(vmx_msr_index); ++i) {
u32 index = vmx_msr_index[i];
u32 data_low, data_high;
int j = vmx->nmsrs;
if (rdmsr_safe(index, &data_low, &data_high) < 0)
continue;
if (wrmsr_safe(index, data_low, data_high) < 0)
continue;
vmx->guest_msrs[j].index = i;
vmx->guest_msrs[j].data = 0;
vmx->guest_msrs[j].mask = -1ull;
++vmx->nmsrs;
}
vm_exit_controls_init(vmx, vmcs_config.vmexit_ctrl);
/* 22.2.1, 20.8.1 */
vm_entry_controls_init(vmx, vmcs_config.vmentry_ctrl);
vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL);
set_cr4_guest_host_mask(vmx);
if (vmx_xsaves_supported())
vmcs_write64(XSS_EXIT_BITMAP, VMX_XSS_EXIT_BITMAP);
return 0;
}
| 18,576 |
67,456 | 0 | mountpoint_last(struct nameidata *nd)
{
int error = 0;
struct dentry *dir = nd->path.dentry;
struct path path;
/* If we're in rcuwalk, drop out of it to handle last component */
if (nd->flags & LOOKUP_RCU) {
if (unlazy_walk(nd))
return -ECHILD;
}
nd->flags &= ~LOOKUP_PARENT;
if (unlikely(nd->last_type != LAST_NORM)) {
error = handle_dots(nd, nd->last_type);
if (error)
return error;
path.dentry = dget(nd->path.dentry);
} else {
path.dentry = d_lookup(dir, &nd->last);
if (!path.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.
*/
path.dentry = lookup_slow(&nd->last, dir,
nd->flags | LOOKUP_NO_REVAL);
if (IS_ERR(path.dentry))
return PTR_ERR(path.dentry);
}
}
if (d_is_negative(path.dentry)) {
dput(path.dentry);
return -ENOENT;
}
path.mnt = nd->path.mnt;
return step_into(nd, &path, 0, d_backing_inode(path.dentry), 0);
}
| 18,577 |
104,037 | 0 | bool GLES2DecoderImpl::DoIsTexture(GLuint client_id) {
const TextureManager::TextureInfo* info = GetTextureInfo(client_id);
return info && info->IsValid();
}
| 18,578 |
29,673 | 0 | static struct pstore *get_info(struct dm_exception_store *store)
{
return (struct pstore *) store->context;
}
| 18,579 |
123,722 | 0 | void MemoryMappedFile::CloseHandles() {
base::ThreadRestrictions::AssertIOAllowed();
if (data_ != NULL)
munmap(data_, length_);
if (file_ != base::kInvalidPlatformFileValue)
ignore_result(HANDLE_EINTR(close(file_)));
data_ = NULL;
length_ = 0;
file_ = base::kInvalidPlatformFileValue;
}
| 18,580 |
116,583 | 0 | explicit TestAudioRendererImpl(media::AudioRendererSink* sink)
: AudioRendererImpl(sink) {
}
| 18,581 |
126,087 | 0 | ExtensionReadyNotificationObserver::~ExtensionReadyNotificationObserver() {
}
| 18,582 |
123,054 | 0 | void RenderWidgetHostImpl::SetActive(bool active) {
Send(new ViewMsg_SetActive(routing_id_, active));
}
| 18,583 |
123,609 | 0 | void InspectorPageAgent::didPaint(RenderObject*, const GraphicsLayer*, GraphicsContext* context, const LayoutRect& rect)
{
if (!m_enabled || m_client->overridesShowPaintRects() || !m_state->getBoolean(PageAgentState::pageAgentShowPaintRects))
return;
static int colorSelector = 0;
const Color colors[] = {
Color(0, 0x5F, 0, 0x3F),
Color(0, 0xAF, 0, 0x3F),
Color(0, 0xFF, 0, 0x3F),
};
LayoutRect inflatedRect(rect);
inflatedRect.inflate(-1);
m_overlay->drawOutline(context, inflatedRect, colors[colorSelector++ % WTF_ARRAY_LENGTH(colors)]);
}
| 18,584 |
116,335 | 0 | QList<QUrl> QQuickWebViewExperimental::userScripts() const
{
Q_D(const QQuickWebView);
return d->userScripts;
}
| 18,585 |
85,511 | 0 | void ocfs2_unlock_and_free_pages(struct page **pages, int num_pages)
{
int i;
for(i = 0; i < num_pages; i++) {
if (pages[i]) {
unlock_page(pages[i]);
mark_page_accessed(pages[i]);
put_page(pages[i]);
}
}
}
| 18,586 |
159,963 | 0 | void DiskCacheBackendTest::BackendDoomMidEnumeration() {
InitCache();
const int kNumEntries = 100;
std::set<std::string> keys;
for (int i = 0; i < kNumEntries; i++) {
std::string key = GenerateKey(true);
keys.insert(key);
disk_cache::Entry* entry;
ASSERT_THAT(CreateEntry(key, &entry), IsOk());
entry->Close();
}
disk_cache::Entry* entry;
std::unique_ptr<TestIterator> iter = CreateIterator();
int count = 0;
while (iter->OpenNextEntry(&entry) == net::OK) {
if (count == 0) {
auto key_to_doom = keys.begin();
while (*key_to_doom == entry->GetKey())
key_to_doom++;
ASSERT_THAT(DoomEntry(*key_to_doom), IsOk());
ASSERT_EQ(1u, keys.erase(*key_to_doom));
}
ASSERT_NE(nullptr, entry);
EXPECT_EQ(1u, keys.erase(entry->GetKey()));
entry->Close();
count++;
};
EXPECT_EQ(kNumEntries - 1, cache_->GetEntryCount());
EXPECT_EQ(0u, keys.size());
}
| 18,587 |
142,372 | 0 | void AddAllUsers() {
for (size_t i = 0; i < base::size(kTestAccounts); ++i) {
if (i == PRIMARY_ACCOUNT_INDEX)
continue;
AddUser(kTestAccounts[i], i >= SECONDARY_ACCOUNT_INDEX_START);
}
}
| 18,588 |
46,658 | 0 | static int ctr_aes_crypt(struct blkcipher_desc *desc, long func,
struct s390_aes_ctx *sctx, struct blkcipher_walk *walk)
{
int ret = blkcipher_walk_virt_block(desc, walk, AES_BLOCK_SIZE);
unsigned int n, nbytes;
u8 buf[AES_BLOCK_SIZE], ctrbuf[AES_BLOCK_SIZE];
u8 *out, *in, *ctrptr = ctrbuf;
if (!walk->nbytes)
return ret;
if (spin_trylock(&ctrblk_lock))
ctrptr = ctrblk;
memcpy(ctrptr, walk->iv, AES_BLOCK_SIZE);
while ((nbytes = walk->nbytes) >= AES_BLOCK_SIZE) {
out = walk->dst.virt.addr;
in = walk->src.virt.addr;
while (nbytes >= AES_BLOCK_SIZE) {
if (ctrptr == ctrblk)
n = __ctrblk_init(ctrptr, nbytes);
else
n = AES_BLOCK_SIZE;
ret = crypt_s390_kmctr(func, sctx->key, out, in,
n, ctrptr);
if (ret < 0 || ret != n) {
if (ctrptr == ctrblk)
spin_unlock(&ctrblk_lock);
return -EIO;
}
if (n > AES_BLOCK_SIZE)
memcpy(ctrptr, ctrptr + n - AES_BLOCK_SIZE,
AES_BLOCK_SIZE);
crypto_inc(ctrptr, AES_BLOCK_SIZE);
out += n;
in += n;
nbytes -= n;
}
ret = blkcipher_walk_done(desc, walk, nbytes);
}
if (ctrptr == ctrblk) {
if (nbytes)
memcpy(ctrbuf, ctrptr, AES_BLOCK_SIZE);
else
memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE);
spin_unlock(&ctrblk_lock);
} else {
if (!nbytes)
memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE);
}
/*
* final block may be < AES_BLOCK_SIZE, copy only nbytes
*/
if (nbytes) {
out = walk->dst.virt.addr;
in = walk->src.virt.addr;
ret = crypt_s390_kmctr(func, sctx->key, buf, in,
AES_BLOCK_SIZE, ctrbuf);
if (ret < 0 || ret != AES_BLOCK_SIZE)
return -EIO;
memcpy(out, buf, nbytes);
crypto_inc(ctrbuf, AES_BLOCK_SIZE);
ret = blkcipher_walk_done(desc, walk, 0);
memcpy(walk->iv, ctrbuf, AES_BLOCK_SIZE);
}
return ret;
}
| 18,589 |
134,975 | 0 | void FakeCrosDisksClient::NotifyRenameCompleted(
RenameError error_code,
const std::string& device_path) {
for (auto& observer : observer_list_)
observer.OnRenameCompleted(error_code, device_path);
}
| 18,590 |
75,915 | 0 | usage(const char *prog)
{
fprintf(stderr, "Usage: %s [OPTION...]\n", prog);
fprintf(stderr, " -f, --use-file=FILE Use the specified configuration file\n");
#if defined _WITH_VRRP_ && defined _WITH_LVS_
fprintf(stderr, " -P, --vrrp Only run with VRRP subsystem\n");
fprintf(stderr, " -C, --check Only run with Health-checker subsystem\n");
#endif
#ifdef _WITH_BFD_
fprintf(stderr, " -B, --no_bfd Don't run BFD subsystem\n");
#endif
fprintf(stderr, " --all Force all child processes to run, even if have no configuration\n");
fprintf(stderr, " -l, --log-console Log messages to local console\n");
fprintf(stderr, " -D, --log-detail Detailed log messages\n");
fprintf(stderr, " -S, --log-facility=[0-7] Set syslog facility to LOG_LOCAL[0-7]\n");
fprintf(stderr, " -g, --log-file=FILE Also log to FILE (default /tmp/keepalived.log)\n");
fprintf(stderr, " --flush-log-file Flush log file on write\n");
fprintf(stderr, " -G, --no-syslog Don't log via syslog\n");
fprintf(stderr, " -u, --umask=MASK umask for file creation (in numeric form)\n");
#ifdef _WITH_VRRP_
fprintf(stderr, " -X, --release-vips Drop VIP on transition from signal.\n");
fprintf(stderr, " -V, --dont-release-vrrp Don't remove VRRP VIPs and VROUTEs on daemon stop\n");
#endif
#ifdef _WITH_LVS_
fprintf(stderr, " -I, --dont-release-ipvs Don't remove IPVS topology on daemon stop\n");
#endif
fprintf(stderr, " -R, --dont-respawn Don't respawn child processes\n");
fprintf(stderr, " -n, --dont-fork Don't fork the daemon process\n");
fprintf(stderr, " -d, --dump-conf Dump the configuration data\n");
fprintf(stderr, " -p, --pid=FILE Use specified pidfile for parent process\n");
#ifdef _WITH_VRRP_
fprintf(stderr, " -r, --vrrp_pid=FILE Use specified pidfile for VRRP child process\n");
#endif
#ifdef _WITH_LVS_
fprintf(stderr, " -c, --checkers_pid=FILE Use specified pidfile for checkers child process\n");
fprintf(stderr, " -a, --address-monitoring Report all address additions/deletions notified via netlink\n");
#endif
#ifdef _WITH_BFD_
fprintf(stderr, " -b, --bfd_pid=FILE Use specified pidfile for BFD child process\n");
#endif
#ifdef _WITH_SNMP_
fprintf(stderr, " -x, --snmp Enable SNMP subsystem\n");
fprintf(stderr, " -A, --snmp-agent-socket=FILE Use the specified socket for master agent\n");
#endif
#if HAVE_DECL_CLONE_NEWNET
fprintf(stderr, " -s, --namespace=NAME Run in network namespace NAME (overrides config)\n");
#endif
fprintf(stderr, " -m, --core-dump Produce core dump if terminate abnormally\n");
fprintf(stderr, " -M, --core-dump-pattern=PATN Also set /proc/sys/kernel/core_pattern to PATN (default 'core')\n");
#ifdef _MEM_CHECK_LOG_
fprintf(stderr, " -L, --mem-check-log Log malloc/frees to syslog\n");
#endif
fprintf(stderr, " -i, --config-id id Skip any configuration lines beginning '@' that don't match id\n"
" or any lines beginning @^ that do match.\n"
" The config-id defaults to the node name if option not used\n");
fprintf(stderr, " --signum=SIGFUNC Return signal number for STOP, RELOAD, DATA, STATS"
#ifdef _WITH_JSON_
", JSON"
#endif
"\n");
fprintf(stderr, " -t, --config-test[=LOG_FILE] Check the configuration for obvious errors, output to\n"
" stderr by default\n");
#ifdef _WITH_PERF_
fprintf(stderr, " --perf[=PERF_TYPE] Collect perf data, PERF_TYPE=all, run(default) or end\n");
#endif
#ifdef WITH_DEBUG_OPTIONS
fprintf(stderr, " --debug[=...] Enable debug options. p, b, c, v specify parent, bfd, checker and vrrp processes\n");
#ifdef _TIMER_CHECK_
fprintf(stderr, " T - timer debug\n");
#endif
#ifdef _SMTP_ALERT_DEBUG_
fprintf(stderr, " M - email alert debug\n");
#endif
#ifdef _EPOLL_DEBUG_
fprintf(stderr, " E - epoll debug\n");
#endif
#ifdef _EPOLL_THREAD_DUMP_
fprintf(stderr, " D - epoll thread dump debug\n");
#endif
#ifdef _VRRP_FD_DEBUG
fprintf(stderr, " F - vrrp fd dump debug\n");
#endif
#ifdef _REGEX_DEBUG_
fprintf(stderr, " R - regex debug\n");
#endif
#ifdef _WITH_REGEX_TIMERS_
fprintf(stderr, " X - regex timers\n");
#endif
#ifdef _TSM_DEBUG_
fprintf(stderr, " S - TSM debug\n");
#endif
#ifdef _NETLINK_TIMERS_
fprintf(stderr, " N - netlink timer debug\n");
#endif
fprintf(stderr, " Example --debug=TpMEvcp\n");
#endif
fprintf(stderr, " -v, --version Display the version number\n");
fprintf(stderr, " -h, --help Display this help message\n");
}
| 18,591 |
14,879 | 0 | SPL_METHOD(SplPriorityQueue, insert)
{
zval *data, *priority, *elem;
spl_heap_object *intern;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &data, &priority) == FAILURE) {
return;
}
intern = (spl_heap_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
return;
}
SEPARATE_ARG_IF_REF(data);
SEPARATE_ARG_IF_REF(priority);
ALLOC_INIT_ZVAL(elem);
array_init(elem);
add_assoc_zval_ex(elem, "data", sizeof("data"), data);
add_assoc_zval_ex(elem, "priority", sizeof("priority"), priority);
spl_ptr_heap_insert(intern->heap, elem, getThis() TSRMLS_CC);
RETURN_TRUE;
}
| 18,592 |
155,768 | 0 | void HistoryController::CreateNewBackForwardItem(
RenderFrameImpl* target_frame,
const WebHistoryItem& new_item,
bool clone_children_of_target) {
if (!current_entry_) {
current_entry_.reset(new HistoryEntry(new_item));
} else {
current_entry_.reset(current_entry_->CloneAndReplace(
new_item, clone_children_of_target, target_frame, render_view_));
}
}
| 18,593 |
62,194 | 0 | INT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
LRESULT loc;
int i, dh, r = -1;
static LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE,
HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT };
static HBRUSH background_brush, separator_brush;
NONCLIENTMETRICS ncm;
RECT rect, rect2;
HFONT hDlgFont;
HWND hCtrl;
HDC hDC;
switch (message) {
case WM_INITDIALOG:
if (nDialogItems > (IDC_LIST_ITEMMAX - IDC_LIST_ITEM1 + 1)) {
uprintf("Warning: Too many items requested for List (%d vs %d)",
nDialogItems, IDC_LIST_ITEMMAX - IDC_LIST_ITEM1);
nDialogItems = IDC_LIST_ITEMMAX - IDC_LIST_ITEM1;
}
ncm.cbSize = sizeof(ncm);
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
if (nWindowsVersion >= WINDOWS_VISTA) {
ncm.cbSize -= sizeof(ncm.iPaddedBorderWidth);
}
#endif
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0);
hDlgFont = CreateFontIndirect(&(ncm.lfMessageFont));
SendMessage(hDlg, WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
SendMessage(GetDlgItem(hDlg, IDC_LIST_TEXT), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
for (i = 0; i < nDialogItems; i++)
SendMessage(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
SendMessage(GetDlgItem(hDlg, IDYES), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
SendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));
apply_localization(IDD_LIST, hDlg);
background_brush = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
separator_brush = CreateSolidBrush(GetSysColor(COLOR_3DLIGHT));
SetTitleBarIcon(hDlg);
CenterDialog(hDlg);
Static_SetIcon(GetDlgItem(hDlg, IDC_LIST_ICON), LoadIcon(NULL, IDI_EXCLAMATION));
SetWindowTextU(hDlg, szMessageTitle);
SetWindowTextU(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007));
SetWindowTextU(GetDlgItem(hDlg, IDC_LIST_TEXT), szMessageText);
for (i = 0; i < nDialogItems; i++) {
SetWindowTextU(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), szDialogItem[i]);
ShowWindow(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), SW_SHOW);
}
hCtrl = GetDlgItem(hDlg, IDC_LIST_TEXT);
hDC = GetDC(hCtrl);
SelectFont(hDC, hDlgFont); // Yes, you *MUST* reapply the font to the DC, even after SetWindowText!
GetWindowRect(hCtrl, &rect);
dh = rect.bottom - rect.top;
DrawTextU(hDC, szMessageText, -1, &rect, DT_CALCRECT | DT_WORDBREAK);
dh = rect.bottom - rect.top - dh;
if (hDC != NULL)
ReleaseDC(hCtrl, hDC);
ResizeMoveCtrl(hDlg, hCtrl, 0, 0, 0, dh, 1.0f);
for (i = 0; i < nDialogItems; i++)
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), 0, dh, 0, 0, 1.0f);
if (nDialogItems > 1) {
GetWindowRect(GetDlgItem(hDlg, IDC_LIST_ITEM1), &rect);
GetWindowRect(GetDlgItem(hDlg, IDC_LIST_ITEM1 + nDialogItems - 1), &rect2);
dh += rect2.top - rect.top;
}
ResizeMoveCtrl(hDlg, hDlg, 0, 0, 0, dh, 1.0f);
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, -1), 0, 0, 0, dh, 1.0f); // IDC_STATIC = -1
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_LIST_LINE), 0, dh, 0, 0, 1.0f);
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDOK), 0, dh, 0, 0, 1.0f);
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDCANCEL), 0, dh, 0, 0, 1.0f);
return (INT_PTR)TRUE;
case WM_CTLCOLORSTATIC:
SetBkMode((HDC)wParam, TRANSPARENT);
if ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) {
return (INT_PTR)separator_brush;
}
return (INT_PTR)background_brush;
case WM_NCHITTEST:
loc = DefWindowProc(hDlg, message, wParam, lParam);
for (i = 0; i < 9; i++) {
if (loc == disabled[i]) {
return (INT_PTR)TRUE;
}
}
return (INT_PTR)FALSE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDNO:
case IDCANCEL:
EndDialog(hDlg, r);
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}
| 18,594 |
41,398 | 0 | static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
struct kvm_vcpu_events *events)
{
events->exception.injected =
vcpu->arch.exception.pending &&
!kvm_exception_is_soft(vcpu->arch.exception.nr);
events->exception.nr = vcpu->arch.exception.nr;
events->exception.has_error_code = vcpu->arch.exception.has_error_code;
events->exception.pad = 0;
events->exception.error_code = vcpu->arch.exception.error_code;
events->interrupt.injected =
vcpu->arch.interrupt.pending && !vcpu->arch.interrupt.soft;
events->interrupt.nr = vcpu->arch.interrupt.nr;
events->interrupt.soft = 0;
events->interrupt.shadow =
kvm_x86_ops->get_interrupt_shadow(vcpu,
KVM_X86_SHADOW_INT_MOV_SS | KVM_X86_SHADOW_INT_STI);
events->nmi.injected = vcpu->arch.nmi_injected;
events->nmi.pending = vcpu->arch.nmi_pending;
events->nmi.masked = kvm_x86_ops->get_nmi_mask(vcpu);
events->nmi.pad = 0;
events->sipi_vector = vcpu->arch.sipi_vector;
events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING
| KVM_VCPUEVENT_VALID_SIPI_VECTOR
| KVM_VCPUEVENT_VALID_SHADOW);
memset(&events->reserved, 0, sizeof(events->reserved));
}
| 18,595 |
134,599 | 0 | void OSExchangeData::SetHtml(const base::string16& html, const GURL& base_url) {
provider_->SetHtml(html, base_url);
}
| 18,596 |
130,522 | 0 | OutOfOrderIndexContext(DisplayItems::iterator begin) : nextItemToIndex(begin) { }
| 18,597 |
6,451 | 0 | static MenuCache* menu_cache_new( const char* cache_file )
{
MenuCache* cache;
cache = g_slice_new0( MenuCache );
cache->cache_file = g_strdup( cache_file );
cache->n_ref = 1;
return cache;
}
| 18,598 |
17,078 | 0 | qreal OxideQQuickWebView::contentX() const {
Q_D(const OxideQQuickWebView);
if (!d->proxy_) {
return 0.f;
}
return const_cast<OxideQQuickWebViewPrivate*>(
d)->proxy_->compositorFrameScrollOffset().x();
}
| 18,599 |
Subsets and Splits