/**
* Internal utilities for working with Capabilities.
* @name CapUtils
* @namespace
* @private
*/
define(["ARCore/machines"], function(Machines) {
"use strict";
var CapUtils = /** @lends CapUtils */ {
/**
* Ensures that a capability is enabled on localhost, printing messages
* with the given logger on success or failure.
*/
ensure: function(capName, logger, onSuccess) {
Machines.localhost.ensure(capName).done(function() {
logger.info(capName + " enabled");
if(onSuccess) {
onSuccess();
}
}).fail(function() {
logger.error(capName + " could not be enabled");
});
}
};
return CapUtils;
});