Lines Matching refs:result
115 if (const auto result = readExactlyOneElement(kTagComponentType, rootElement); result.ok()) { in readComponentType() local
116 componentTypeElement = *result; in readComponentType()
118 return Error() << "Failed to read tag '" << kTagComponentType << "': " << result.error(); in readComponentType()
270 if (const auto result = readExactlyOneElement(kTagComponentLevelThresholds, rootElement); in readComponentLevelThresholds() local
271 result.ok()) { in readComponentLevelThresholds()
272 componentLevelThresholdElement = *result; in readComponentLevelThresholds()
275 << "': " << result.error(); in readComponentLevelThresholds()
279 if (const auto result = readPerStateBytes(componentLevelThresholdElement); result.ok()) { in readComponentLevelThresholds() local
280 thresholds.perStateWriteBytes = *result; in readComponentLevelThresholds()
283 << thresholds.name << "': " << result.error(); in readComponentLevelThresholds()
301 if (const auto result = readPerStateBytes(childElement); result.ok()) { in readPerStateThresholds() local
302 threshold.perStateWriteBytes = *result; in readPerStateThresholds()
305 << "': " << result.error(); in readPerStateThresholds()
319 if (const auto result = readPerStateThresholds(childElement); result.ok()) { in readPackageSpecificThresholds() local
320 thresholds.insert(thresholds.end(), result->begin(), result->end()); in readPackageSpecificThresholds()
323 << kTagPackageSpecificThresholds << "': " << result.error(); in readPackageSpecificThresholds()
336 if (const auto result = readPerStateThresholds(childElement); result.ok()) { in readAppCategorySpecificThresholds() local
337 thresholds.insert(thresholds.end(), result->begin(), result->end()); in readAppCategorySpecificThresholds()
340 << kTagAppCategorySpecificThresholds << "': " << result.error(); in readAppCategorySpecificThresholds()
392 const auto result = readIoOveruseAlertThreshold(innerElement); in readSystemWideThresholds() local
393 if (!result.ok()) { in readSystemWideThresholds()
395 << kTagAlertThreshold << "': " << result.error(); in readSystemWideThresholds()
397 alertThresholds.push_back(*result); in readSystemWideThresholds()
406 if (const auto result = readExactlyOneElement(kTagIoOveruseConfiguration, rootElement); in readIoOveruseConfiguration() local
407 result.ok()) { in readIoOveruseConfiguration()
408 childElement = *result; in readIoOveruseConfiguration()
411 << "': " << result.error(); in readIoOveruseConfiguration()
414 if (const auto result = readComponentLevelThresholds(componentType, childElement); in readIoOveruseConfiguration() local
415 result.ok()) { in readIoOveruseConfiguration()
416 configuration.componentLevelThresholds = *result; in readIoOveruseConfiguration()
418 return Error() << "Failed to read component-level thresholds: " << result.error(); in readIoOveruseConfiguration()
420 if (const auto result = readPackageSpecificThresholds(childElement); result.ok()) { in readIoOveruseConfiguration() local
421 configuration.packageSpecificThresholds = *result; in readIoOveruseConfiguration()
423 return Error() << "Failed to read package specific thresholds: " << result.error(); in readIoOveruseConfiguration()
425 if (const auto result = readAppCategorySpecificThresholds(childElement); result.ok()) { in readIoOveruseConfiguration() local
426 configuration.categorySpecificThresholds = *result; in readIoOveruseConfiguration()
428 return Error() << "Failed to read category specific thresholds: " << result.error(); in readIoOveruseConfiguration()
430 if (const auto result = readSystemWideThresholds(childElement); result.ok()) { in readIoOveruseConfiguration() local
431 configuration.systemWideThresholds = *result; in readIoOveruseConfiguration()
433 return Error() << "Failed to read system-wide thresholds: " << result.error(); in readIoOveruseConfiguration()
521 if (const auto result = writeStateElement(kStateIdForegroundMode, in writePerStateBytes() local
523 !result.ok()) { in writePerStateBytes()
525 << "': " << result.error(); in writePerStateBytes()
527 if (const auto result = writeStateElement(kStateIdBackgroundMode, in writePerStateBytes() local
529 !result.ok()) { in writePerStateBytes()
531 << "': " << result.error(); in writePerStateBytes()
533 if (const auto result = in writePerStateBytes() local
535 !result.ok()) { in writePerStateBytes()
537 << "': " << result.error(); in writePerStateBytes()
549 if (const auto result = writePerStateBytes(thresholds.perStateWriteBytes, childElement); in writeComponentLevelThresholds() local
550 !result.ok()) { in writeComponentLevelThresholds()
551 return Error() << "Failed to write per-state bytes: " << result.error(); in writeComponentLevelThresholds()
564 if (const auto result = writePerStateBytes(thresholds.perStateWriteBytes, childElement); in writePerStateThresholds() local
565 !result.ok()) { in writePerStateThresholds()
566 return Error() << "Failed to write per-state bytes: " << result.error(); in writePerStateThresholds()
579 if (const auto result = writePerStateThresholds(threshold, childElement); !result.ok()) { in writePackageSpecificThresholds() local
581 << "': " << result.error(); in writePackageSpecificThresholds()
596 if (const auto result = writePerStateThresholds(threshold, childElement); !result.ok()) { in writeAppCategorySpecificThresholds() local
598 << "': " << result.error(); in writeAppCategorySpecificThresholds()
620 if (const auto result = in writeAlertThresholds() local
622 !result.ok()) { in writeAlertThresholds()
624 << "': " << result.error(); in writeAlertThresholds()
626 if (const auto result = writeParamElement(kParamIdWrittenBytesPerSecond, in writeAlertThresholds() local
628 !result.ok()) { in writeAlertThresholds()
630 << "': " << result.error(); in writeAlertThresholds()
643 if (const auto result = writeAlertThresholds(threshold, childElement); !result.ok()) { in writeSystemWideThresholds() local
644 return Error() << "Failed to write I/O overuse alert thresholds:" << result.error(); in writeSystemWideThresholds()
657 if (const auto result = in writeIoOveruseConfiguration() local
659 !result.ok()) { in writeIoOveruseConfiguration()
660 return Error() << "Failed to write component-wide thresholds: " << result.error(); in writeIoOveruseConfiguration()
662 if (const auto result = writePackageSpecificThresholds(configuration.packageSpecificThresholds, in writeIoOveruseConfiguration() local
664 !result.ok()) { in writeIoOveruseConfiguration()
665 return Error() << "Failed to write package specific thresholds: " << result.error(); in writeIoOveruseConfiguration()
667 if (const auto result = in writeIoOveruseConfiguration() local
670 !result.ok()) { in writeIoOveruseConfiguration()
671 return Error() << "Failed to write app category specific thresholds: " << result.error(); in writeIoOveruseConfiguration()
673 if (const auto result = in writeIoOveruseConfiguration() local
675 !result.ok()) { in writeIoOveruseConfiguration()
676 return Error() << "Failed to write system-wide thresholds: " << result.error(); in writeIoOveruseConfiguration()
696 if (const auto result = readComponentType(rootElement); result.ok()) { in parseXmlFile() local
697 configuration.componentType = *result; in parseXmlFile()
699 return Error() << "Failed to read component type: " << result.error(); in parseXmlFile()
701 if (const auto result = readSafeToKillPackages(rootElement); result.ok()) { in parseXmlFile() local
702 configuration.safeToKillPackages = *result; in parseXmlFile()
704 return Error() << "Failed to read safe-to-kill packages: " << result.error(); in parseXmlFile()
706 if (const auto result = readVendorPackagePrefixes(rootElement); result.ok()) { in parseXmlFile() local
707 configuration.vendorPackagePrefixes = *result; in parseXmlFile()
709 return Error() << "Failed to read vendor package prefixes: " << result.error(); in parseXmlFile()
711 if (const auto result = readPackageToAppCategoryTypes(rootElement); result.ok()) { in parseXmlFile() local
712 configuration.packageMetadata = *result; in parseXmlFile()
714 return Error() << "Failed to read package to app category types: " << result.error(); in parseXmlFile()
716 if (const auto result = readIoOveruseConfiguration(configuration.componentType, rootElement); in parseXmlFile() local
717 result.ok()) { in parseXmlFile()
719 ResourceSpecificConfiguration(*result)); in parseXmlFile()
721 return Error() << "Failed to read I/O overuse configuration: " << result.error(); in parseXmlFile()
741 if (const auto result = writeComponentType(configuration.componentType, rootElement); in writeXmlFile() local
742 !result.ok()) { in writeXmlFile()
743 return Error() << "Failed to write component type: " << result.error(); in writeXmlFile()
745 if (const auto result = writeSafeToKillPackages(configuration.safeToKillPackages, rootElement); in writeXmlFile() local
746 !result.ok()) { in writeXmlFile()
747 return Error() << "Failed to write safe-to-kill packages: " << result.error(); in writeXmlFile()
749 if (const auto result = in writeXmlFile() local
751 !result.ok()) { in writeXmlFile()
752 return Error() << "Failed to write vendor package prefixes: " << result.error(); in writeXmlFile()
754 if (const auto result = in writeXmlFile() local
756 !result.ok()) { in writeXmlFile()
757 return Error() << "Failed to write package to app category types: " << result.error(); in writeXmlFile()
767 if (const auto result = writeIoOveruseConfiguration(ioOveruseConfig, rootElement); in writeXmlFile() local
768 !result.ok()) { in writeXmlFile()
769 return Error() << "Failed to write I/O overuse configuration: " << result.error(); in writeXmlFile()