[Representation] Trust template URLs

Trust resource URLs to skip SCE-checking (which profiling
flags as a performance problem) for mct-include and
mct-representation; these URLs are pulled from bundles and
not user-entered, so should be trusted. WTD-1256.
This commit is contained in:
Victor Woeltjen
2015-06-18 14:43:14 -07:00
parent dc85d3c191
commit 275ca01692
5 changed files with 61 additions and 17 deletions

View File

@@ -52,7 +52,7 @@ define(
* representation extensions
* @param {ViewDefinition[]} views an array of view extensions
*/
function MCTRepresentation(representations, views, representers, $q, $log) {
function MCTRepresentation(representations, views, representers, $q, $sce, $log) {
var representationMap = {},
gestureMap = {};
@@ -69,11 +69,11 @@ define(
// Get a path to a representation
function getPath(representation) {
return [
return $sce.trustAsResourceUrl([
representation.bundle.path,
representation.bundle.resources,
representation.templateUrl
].join("/");
].join("/"));
}
// Look up a matching representation for this domain object
@@ -215,4 +215,4 @@ define(
return MCTRepresentation;
}
);
);