1<!DOCTYPE html> 2<!-- 3Copyright (c) 2015 The Chromium Authors. All rights reserved. 4Use of this source code is governed by a BSD-style license that can be 5found in the LICENSE file. 6--> 7<link rel="import" href="/tracing/base/base.html"> 8<link rel="import" href="/tracing/base/extension_registry.html"> 9<script> 10'use strict'; 11 12/** 13 * @fileoverview Base class for auditors. 14 */ 15tr.exportTo('tr.c', function() { 16 function Auditor(model) { 17 this.model_ = model; 18 } 19 20 Auditor.prototype = { 21 __proto__: Object.prototype, 22 23 get model() { 24 return this.model_; 25 }, 26 27 /** 28 * Called by the Model after baking slices. May modify model. 29 */ 30 runAnnotate: function() { 31 }, 32 33 /** 34 * Called by import to install userFriendlyCategoryDriver. 35 */ 36 installUserFriendlyCategoryDriverIfNeeded: function() { 37 }, 38 39 /** 40 * Called by the Model after importing. Should not modify model, except 41 * for adding interaction ranges and audits. 42 */ 43 runAudit: function() { 44 } 45 }; 46 47 var options = new tr.b.ExtensionRegistryOptions(tr.b.BASIC_REGISTRY_MODE); 48 options.defaultMetadata = {}; 49 options.mandatoryBaseClass = Auditor; 50 tr.b.decorateExtensionRegistry(Auditor, options); 51 52 return { 53 Auditor: Auditor 54 }; 55}); 56</script> 57