Home | History | Annotate | Download | only in chromium-trace

Lines Matching defs:base

1 window.FLATTENED={};window.FLATTENED_RAW_SCRIPTS={};window.FLATTENED.base=!0;window.FLATTENED["tracing.color_scheme"]=!0;window.FLATTENED["tracing.importer.linux_perf.parser"]=!0;window.FLATTENED["base.guid"]=!0;window.FLATTENED["tracing.trace_model.counter_series"]=!0;window.FLATTENED["tracing.importer.linux_perf.android_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.bus_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.clock_parser"]=!0;
3 window.FLATTENED["tracing.importer.linux_perf.mali_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.power_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.sched_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.sync_parser"]=!0;window.FLATTENED["tracing.importer.linux_perf.workqueue_parser"]=!0;window.FLATTENED["base.event_target"]=!0;window.FLATTENED["base.events"]=!0;window.FLATTENED["base.range"]=!0;window.FLATTENED["tracing.filter"]=!0;
4 window.FLATTENED["tracing.trace_model.counter"]=!0;window.FLATTENED["tracing.trace_model.trace_model_event"]=!0;window.FLATTENED["tracing.trace_model.slice"]=!0;window.FLATTENED["tracing.trace_model.cpu"]=!0;window.FLATTENED["base.sorted_array_utils"]=!0;window.FLATTENED["base.iteration_helpers"]=!0;window.FLATTENED["base.utils"]=!0;window.FLATTENED["tracing.trace_model.object_snapshot"]=!0;window.FLATTENED["tracing.trace_model.object_instance"]=!0;
5 window.FLATTENED["tracing.trace_model.time_to_object_instance_map"]=!0;window.FLATTENED["tracing.trace_model.object_collection"]=!0;window.FLATTENED["tracing.trace_model.async_slice"]=!0;window.FLATTENED["tracing.trace_model.async_slice_group"]=!0;window.FLATTENED["tracing.trace_model.sample"]=!0;window.FLATTENED["tracing.trace_model.slice_group"]=!0;window.FLATTENED["tracing.trace_model.thread"]=!0;window.FLATTENED["base.settings"]=!0;window.FLATTENED["tracing.trace_model_settings"]=!0;
7 window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/mat4.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec2.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec3.js"]=!0;window.FLATTENED_RAW_SCRIPTS["../third_party/gl-matrix/src/gl-matrix/vec4.js"]=!0;window.FLATTENED["base.gl_matrix"]=!0;window.FLATTENED["base.quad"]=!0;window.FLATTENED["tracing.trace_model.instant_event"]=!0;
10 window.FLATTENED["tracing.analysis.slice_view"]=!0;window.FLATTENED["tracing.analysis.analysis_view"]=!0;window.FLATTENED["base.properties"]=!0;window.FLATTENED["ui.overlay"]=!0;window.FLATTENED["tracing.category_filter_dialog"]=!0;window.FLATTENED["tracing.mouse_mode_constants"]=!0;window.FLATTENED["tracing.timeline_viewport"]=!0;window.FLATTENED["base.raf"]=!0;window.FLATTENED["ui.container_that_decorates_its_children"]=!0;window.FLATTENED["tracing.tracks.track"]=!0;
11 window.FLATTENED["tracing.tracks.drawing_container"]=!0;window.FLATTENED["tracing.constants"]=!0;window.FLATTENED["tracing.tracks.heading_track"]=!0;window.FLATTENED["tracing.tracks.ruler_track"]=!0;window.FLATTENED["base.measuring_stick"]=!0;window.FLATTENED["tracing.tracks.container_track"]=!0;window.FLATTENED["tracing.fast_rect_renderer"]=!0;window.FLATTENED["tracing.tracks.slice_track"]=!0;window.FLATTENED["tracing.tracks.cpu_track"]=!0;
16 this.base=function(){function d(a){"/"==a[a.length-1]&&(a=a.substring(0,a.length-1));l=a}function b(a,c){n[a]||(n[a]=[]);for(var e=n[a],b=!1,f=0;f<e.length;f++)e[f]==c&&(b=!0);b||e.push(c)}function a(a,c){q[a]||(q[a]=[]);for(var e=q[a],b=!1,f=0;f<q.length;f++)e[f]==c&&(b=!0);b||e.push(c)}function c(a,c){p[a]||(p[a]=[]);for(var e=p[a],b=!1,f=0;f<e.length;f++)e[f]==c&&(b=!0);b||e.push(c)}function e(){if(!window.FLATTENED&&!m){m=!0;var e=new XMLHttpRequest;e.open("GET","/deps.js",!1);e.send(null);if(200!=
18 setTimeout(function(){document.body.appendChild(g)},150);throw Error(f);}base.addModuleDependency=b;base.addModuleRawScriptDependency=a;base.addModuleStylesheet=c;try{eval(e.responseText)}catch(d){throw Error("When loading deps, got "+d.stack?d.stack:d.message);}delete base.addModuleStylesheet;delete base.addModuleRawScriptDependency;delete base.addModuleDependency}}function f(){if(!t&&!window.FLATTENED){t=!0;var a=new XMLHttpRequest;a.open("GET","/templates",!1);a.send(null);var c=document.createElement("div");
20 c=q[a]||[];for(e=0;e<c.length;e++){var f=c[e];w[f]||(h(f),w[f]="APPENDED")}h(a.replace(/\./g,"/")+".js");v[name]="APPENDED"}})}function h(a){var c=document.createElement("script");c.src=l+"/"+a;c.type="text/javascript";c.defer=!0;c.async=!1;base.doc.head.appendChild(c)}function k(a){if(!window.FLATTENED&&!s[a]){s[a]=!0;a=a.replace(/\./g,"/")+".css";a=l+"/"+a;var c=document.createElement("link");c.setAttribute("rel","stylesheet");c.setAttribute("href",a);base.doc.head.appendChild(c)}}var l=".",m=!1,
21 n={},p={},q={},t=!1,v={},w={},s={},r={};return{set moduleBasePath(a){d(a)},get moduleBasePath(){return l},initialize:function(){if(global.document)base.doc=document,base.isMac=/Mac/.test(navigator.platform),base.isWindows=/Win/.test(navigator.platform),base.isChromeOS=/CrOS/.test(navigator.userAgent),base.isLinux=/Linux/.test(navigator.userAgent),base.isGTK=/GTK/.test(chrome.toolkit),base.isViews=/views/.test(chrome.toolkit),d("/src");else{var a=base;Object.defineProperty(global,"base",{get:function(){Object.defineProperty(global,
22 "base",{value:a});a.initialize();return a},configurable:!0})}},require:g,requireStylesheet:k,requireRawScript:function(a){if(window.FLATTENED_RAW_SCRIPTS){if(!window.FLATTENED_RAW_SCRIPTS[a])throw Error("Somehow, "+a+" didn't get stored in the flattened js file! You may need to rerun build/generate_about_tracing_contents.py");}else if(!w[a])throw Error(a+" should already have been loaded. Did you forget to run build/generate_about_tracing_contents.py?");},requireTemplate:function(a){if(!window.FLATTENED&&
23 !r[a]){r[a]=!0;a=a.replace(/\./g,"/")+".html";a=l+"/"+a;var c=document.createElement("link");c.setAttribute("rel","import");c.setAttribute("href",a)}},exportTo:function(a,c){var e;e=a.split(".");for(var b=global,f;e.length&&(f=e.shift());)b=f in b?b[f]:b[f]={};e=b;try{var g=c()}catch(h){console.log("While running exports for ",a,":");console.log(h.stack||h);return}for(var d in g)(b=Object.getOwnPropertyDescriptor(g,d))&&Object.defineProperty(e,d,b)}}}();base.initialize();"use strict";
24 base.exportTo("tracing",function(){function d(a){for(var c=0,e=0;e<a.length;++e)c=(c+37*c+11*a.charCodeAt(e))%4294967295;return c}var b=[{r:138,g:113,b:152},{r:175,g:112,b:133},{r:127,g:135,b:225},{r:93,g:81,b:137},{r:116,g:143,b:119},{r:178,g:214,b:122},{r:87,g:109,b:147},{r:119,g:155,b:95},{r:114,g:180,b:160},{r:132,g:85,b:103},{r:157,g:210,b:150},{r:148,g:94,b:86},{r:164,g:108,b:138},{r:139,g:191,b:150},{r:110,g:99,b:145},{r:80,g:129,b:109},{r:125,g:140,b:149},{r:93,g:124,b:132},{r:140,g:85,b:140},
27 base.exportTo("tracing.importer.linux_perf",function(){function d(a){this.importer=a;this.model=a.model}var b=[];d.registerSubtype=function(a){b.push(a)};d.getSubtypeConstructors=function(){return b};d.prototype={__proto__:Object.prototype};return{Parser:d}});"use strict";base.exportTo("base",function(){var d=1;return{GUID:{allocate:function(){return d++}}}});"use strict";base.require("base.guid");
28 base.exportTo("tracing.trace_model",function(){function d(a,c){this.guid_=base.GUID.allocate();this.timestamp_=a;this.value_=c}function b(a,c){this.guid_=base.GUID.allocate();this.name_=a;this.color_=c;this.timestamps_=[];this.samples_=[]}d.prototype={__proto__:Object.prototype,get value(){return this.value_},set timestamp(a){this.timestamp_=a},toJSON:function(){for(var a={},c=Object.keys(this),e=0;e<c.length;e++){var b=c[e];"function"!=typeof this[b]&&(a[b]="parent"==b?this[b].guid:this[b])}return a}};
31 "use strict";base.require("tracing.importer.linux_perf.parser");base.require("tracing.trace_model.counter_series");
32 base.exportTo("tracing.importer.linux_perf",function(){function d(c){a.call(this,c);c.registerEventHandler("tracing_mark_write:android",d.prototype.traceMarkWriteAndroidEvent.bind(this));c.registerEventHandler("0:android",d.prototype.traceMarkWriteAndroidEvent.bind(this));this.model_=c.model_;this.ppids_={}}function b(a){var e={};if(a){a=a.split(";");for(var b=0;b<a.length;++b){var g=a[b].split("=");g[0]&&(e[g.shift()]=g.join("="))}}return e}var a=tracing.importer.linux_perf.Parser;d.prototype={__proto__:a.prototype,
36 n)});break;case "S":e=parseInt(a[1]);l=a[2];a=parseInt(a[3]);m=this.model_.getOrCreateProcess(e).getOrCreateThread(f);m.name=h.threadName;this.ppids_[f]=e;this.openAsyncSlice(m,null,l,a,g);break;case "F":e=this.ppids_[f];if(void 0===e)break;m=this.model_.getOrCreateProcess(e).getOrCreateThread(f);l=a[2];a=parseInt(a[3]);this.closeAsyncSlice(m,l,a,g);break;default:return!1}return!0}};a.registerSubtype(d);return{AndroidParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");base.require("tracing.trace_model.counter_series");
37 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("memory_bus_usage",d.prototype.traceMarkWriteBusEvent.bind(this));this.model_=a.model_;this.ppids_={}}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,traceMarkWriteBusEvent:function(a,c,e,b,g,h){e=/bus=(\S+) rw_bytes=(\d+) r_bytes=(\d+) w_bytes=(\d+) cycles=(\d+) ns=(\d+)/.exec(g.details);a=e[1];parseInt(e[2]);c=parseInt(e[3]);parseInt(e[4]);parseInt(e[5]);e=parseInt(e[6]);
39 d)});return!0}};b.registerSubtype(d);return{BusParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");base.require("tracing.trace_model.counter_series");
40 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("clock_set_rate",d.prototype.traceMarkWriteClockEvent.bind(this));this.model_=a.model_;this.ppids_={}}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,traceMarkWriteClockEvent:function(a,c,e,b,g,h){a=/(\S+) state=(\d+) cpu_id=(\d+)/.exec(g.details);c=a[1];var d=parseInt(a[2]);a=this.model_.getOrCreateProcess(0).getOrCreateCounter(null,c);0===a.numSeries&&a.addSeries(new tracing.trace_model.CounterSeries("value",
41 tracing.getStringColorId(a.name+".value")));a.series.forEach(function(a){a.addSample(b,d)});return!0}};b.registerSubtype(d);return{ClockParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
42 base.exportTo("tracing.importer.linux_perf",function(){function d(c){a.call(this,c);c.registerEventHandler("cpufreq_interactive_up",d.prototype.cpufreqUpDownEvent.bind(this));c.registerEventHandler("cpufreq_interactive_down",d.prototype.cpufreqUpDownEvent.bind(this));c.registerEventHandler("cpufreq_interactive_already",d.prototype.cpufreqTargetEvent.bind(this));c.registerEventHandler("cpufreq_interactive_notyet",d.prototype.cpufreqTargetEvent.bind(this));c.registerEventHandler("cpufreq_interactive_setspeed",
45 e,f,g,h){e=b(h.details);this.cpufreqSlice(g,a,e.cpu,e);return!0},cpufreqTargetEvent:function(a,e,f,g,h){e=b(h.details);this.cpufreqSlice(g,a,e.cpu,e);return!0},cpufreqBoostUnboostEvent:function(a,e,b,g,h){this.cpufreqBoostSlice(g,a,{type:h.details});return!0}};a.registerSubtype(d);return{CpufreqParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
46 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("ext4_sync_file_enter",d.prototype.ext4SyncFileEnterEvent.bind(this));a.registerEventHandler("ext4_sync_file_exit",d.prototype.ext4SyncFileExitEvent.bind(this));a.registerEventHandler("block_rq_issue",d.prototype.blockRqIssueEvent.bind(this));a.registerEventHandler("block_rq_complete",d.prototype.blockRqCompleteEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,
50 this.openAsyncSlice(b,"block",g.threadName,g.pid,c+"-"+e+"-"+h,a);return!0},blockRqCompleteEvent:function(a,c,e,b,g){var h=/(\d+,\d+) (F)?([DWRN])(F)?(A)?(S)?(M)? \(.*\) (\d+) \+ (\d+) \[(.*)\]/.exec(g.details);if(!h)return!1;a=h[1];c=parseInt(h[8]);e=parseInt(h[9]);h=parseInt(h[10]);this.closeAsyncSlice(b,"block",g.threadName,g.pid,a+"-"+c+"-"+e,{device:a,sector:c,numSectors:e,error:h});return!0}};b.registerSubtype(d);return{DiskParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
51 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("drm_vblank_event",d.prototype.vblankEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,drmVblankSlice:function(a,c,e){var b=this.importer.getOrCreatePseudoThread("drm_vblank");b.openSlice=c;a=new tracing.trace_model.Slice("",b.openSlice,tracing.getStringColorId(b.openSlice),a,e,0);b.thread.sliceGroup.pushSlice(a)},vblankEvent:function(a,c,e,b,g){c=
52 /crtc=(\d+), seq=(\d+)/.exec(g.details);if(!c)return!1;a=parseInt(c[1]);c=parseInt(c[2]);this.drmVblankSlice(b,"vblank:"+a,{crtc:a,seq:c});return!0}};b.registerSubtype(d);return{DrmParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
53 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("exynos_flip_request",d.prototype.flipEvent.bind(this));a.registerEventHandler("exynos_flip_complete",d.prototype.flipEvent.bind(this));a.registerEventHandler("exynos_busfreq_target_int",d.prototype.busfreqTargetIntEvent.bind(this));a.registerEventHandler("exynos_busfreq_target_mif",d.prototype.busfreqTargetMifEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,
56 b,parseInt(a[1]));return!0},busfreqTargetMifEvent:function(a,c,e,b,g){a=/frequency=(\d+)/.exec(g.details);if(!a)return!1;this.exynosBusfreqSample("MIF Frequency",b,parseInt(a[1]));return!0}};b.registerSubtype(d);return{ExynosParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
57 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("tracing_mark_write:log",d.prototype.logEvent.bind(this));a.registerEventHandler("tracing_mark_write:SyncInterpret",d.prototype.syncEvent.bind(this));a.registerEventHandler("tracing_mark_write:HandleTimer",d.prototype.timerEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,gestureOpenSlice:function(a,c,e){this.importer.getOrCreatePseudoThread("gesture").thread.sliceGroup.beginSlice("touchpad_gesture",
60 "use strict";base
61 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("i915_gem_object_create",d.prototype.gemObjectCreateEvent.bind(this));a.registerEventHandler("i915_gem_object_bind",d.prototype.gemObjectBindEvent.bind(this));a.registerEventHandler("i915_gem_object_unbind",d.prototype.gemObjectBindEvent.bind(this));a.registerEventHandler("i915_gem_object_change_domain",d.prototype.gemObjectChangeDomainEvent.bind(this));a.registerEventHandler("i915_gem_object_pread",
72 return!0}};b.registerSubtype(d);return{I915Parser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
73 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("graph_ent",d.prototype.traceKernelFuncEnterEvent.bind(this));a.registerEventHandler("graph_ret",d.prototype.traceKernelFuncReturnEvent.bind(this));this.model_=a.model_;this.ppids_={}}var b=tracing.importer.linux_perf.Parser,a=/func=(.+)/;d.prototype={__proto__:b.prototype,traceKernelFuncEnterEvent:function(c,e,b,g,h){c=a.exec(h.details);if(!c||void 0===h.tgid)return!1;e=parseInt(h.tgid);c=c[1];
75 !1;0<h.openSliceCount&&h.endSlice(g);return!0}};b.registerSubtype(d);return{KernelFuncParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
76 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("mali_dvfs_event",d.prototype.dvfsEventEvent.bind(this));a.registerEventHandler("mali_dvfs_set_clock",d.prototype.dvfsSetClockEvent.bind(this));a.registerEventHandler("mali_dvfs_set_voltage",d.prototype.dvfsSetVoltageEvent.bind(this));this.addJMCounter("mali_hwc_MESSAGES_SENT","Messages Sent");this.addJMCounter("mali_hwc_MESSAGES_RECEIVED","Messages Received");this.addJMCycles("mali_hwc_GPU_ACTIVE",
104 a,c,b,f)},addL2Counter:function(a,c){this.importer.registerEventHandler(a,function(a,b,g,d,k){return this.l2Sample(c,"count",d,k)}.bind(this))},addL2Cycles:function(a,c){this.importer.registerEventHandler(a,function(a,b,g,d,k){return this.l2Sample(c,"cycles",d,k)}.bind(this))}};b.registerSubtype(d);return{MaliParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");base.require("tracing.trace_model.counter_series");
105 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("power_start",d.prototype.powerStartEvent.bind(this));a.registerEventHandler("power_frequency",d.prototype.powerFrequencyEvent.bind(this));a.registerEventHandler("cpu_frequency",d.prototype.cpuFrequencyEvent.bind(this));a.registerEventHandler("cpu_idle",d.prototype.cpuIdleEvent.bind(this))}var b=tracing.importer.linux_perf.Parser;d.prototype={__proto__:b.prototype,cpuStateSlice:function(a,c,
109 if(!c)return!1;a=parseInt(c[2]);c=parseInt(c[1]);this.cpuIdleSlice(f,a,c);return!0}};b.registerSubtype(d);return{PowerParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
110 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("sched_switch",d.prototype.schedSwitchEvent.bind(this));a.registerEventHandler("sched_wakeup",d.prototype.schedWakeupEvent.bind(this))}var b=tracing.importer.linux_perf.Parser,a={},c=RegExp("prev_comm=(.+) prev_pid=(\\d+) prev_prio=(\\d+) prev_state=(\\S\\+?|\\S\\|\\S) ==> next_comm=(.+) next_pid=(\\d+) next_prio=(\\d+)");a.schedSwitchRE=c;var e=/comm=(.+) pid=(\d+) prio=(\d+) success=(\d+) target_cpu=(\d+)/;
112 "use strict";base.require("tracing.importer.linux_perf.parser");
113 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("sync_timeline",d.prototype.timelineEvent.bind(this));a.registerEventHandler("sync_wait",d.prototype.syncWaitEvent.bind(this));a.registerEventHandler("sync_pt",d.prototype.syncPtEvent.bind(this));this.model_=a.model_}var b=tracing.importer.linux_perf.Parser,a=/name=(\S+) value=(\S*)/,c=/(\S+) name=(\S+) state=(\d+)/,e=/name=(\S+) value=(\S*)/;d.prototype={__proto__:b.prototype,timelineEvent:function(c,
115 e.name=l.threadName;l=e.kernelSliceGroup;if(!l.isTimestampValidForBeginOrEnd(d))return this.model_.importErrors.push("Timestamps are moving backward."),!1;e='fence_wait("'+a[2]+'")';if("begin"==a[1])l.beginSlice(null,e,d,{"Start state":a[3]});else if("end"==a[1])0<l.openSliceCount&&l.endSlice(d);else return!1;return!0},syncPtEvent:function(a,c,b,d,l){return e.exec(l.details)?!0:!1}};b.registerSubtype(d);return{SyncParser:d}});"use strict";base.require("tracing.importer.linux_perf.parser");
116 base.exportTo("tracing.importer.linux_perf",function(){function d(a){b.call(this,a);a.registerEventHandler("workqueue_execute_start",d.prototype.executeStartEvent.bind(this));a.registerEventHandler("workqueue_execute_end",d.prototype.executeEndEvent.bind(this));a.registerEventHandler("workqueue_queue_work",d.prototype.executeQueueWork.bind(this));a.registerEventHandler("workqueue_activate_work",d.prototype.executeActivateWork.bind(this))}var b=tracing.importer.linux_perf.Parser,a=/work struct (.+): function (\S+)/,
119 base.exportTo("base",function(){function d(){}d.prototype={addEventListener:function(a,c){this.listeners_||(this.listeners_=Object.create(null));if(a in this.listeners_){var b=this.listeners_[a];0>b.indexOf(c)&&b.push(c)}else this.listeners_[a]=[c]},removeEventListener:function(a,c){if(this.listeners_&&a in this.listeners_){var b=this.listeners_[a],f=b.indexOf(c);0<=f&&(1==b.length?delete this.listeners_[a]:b.splice(f,1))}},dispatchEvent:function(a){if(!this.listeners_)return!0;var c=this;a.__defineGetter__("target",
121 a,c,b);void 0===this.listenerCounts_[a]&&(this.listenerCounts_[a]=0);this.listenerCounts_[a]++},removeEventListener:function(a,c,b){this.__proto__.removeEventListener.call(this,a,c,b);this.listenerCounts_[a]--},hasEventListener:function(a){return 0<this.listenerCounts_[a]}};return{EventTarget:d,EventTargetHelper:b}});"use strict";base.require("base.event_target");
122 base.exportTo("base",function(){function d(b,a,c){var e=base.doc.createEvent("Event");e.initEvent(b,!!a,!!c);e.__proto__=global.Event.prototype;return e}d.prototype={__proto__:global.Event.prototype};return{Event:d,dispatchSimpleEvent:function(b,a,c,e){a=new d(a,c,e);return b.dispatchEvent(a)}}});"use strict";
123 base.exportTo("base",function(){function d(){this.isEmpty_=!0;this.max_=this.min_=void 0}d.prototype={__proto__:Object.prototype,reset:function(){this.isEmpty_=!0;this.max_=this.min_=void 0},get isEmpty(){return this.isEmpty_},addRange:function(b){b.isEmpty||(this.addValue(b.min),this.addValue(b.max))},addValue:function(b){this.isEmpty_?(this.min_=this.max_=b,this.isEmpty_=!1):(this.max_=Math.max(this.max_,b),this.min_=Math.min(this.min_,b))},get min(){return this.isEmpty_?void 0:this.min_},get max(){return this.isEmpty_?
125 base.exportTo("tracing",function(){function d(){}function b(a){this.text_=a.toLowerCase()}function a(a){this.categories_={};a=a||[];for(var b=0;b<a.length;b++)this.addCategory(a[b])}d.prototype={__proto__:Object.prototype,matchCounter:function(a){return!0},matchCpu:function(a){return!0},matchProcess:function(a){return!0},matchSlice:function(a){return!0},matchThread:function(a){return!0}};b.prototype={__proto__:d.prototype,matchCounter:function(a){return 0===this.text_.length||void 0===a.name?!1:-1!==
127 f.push(b[g]);return f},filterSliceArray:function(a,b){if(void 0===a)return b;for(var f=[],g=0;g<b.length;++g)a.matchSlice(b[g])&&f.push(b[g]);return f},Filter:d,TitleFilter:b,CategoryFilter:a}});"use strict";base.require("base.guid");base.require("base.range");base.require("tracing.trace_model.counter_series");
128 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e){this.guid_=base.GUID.allocate();this.parent=b;this.id=a;this.category=c||"";this.name=e;this.series_=[];this.bounds=new base.Range}d.prototype={__proto__:Object.prototype,get guid(){return this.guid_},toJSON:function(){for(var b={},a=Object.keys(this),c=0;c<a.length;c++){var e=a[c];"function"!=typeof this[e]&&(b[e]="parent"==e?this[e].guid:this[e])}return b},set timestamps(b){throw Error("Bad counter API. No cookie.");},set seriesNames(b){throw Error("Bad counter API. No cookie.");
131 this.maxTotal=Math.max(e,this.maxTotal)}}}};d.compare=function(b,a){var c=b.parent.compareTo(a);if(0!=c)return c;c=b.name.localeCompare(a.name);return 0==c?b.tid-a.tid:c};return{Counter:d}});"use strict";base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){this.category=b||"";this.title=a;this.colorId=c;this.start=e;this.args=f;this.didNotFinish=!1}d.prototype={selected:!1,duration:0,get end(){return this.start}};return{TraceModelEvent:d}});"use strict";base.require("tracing.trace_model.trace_model_event");
132 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f,g){tracing.trace_model.TraceModelEvent.call(this,b,a,c,e,f);void 0!==g&&(this.duration=g)}d.prototype={__proto__:tracing.trace_model.TraceModelEvent.prototype,get end(){return this.start+this.duration}};return{Slice:d}});"use strict";base.require("base.range");base.require("tracing.trace_model.slice");base.require("tracing.trace_model.counter");
133 base.exportTo("tracing.trace_model",function(){function d(a){this.cpuNumber=a;this.slices=[];this.counters={};this.bounds=new base.Range}var b=tracing.trace_model.Counter;d.prototype={getOrCreateCounter:function(a,c){var e;e=a.length?a+"."+c:c;this.counters[e]||(this.counters[e]=new b(this,e,a,c));return this.counters[e]},shiftTimestampsForward:function(a){for(var c=0;c<this.slices.length;c++)this.slices[c].start+=a;for(var b in this.counters)this.counters[b].shiftTimestampsForward(a)},updateBounds:function(){this.bounds.reset();
135 base.exportTo("base",function(){function d(a,c,b){if(0==a.length)return 1;for(var f=0,g=a.length-1,d,k,l=-1;f<=g;)d=Math.floor((f+g)/2),k=c(a[d])-b,0>k?f=d+1:(0<k||(l=d),g=d-1);return-1!=l?l:f}function b(a,c,b,f,g,h){if(0!=a.length&&!(f>g)){var k=d(a,c,f);if(-1!=k&&(0<k&&c(a[k-1])+b(a[k-1],k-1)>=f&&h(a[k-1]),k!=a.length))for(b=a.length;k<b&&!(c(a[k])>=g);k++)h(a[k])}}return{findLowIndexInSortedArray:d,findLowIndexInSortedIntervals:function(a,c,b,f){var g=d(a,c,f);return 0==g?f>=c(a[0])&&f<c(a[0])+
137 base.exportTo("base",function(){function d(b,a){if(b instanceof Object)if(b instanceof Array)for(var c=0;c<b.length;c++)a(b,c,b[c]),d(b[c],a);else for(c in b){var e=b[c];a(b,c,e);d(e,a)}}return{asArray:function(b){for(var a=[],c=0;c<b.length;c++)a.push(b[c]);return a},concatenateArrays:function(){for(var b=[],a=0;a<arguments.length;a++){if(!(arguments[a]instanceof Array))throw Error("Arguments "+a+"is not an array");b.push.apply(b,arguments[a])}return b},compareArrays:function(b,a,c){for(var e=Math.min(b.length,
138 a.length),f=0;f<e;f++){var g=c(b[f],a[f]);if(g)return g}return b.length==a.length?0:void 0===b[f]?-1:1},comparePossiblyUndefinedValues:function(b,a,c){return void 0!==b&&void 0!==a?c(b,a):void 0!==b?-1:void 0!==a?1:0},dictionaryKeys:function(b){var a=[],c;for(c in b)a.push(c);return a},dictionaryValues:function(b){var a=[],c;for(c in b)a.push(b[c]);return a},iterItems:function(b,a,c){c=c||this;for(var e in b)a.call(c,e,b[e])},iterObjectFieldsRecursively:d}});"use strict";base.require("base.iteration_helpers");
139 base.exportTo("base",function(){return{addSingletonGetter:function(d){d.getInstance=function(){return d.instance_||(d.instance_=new d)}},tracedFunction:function(d,b,a){return function(){console.time(b);try{d.apply(a,arguments)}finally{console.timeEnd(b)}}},normalizeException:function(d){return"string"==typeof d?{message:d,stack:["<unknown>"]}:{message:d.message,stack:d.stack?d.stack:["<unknown>"]}},instantiateTemplate:function(d){return document.querySelector(d).content.cloneNode(!0)},stackTrace:function(){var d=
141 base.exportTo("tracing.trace_model",function(){function d(b,a,c){this.objectInstance=b;this.ts=a;this.args=c;this.selected=!1}d.prototype={__proto__:Object.prototype,preInitialize:function(){},initialize:function(){}};d.nameToConstructorMap_={};d.register=function(b,a){if(d.nameToConstructorMap_[b])throw Error("Constructor already registerd for "+b);d.nameToConstructorMap_[b]=a};d.unregister=function(b){delete d.nameToConstructorMap_[b]};d.getConstructor=function(b){return d.nameToConstructorMap_[b]?
142 d.nameToConstructorMap_[b]:d};return{ObjectSnapshot:d}});"use strict";base.require("base.range");base.require("base.sorted_array_utils");base.require("tracing.trace_model.object_snapshot");
143 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){this.parent=b;this.id=a;this.category=c;this.name=e;this.creationTs=f;this.creationTsWasExplicit=!1;this.deletionTs=Number.MAX_VALUE;this.selected=this.deletionTsWasExplicit=!1;this.colorId=0;this.bounds=new base.Range;this.snapshots=[];this.hasImplicitSnapshots=!1}d.prototype={__proto__:Object.prototype,get typeName(){return this.name},addSnapshot:function(b,a){if(b<this.creationTs)throw Error("Snapshots must be >= instance.creationTs");
146 this.deletionTs)throw Error("ts must be within lifetime of this instance");var a=this.snapshots;b=base.findLowIndexInSortedIntervals(a,function(a){return a.ts},function(c,b){return b==a.length-1?a[b].objectInstance.deletionTs:a[b+1].ts-a[b].ts},b);return 0>b?this.snapshots[0]:b>=this.snapshots.length?this.snapshots[this.snapshots.length-1]:this.snapshots[b]},updateBounds:function(){this.bounds.reset();this.bounds.addValue(this.creationTs);this.deletionTs!=Number.MAX_VALUE?this.bounds.addValue(this.deletionTs):
148 d.nameToConstructorMap_[b]:d};return{ObjectInstance:d}});"use strict";base.require("base.range");base.require("base.sorted_array_utils");
149 base.exportTo("tracing.trace_model",function(){function d(b,a,c){this.createObjectInstanceFunction_=b;this.parent=a;this.id=c;this.instances=[]}d.prototype={idWasCreated:function(b,a,c){if(0==this.instances.length)return this.instances.push(this.createObjectInstanceFunction_(this.parent,this.id,b,a,c)),this.instances[0].creationTsWasExplicit=!0,this.instances[0];var e=this.instances[this.instances.length-1];if(c<e.deletionTs)throw Error("Mutation of the TimeToObjectInstanceMap must be done in ascending timestamp order.");
150 e=this.createObjectInstanceFunction_(this.parent,this.id,b,a,c);e.creationTsWasExplicit=!0;this.instances.push(e);return e},addSnapshot:function(b,a,c,e){0==this.instances.length&&this.instances.push(this.createObjectInstanceFunction_(this.parent,this.id,b,a,c));var f=base.findLowIndexInSortedIntervals(this.instances,function(a){return a.creationTs},function(a){return a.deletionTs-a.creationTs},c);if(0>f){f=this.instances[0];if(c>f.deletionTs||f.creationTsWasExplicit)throw Error("At the provided timestamp, no instance was still alive");
153 if(e.deletionTs==Number.MAX_VALUE)return e.wasDeleted(c),e;if(c<e.deletionTs)throw Error("id was already deleted earlier.");e=this.createObjectInstanceFunction_(this.parent,this.id,b,a,c);this.instances.push(e);return e},getInstanceAt:function(b){b=base.findLowIndexInSortedIntervals(this.instances,function(a){return a.creationTs},function(a){return a.deletionTs-a.creationTs},b);return 0>b?this.instances[0].creationTsWasExplicit?void 0:this.instances[0]:b>=this.instances.length?void 0:this.instances[b]}};
154 return{TimeToObjectInstanceMap:d}});"use strict";base.require("base.utils");base.require("base.range");base.require("base.sorted_array_utils");base.require("tracing.trace_model.object_instance");base.require("tracing.trace_model.time_to_object_instance_map");
155 base.exportTo("tracing.trace_model",function(){function d(b){this.parent=b;this.bounds=new base.Range;this.instanceMapsById_={};this.instancesByTypeName_={};this.createObjectInstance_=this.createObjectInstance_.bind(this)}d.prototype={__proto__:Object.prototype,createObjectInstance_:function(b,a,c,e,f){b=new (tracing.trace_model.ObjectInstance.getConstructor(e))(b,a,c,e,f);a=b.typeName;c=this.instancesByTypeName_[a];c||(c=[],this.instancesByTypeName_[a]=c);c.push(b);return b},getOrCreateInstanceMap_:function(b){var a=
157 return b},idWasDeleted:function(b,a,c,e){if(b=this.getOrCreateInstanceMap_(b,a,c,e).idWasDeleted(a,c,e)){if(b.category!=a)throw Error("Deleting an object with a different category than when it was created");if(b.name!=c)throw Error("Deleting an object with a different name than when it was created");}},autoDeleteObjects:function(b){base.iterItems(this.instanceMapsById_,function(a,c){var e=c.lastInstance;e.deletionTs==Number.MAX_VALUE&&(c.idWasDeleted(e.category,e.name,b),e.deletionTsWasExplicit=!1)})},
158 getObjectInstanceAt:function(b,a){var c=this.instanceMapsById_[b];return c?c.getInstanceAt(a):void 0},getSnapshotAt:function(b,a){var c=this.getObjectInstanceAt(b,a);return c?c.getSnapshotAt(a):void 0},iterObjectInstances:function(b,a){a=a||this;base.iterItems(this.instanceMapsById_,function(c,e){e.instances.forEach(b,a)})},getAllObjectInstances:function(){var b=[];this.iterObjectInstances(function(a){b.push(a)});return b},getAllInstancesNamed:function(b){return this.instancesByTypeName_[b]},getAllInstancesByTypeName:function(){return this.instancesByTypeName_},
160 addCategoriesToDict:function(b){this.iterObjectInstances(function(a){b[a.category]=!0})},toJSON:function(){return{}}};return{ObjectCollection:d}});"use strict";base.require("tracing.trace_model.slice");
161 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){tracing.trace_model.Slice.apply(this,arguments)}d.prototype={__proto__:tracing.trace_model.Slice.prototype,toJSON:function(){for(var b={},a=Object.keys(this),c=0;c<a.length;c++){var e=a[c];"function"!=typeof this[e]&&(b[e]="startThread"==e||"endThread"==e?this[e].guid:this[e])}return b},id:void 0,startThread:void 0,endThread:void 0,subSlices:void 0};return{AsyncSlice:d}});"use strict";base.require("base.range");base.require("tracing.trace_model.async_slice");
162 base.exportTo("tracing.trace_model",function(){function d(){this.slices=[];this.bounds=new base.Range}d.prototype={__proto__:Object.prototype,push:function(b){this.slices.push(b)},get length(){return this.slices.length},shiftTimestampsForward:function(b){for(var a=0;a<this.slices.length;a++){var c=this.slices[a];c.start+=b;for(var e=0;e<c.subSlices.length;e++)c.subSlices[e].start+=b}},updateBounds:function(){this.bounds.reset();for(var b=0;b<this.slices.length;b++)this.bounds.addValue(this.slices[b].start),
163 this.bounds.addValue(this.slices[b].end)},computeSubGroups:function(){for(var b={},a=0;a<this.slices.length;++a){var c=this.slices[a],e=c.startThread.guid;b[e]||(b[e]=new d);b[e].slices.push(c)}var a=[],f;for(f in b)c=b[f],c.updateBounds(),a.push(c);return a}};return{AsyncSliceGroup:d}});"use strict";base.require("tracing.trace_model.trace_model_event");
164 base.exportTo("tracing.trace_model",function(){function d(b,a,c,e,f){tracing.trace_model.TraceModelEvent.apply(this,arguments)}d.prototype={__proto__:tracing.trace_model.TraceModelEvent.prototype};return{Sample:d}});"use strict";base.require("base.range");base.require("tracing.trace_model.slice");base.require("tracing.color_scheme");base
165 base.exportTo("tracing.trace_model",function(){function d(a){this.sliceConstructor=a||b;this.openPartialSlices_=[];this.slices=[];this.bounds=new base.Range}var b=tracing.trace_model.Slice;d.prototype={__proto__:Object.prototype,get length(){return this.slices.length},pushSlice:function(a){this.slices.push(a);return a},pushSlices:function(a){this.slices.push.apply(this.slices,a)},pushInstantEvent:function(a){this.slices.push(a)},beginSlice:function(a,c,b,f){if(this.openPartialSlices_.length&&b<this.openPartialSlices_[this.openPartialSlices_.length-
171 return b};return{SliceGroup:d}});"use strict";base.require("base.guid");base.require("base.range");base.require("tracing.trace_model.slice");base.require("tracing.trace_model.slice_group");base.require("tracing.trace_model.async_slice_group");base.require("tracing.trace_model.sample");
172 base.exportTo("tracing.trace_model",function(){function d(c,b,e,d,l,m){a.call(this,c,b,e,d,l,m);this.subSlices=[]}function b(a,b){this.guid_=base.GUID.allocate();if(!a)throw Error("Parent must be provided.");this.parent=a;this.sortIndex=0;this.tid=b;this.sliceGroup=new c(d);this.cpuSlices=void 0;this.samples_=[];this.kernelSliceGroup=new c;this.asyncSliceGroup=new e;this.bounds=new base.Range;this.ephemeralSettings={}}var a=tracing.trace_model.Slice,c=tracing.trace_model.SliceGroup,e=tracing.trace_model.AsyncSliceGroup;
178 this.name:"")},getSettingsKey:function(){if(this.name){var a=this.parent.getSettingsKey();return a?a+"."+this.name:void 0}}};b.compare=function(a,c){var b=a.parent.compareTo(c.parent);return b||(b=a.sortIndex-c.sortIndex)?b:(b=base.comparePossiblyUndefinedValues(a.name,c.name,function(a,c){return a.localeCompare(c)}))?b:a.tid-c.tid};return{ThreadSlice:d,Thread:b}});"use strict";
179 base.exportTo("base",function(){function d(){return d}var b=localStorage;d.get=function(a,c,e){a=d.namespace_(a,e);var f=b.getItem(a);if(null===f||void 0===f)return c;try{return JSON.parse(f).value}catch(g){return b.removeItem(d.namespace_(a,e)),c}};d.set=function(a,c,e){if(void 0===c)throw Error("Settings.set: value must not be undefined");c=JSON.stringify({value:c});b.setItem(d.namespace_(a,e),c)};d.keys=function(a){var c=[];a=a||"";for(var e=0;e<b.length;e++){var f=b.key(e);d.isnamespaced_(f,a)&&
180 c.push(d.unnamespace_(f,a))}return c};d.isnamespaced_=function(a,c){return 0==a.indexOf(d.normalize_(c))};d.namespace_=function(a,c){return d.normalize_(c)+a};d.unnamespace_=function(a,c){return a.replace(d.normalize_(c),"")};d.normalize_=function(a){return d.NAMESPACE+(a?a+".":"")};d.setAlternativeStorageInstance=function(a){b=a};d.getAlternativeStorageInstance=function(){return b===localStorage?void 0:b};d.NAMESPACE="trace-viewer";return{Settings:d}});"use strict";base.require("base.settings");
181 base.exportTo("tracing",function(){function d(a){this.model=a;this.objectsByKey_=[];this.nonuniqueKeys_=[];this.buildObjectsByKeyMap_();this.removeNonuniqueKeysFromSettings_()}var b=base.Settings;d.prototype={buildObjectsByKeyMap_:function(){var a=[this.model.kernel];a.push.apply(a,base.dictionaryValues(this.model.processes));a.push.apply(a,this.model.getAllThreads());for(var c={},b=0;b<a.length;b++){var f=a[b],g=f.getSettingsKey();g&&(c[g]=void 0===c[g]?f:"nonuniqueKey")}var d={};base.dictionaryKeys(c).forEach(function(a){"nonuniqueKey"===
182 c[a]&&(delete c[a],d[a]=!0)});this.nonuniqueKeys=d;this.objectsByKey_=c},removeNonuniqueKeysFromSettings_:function(){var a=b.get("trace_model_settings",{}),c=!1;base.dictionaryKeys(a).forEach(function(b){this.nonuniqueKeys[b]&&(c=!0,delete a[b])},this);c&&b.set("trace_model_settings",a)},hasUniqueSettingKey:function(a){return(a=a.getSettingsKey())?void 0!==this.objectsByKey_[a]:!1},getSettingFor:function(a,c,e){var f=a.getSettingsKey();if(!f||!this.objectsByKey_[f])return c=a.ephemeralSettings[c],
183 void 0!==c?c:e;a=b.get("trace_model_settings",{});a[f]||(a[f]={});c=a[f][c];return void 0!==c?c:e},setSettingFor:function(a,c,e){var f=a.getSettingsKey();f&&this.objectsByKey_[f]?(a=b.get("trace_model_settings",{}),a[f]||(a[f]={}),a[f][c]=e,b.set("trace_model_settings",a)):a.ephemeralSettings[c]=e}};return{TraceModelSettings:d}});"use strict";base.require("base.guid");base.require("base.range");base.require("tracing.trace_model.counter");base.require("tracing.trace_model.object_collection");base.require("tracing.trace_model.thread");
184 base.require("tracing.trace_model_settings");
185 base.exportTo("tracing.trace_model",function(){function d(a){if(!a)throw Error("Must provide a model");this.guid_=base.GUID.allocate();this.model=a;this.threads={};this.counters={};this.objects=new tracing.trace_model.ObjectCollection(this);this.bounds=new base.Range;this.sortIndex=0;this.ephemeralSettings={}}var b=tracing.trace_model.Thread,a=tracing.trace_model.Counter;d.compare=function(a,b){return a.sortIndex-b.sortIndex};d.prototype={get guid(){return this.guid_},get numThreads(){var a=0,b;for(b in this.threads)a++;
189 (this.threads[a]=new b(this,a));return this.threads[a]},getOrCreateCounter:function(c,b){var f=c+"."+b;this.counters[f]||(this.counters[f]=new a(this,f,c,b));return this.counters[f]},getSettingsKey:function(){throw Error("Not implemented");}};return{ProcessBase:d}});"use strict";base.require("tracing.trace_model.cpu");base.require("tracing.trace_model.process_base");
190 base.exportTo("tracing.trace_model",function(){function d(c){if(void 0===c)throw Error("model must be provided");a.call(this,c);this.cpus={}}var b=tracing.trace_model.Cpu,a=tracing.trace_model.ProcessBase;d.compare=function(a,b){return 0};d.prototype={__proto__:a.prototype,compareTo:function(a){return d.compare(this,a)},get userFriendlyName(){return"Kernel"},get userFriendlyDetails(){return"Kernel"},getOrCreateCpu:function(a){this.cpus[a]||(this.cpus[a]=new b(a));return this.cpus[a]},shiftTimestampsForward:function(c){a.prototype.shiftTimestampsForward.call(this);
191 for(var b in this.cpus)this.cpus[b].shiftTimestampsForward(c)},updateBounds:function(){a.prototype.updateBounds.call(this);for(var c in this.cpus){var b=this.cpus[c];b.updateBounds();this.bounds.addRange(b.bounds)}},addCategoriesToDict:function(c){a.prototype.addCategoriesToDict.call(this,c);for(var b in this.cpus)this.cpus[b].addCategoriesToDict(c)},getSettingsKey:function(){return"kernel"}};return{Kernel:d}});"use strict";base.require("tracing.trace_model.process_base");
192 base.exportTo("tracing.trace_model",function(){function d(b,a){if(void 0===b)throw Error("model must be provided");if(void 0===a)throw Error("pid must be provided");tracing.trace_model.ProcessBase.call(this,b);this.pid=a;this.name=void 0;this.labels=[];this.instantEvents=[]}d.compare=function(b,a){var c=tracing.trace_model.ProcessBase.compare(b,a);return c||(c=base.comparePossiblyUndefinedValues(b.name,a.name,function(a,c){return a.localeCompare(c)}))?c:(c=base.compareArrays(b.labels,a.labels,function(a,
194 "processes."+this.name+"."+this.labels.join("."):"processes."+this.name:void 0},shiftTimestampsForward:function(b){for(var a in this.instantEvents)this.instantEvents[a].start+=b;tracing.trace_model.ProcessBase.prototype.shiftTimestampsForward.apply(this,arguments)}};return{Process:d}});"use strict";base.require("base.range");base.require("base.events");base.require("tracing.trace_model.process");base.require("tracing.trace_model.kernel");base.require("tracing.filter");
195 base.exportTo("tracing",function(){function d(a,b){this.kernel=new c(this);this.processes={};this.importErrors=[];this.metadata=[];this.categories=[];this.bounds=new base.Range;this.instantEvents=[];a&&this.importTraces([a],b)}function b(a){this.importPriority=0}var a=tracing.trace_model.Process,c=tracing.trace_model.Kernel;d.importerConstructors_=[];d.registerImporter=function(a){d.importerConstructors_.push(a)};d.prototype={__proto__:base.EventTarget.prototype,get numProcesses(){var a=0,c;for(c in this.processes)a++;
198 getAllProcesses:function(){var a=[],c;for(c in this.processes)a.push(this.processes[c]);return a},getAllCounters:function(){var a=[];a.push.apply(a,base
202 d.registerImporter(b);return{TraceModel:d}});"use strict";base.require("tracing.trace_model");base.require("tracing.color_scheme");base.require("tracing.importer.linux_perf.bus_parser");base.require("tracing.importer.linux_perf.clock_parser");base.require("tracing.importer.linux_perf.cpufreq_parser");base.require("tracing.importer.linux_perf.disk_parser");base.require("tracing.importer.linux_perf.drm_parser");base.require("tracing.importer.linux_perf.exynos_parser");base.require("tracing.importer.linux_perf.gesture_parser");
203 base.require("tracing.importer.linux_perf.i915_parser");base.require("tracing.importer.linux_perf.mali_parser");base.require("tracing.importer.linux_perf.power_parser");base.require("tracing.importer.linux_perf.sched_parser");base.require("tracing.importer.linux_perf.sync_parser");base.require("tracing.importer.linux_perf.workqueue_parser");base.require("tracing.importer.linux_perf.android_parser");base.require("tracing.importer.linux_perf.kfunc_parser");
204 base.exportTo("tracing.importer",function(){function d(a){this.cpu=a}function b(a,c){this.importPriority=2;this.model_=a;this.events_=c;this.clockSyncRecords_=[];this.cpuStates_={};this.wakeups_=[];this.kernelThreadStates_={};this.buildMapFromLinuxPidsToThreads();this.lineNumberBase=0;this.lineNumber=-1;this.pseudoThreadCounter=1;this.parsers_=[];this.eventHandlers_={}}function a(a){return"{"==a[0]?!1:e.test(a)?f:g.test(a)?h:k.test(a)?l:null}d.prototype={__proto__:Object.prototype,switchRunningLinuxPid:function(a,
222 e);continue}var f=c(e);if(f){var g=parseInt(f.pid),d=parseInt(f.cpuNumber),h=1E3*parseFloat(f.timestamp),k=f.eventName,l=this.eventHandlers_[k];l?l(k,d,g,h,f)||this.importError("Malformed "+k+" event ("+e+")"):this.importError("Unknown event "+k+" ("+e+")")}else this.importError("Unrecognized line: "+e)}}}};tracing.TraceModel.registerImporter(b);return{LinuxPerfImporter:b,_LinuxPerfImporterTestExports:c}});"use strict";base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/common.js");base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/mat2d.js");
223 base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/mat4.js");base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/vec2.js");base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/vec3.js");base.requireRawScript("../third_party/gl-matrix/src/gl-matrix/vec4.js");
224 base.exportTo("base",function(){var d=vec2.create(),b=vec2.create(),a=vec4.create();mat2d.create();vec2.createFromArray=function(a){if(2!=a.length)throw Error("Should be length 2");var b=vec2.create();vec2.set(b,a[0],a[1]);return b};vec2.createXY=function(a,b){var f=vec2.create();vec2.set(f,a,b);return f};vec2.toString=function(a){return"["+a[0]+", "+a[1]+"]"};vec2.addTwoScaledUnitVectors=function(a,e,f,g,h){vec2.scale(d,e,f);vec2.scale(b,g,h);vec2.add(a,d,b)};vec3.createXYZ=function(a,b,f){var g=
225 vec3.create();vec3.set(g,a,b,f);return g};vec3.toString=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"};mat2d.translateXY=function(a,b,f){vec2.set(d,b,f);mat2d.translate(a,a,d)};mat2d.scaleXY=function(a,b,f){vec2.set(d,b,f);mat2d.scale(a,a,d)};vec4.unitize=function(a,b){a[0]=b[0]/b[3];a[1]=b[1]/b[3];a[2]=b[2]/b[3];a[3]=1;return a};vec2.copyFromVec4=function(c,b){vec4.unitize(a,b);vec2.copy(c,a)};return{}});"use strict";base.require("base.gl_matrix");
226 base.exportTo("base",function(){function d(a,c,b,e){vec2.scale(h,c,e);vec2.scale(k,b,1-e);vec2.add(a,h,k);vec2.normalize(a,a);return a}function b(){this.p1=vec2.create();this.p2=vec2.create();this.p3=vec2.create();this.p4=vec2.create()}function a(a,c,b){return(a[0]-b[0])*(c[1]-b[1])-(c[0]-b[0])*(a[1]-b[1])}function c(c,b,e,f){var g=0>a(c,b,e);e=0>a(c,e,f);c=0>a(c,f,b);return g==e&&e==c}for(var e=[],f=0;8>f;f++)e[f]=vec2.create();var g=vec4.create();vec4.create();vec4.create();mat4.create();mat4.create();
229 this.p3[1],this.p4[1]);return new base.Rect.FromXYWH(a,c,b-a,e-c)},clone:function(){var a=new b;vec2.copy(a.p1,this.p1);vec2.copy(a.p2,this.p2);vec2.copy(a.p3,this.p3);vec2.copy(a.p4,this.p4);return a},scale:function(a){var c=new b;this.scaleFast(c,a);return c},scaleFast:function(a,c){vec2.copy(a.p1,this.p1,c);vec2.copy(a.p2,this.p2,c);vec2.copy(a.p3,this.p3,c);vec2.copy(a.p3,this.p3,c)},isRectangle:function(){var a=this.boundingRect();return a.x==this.p1[0]&&a.y==this.p1[1]&&a.width==this.p2[0]-
232 vec2.toString(this.p1)+", "+vec2.toString(this.p2)+", "+vec2.toString(this.p3)+", "+vec2.toString(this.p4)+")"}};return{vecInTriangle2:c,Quad:b}});"use strict";base.require("tracing.trace_model.trace_model_event");
233 base.exportTo("tracing.trace_model",function(){function d(a,c,b,e,d){tracing.trace_model.TraceModelEvent.apply(this,arguments);this.type=void 0}function b(a,c,b,k,l){d.apply(this,arguments);this.type=e.GLOBAL}function a(a,c,b,k,l){d.apply(this,arguments);this.type=e.PROCESS}function c(a,c,b,k,l){d.apply(this,arguments);this.type=e.THREAD}var e={GLOBAL:1,PROCESS:2,THREAD:3};d.prototype={__proto__:tracing.trace_model.TraceModelEvent.prototype};b.prototype={__proto__:d.prototype};a.prototype={__proto__:d.prototype};
234 c.prototype={__proto__:d.prototype};return{GlobalInstantEvent:b,ProcessInstantEvent:a,ThreadInstantEvent:c,InstantEventType:e}});"use strict";base.require("base.quad");base.require("tracing.trace_model");base.require("tracing.color_scheme");base.require("tracing.trace_model.instant_event");base.require("tracing.trace_model.counter_series");
235 base.exportTo("tracing.importer",function(){function d(a){if(!(a instanceof Object)){if(void 0===a||null===a)return a;if("string"==typeof a)return a.substring();if("boolean"==typeof a||"number"==typeof a)return a;throw Error("Unrecognized: "+typeof a);}if(a instanceof Array){for(var c=Array(a.length),b=0;b<a.length;b++)c[b]=d(a[b]);return c}if(a.__proto__!=Object.prototype)throw Error("Can only clone simple types");c={};for(b in a)c[b]=d(a[b]);return c}function b(a,c){this.importPriority=1;this.model_=
251 createImplicitObjects_:function(){base.iterItems(this.model_.processes,function(a,c){this.createImplicitObjectsForProcess_(c)},this)},createImplicitObjectsForProcess_:function(a){function c(c,b,e,d){if(e&&void 0!==e.id&&!(e instanceof tracing.trace_model.ObjectSnapshot)){var l=e.id,m=/(.+)\/(.+)/.exec(l);if(!m)throw Error("Implicit snapshots must have names.");delete e.id;var n=m[1],m=m[2],p;try{p=a.objects.addSnapshot(m,d.objectInstance.category,n,d.ts,e)}catch(q){this.model_.importErrors.push("While processing implicit snapshot of "+
253 a.args.id)throw Error("args cannot have an id field inside it");b(a.args,c,a,this)},this)},this)},joinObjectRefs_:function(){base.iterItems(this.model_.processes,function(a,c){this.joinObjectRefsForProcess_(c)},this)},joinObjectRefsForProcess_:function(a){var c=[];base.iterItems(a.threads,function(b,f){f.asyncSliceGroup.slices.forEach(function(b){this.searchItemForIDRefs_(c,a.objects,"start",b)},this);f.sliceGroup.slices.forEach(function(b){this.searchItemForIDRefs_(c,a.objects,"start",b)},this)},
254 this);a.objects.iterObjectInstances(function(b){b.snapshots.forEach(function(b){this.searchItemForIDRefs_(c,a.objects,"ts",b)},this)},this);c.forEach(function(a){a.object[a.field]=a.value})},searchItemForIDRefs_:function(a,c,b,f){function d(g,h,m){void 0!==m&&(m.id_ref||m.idRef)&&(m=c.getSnapshotAt(m.id_ref||m.idRef,f[b]))&&a.push({object:g,field:h,value:m})}function h(a){if(a instanceof Object&&!(a instanceof tracing.trace_model.ObjectSnapshot||a instanceof Float32Array||a instanceof base.Quad))if(a instanceof
256 base.exportTo("tracing.importer.v8",function(){function d(){}d.prototype.root_=null;d.prototype.isEmpty=function(){return!this.root_};d.prototype.insert=function(b,a){if(this.isEmpty())this.root_=new d.Node(b,a);else if(this.splay_(b),this.root_.key!=b){var c=new d.Node(b,a);b>this.root_.key?(c.left=this.root_,c.right=this.root_.right,this.root_.right=null):(c.right=this.root_,c.left=this.root_.left,this.root_.left=null);this.root_=c}};d.prototype.remove=function(b){if(this.isEmpty())throw Error("Key not found: "+
260 a.push(c.right))}};d.Node=function(b,a){this.key=b;this.value=a};d.Node.prototype.left=null;d.Node.prototype.right=null;return{SplayTree:d}});"use strict";base.require("tracing.importer.v8.splaytree");
261 base.exportTo("tracing.importer.v8",function(){function d(){this.dynamics_=new tracing.importer.v8.SplayTree;this.dynamicsNameGen_=new tracing.importer.v8.CodeMap.NameGenerator;this.statics_=new tracing.importer.v8.SplayTree;this.libraries_=new tracing.importer.v8.SplayTree;this.pages_=[]}d.PAGE_ALIGNMENT=12;d.PAGE_SIZE=1<<d.PAGE_ALIGNMENT;d.prototype.addCode=function(b,a){this.deleteAllCoveredNodes_(this.dynamics_,b,b+a.size);this.dynamics_.insert(b,a)};d.prototype.moveCode=function(b,a){var c=this.dynamics_.remove(b);
267 base.exportTo("tracing.importer.v8",function(){function d(){}function b(a){this.dispatchTable_=a;this.lineNum_=0;this.csvParser_=new d}d.CSV_FIELD_RE_=/^"((?:[^"]|"")*)"|([^,]*)/;d.DOUBLE_QUOTE_RE_=/""/g;d.prototype.parseLine=function(a){var c=d.CSV_FIELD_RE_,b=d.DOUBLE_QUOTE_RE_,f=0,g=a.length,h=[];if(0<g){do{var k=c.exec(a.substr(f));"string"===typeof k[1]?(k=k[1],f+=k.length+3,h.push(k.replace(b,'"'))):(k=k[2],f+=k.length+1,h.push(k))}while(f<=g)}return h};b.prototype.printError=function(a){};
269 [],f=0;f<c.parsers.length;++f){var d=c.parsers[f];if(null===d)b.push(a[1+f]);else if("function"==typeof d)b.push(d(a[1+f]));else{b.push(a.slice(1+f));break}}c.processor.apply(this,b)}};b.prototype.processLog_=function(a){for(var c=0,b=a.length;c<b;++c,++this.lineNum_){var f=a[c];if(f)try{var d=this.csvParser_.parseLine(f);this.dispatchLogRow_(d)}catch(h){this.printError("line "+(this.lineNum_+1)+": "+(h.message||h))}}};return{LogReader:b}});"use strict";base.require("tracing.trace_model");base.require("tracing.trace_model.slice");
270 base.require("tracing.color_scheme");base.require("tracing.importer.v8.log_reader");base.require("tracing.importer.v8.codemap");
271 base.exportTo("tracing.importer",function(){function d(a,b){this.importPriority=3;this.model_=a;this.logData_=b;this.code_map_=new tracing.importer.v8.CodeMap;this.v8_samples_thread_=this.v8_stack_thread_=this.v8_timer_thread_=void 0}var b=["/d8","/libv8.so"],a={"V8.Execute":{pause:!1,no_execution:!1},"V8.External":{pause:!1,no_execution:!0},"V8.CompileFullCode":{pause:!0,no_execution:!0},"V8.RecompileSynchronous":{pause:!0,no_execution:!0},"V8.RecompileParallel":{pause:!1,no_execution:!1},"V8.CompileEval":{pause:!0,
279 return{V8LogImporter:d}});"use strict";base.require("tracing.importer.linux_perf_importer");base.require("tracing.importer.trace_event_importer");base.require("tracing.importer.v8_log_importer");"use strict";base.exportTo("tracing.analysis",function(){return{tsRound:function(d){return Math.round(1E3*d)/1E3}}});"use strict";base.require("base.events");base.require("base.guid");base.require("base.range");
280 base.exportTo("tracing",function(){function d(a,c){this.track=a;this.slice=c}function b(a,c,b){this.track=a;this.counter=c;this.sampleIndex=b}function a(a,c){this.track=a;this.objectSnapshot=c}function c(a,c){this.track=a;this.objectInstance=c}function e(a){this.bounds_dirty_=!0;this.bounds_=new base.Range;this.length_=0;this.guid_=base.GUID.allocate();a&&this.pushHits(a)}d.prototype={get modelObject(){return this.slice},get selected(){return this.slice.selected},set selected(a){this.slice.selected=
289 base.exportTo("ui",function(){return{decorate:function(d,b){var a;a="string"==typeof d?base.doc.querySelectorAll(d):[d];for(var c=0,e;e=a[c];c++)e instanceof b||b.decorate(e)},define:function(d,b){function a(){if(b&&a.prototype.__proto__!=b.prototype)throw Error(d+" prototye's __proto__ field is messed up. It MUST be the prototype of "+b.tagName);var c=d;if(b)for(var e=b;e&&e.tagName;)c=e.tagName,e=e.parentConstructor;c=base.doc.createElement(c);a.decorate.call(this,c,arguments);return c}if("function"==
291 for(var a=d;a.parentNode;){if(a==b)return!0;a=a.parentNode}return!1}}});"use strict";base.requireStylesheet("tracing.analysis.analysis_link");base.require("base.events");base.require("tracing.selection");base.require("tracing.analysis.util");base.require("ui");
292 base.exportTo("tracing.analysis",function(){var d=tracing.analysis.tsRound,b=base.Event.bind(void 0,"requestSelectionChange",!0,!1),a=ui.define("a");a.prototype={__proto__:HTMLAnchorElement.prototype,decorate:function(){this.classList.add("analysis-link");this.selectionGenerator;this.addEventListener("click",this.onClicked_.bind(this))},onClicked_:function(){var a=new b;a.selection=this.selectionGenerator();this.dispatchEvent(a)}};var c=ui.define("object-snapshot-link",a);c.prototype={__proto__:a.prototype,
294 this)}.bind(this)}};return{RequestSelectionChangeEvent:b,AnalysisLink:a,ObjectSnapshotLink:c,ObjectInstanceLink:e}});"use strict";base.requireStylesheet("tracing.analysis.generic_object_view");base.require("base.utils");base.require("tracing.analysis.analysis_link");base.require("ui");
295 base.exportTo("tracing.analysis",function(){var d=ui.define("x-generic-object-view");d.prototype={__proto__:HTMLUnknownElement.prototype,decorate:function(){this.object_=void 0},get object(){return this.object_},set object(b){this.object_=b;this.updateContents_()},updateContents_:function(){this.textContent="";this.appendElementsForType_("",this.object_,0,0,5,"")},appendElementsForType_:function(b,a,c,e,f,d){e>f?this.appendSimpleText_(b,c,"<recursion limit reached>",d):void 0===a?this.appendSimpleText_(b,
297 typeof a?this.appendSimpleText_(b,c,'"'+a+'"',d):this.appendSimpleText_(b,c,a,d)},appendElementsForArray_:function(b,a,c,e,f,d){if(0==a.length)this.appendSimpleText_(b,c,"[]",d);else{this.appendElementsForType_(b+"[",a[0],c,e+1,f,1<a.length?",":"]"+d);for(var h=1;h<a.length;h++)this.appendElementsForType_("",a[h],c+b.length+1,e+1,f,h<a.length-1?",":"]"+d)}},appendElementsForObject_:function(b,a,c,e,f,d){var h=base.dictionaryKeys(a);if(0==h.length)this.appendSimpleText_(b,c,"{}",d);else{this.appendElementsForType_(b+
299 base.requireStylesheet("tracing.analysis.analysis_results");base.require("tracing.analysis.util");base.require("tracing.analysis.analysis_link");base.require("tracing.analysis.generic_object_view");base.require("ui");
300 base.exportTo("tracing.analysis",function(){var d=ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.className="analysis-results"},clear:function(){this.textContent=""},createSelectionChangingLink:function(b,a,c){var e=this.ownerDocument.createElement("a");tracing.analysis.AnalysisLink.decorate(e);e.textContent=b;e.selectionGenerator=a;c&&(e.title=c);return e},appendElement_:function(b,a,c){a=b.ownerDocument.createElement(a);b.appendChild(a);void 0!=c&&(a.textContent=
306 e?this.appendTableCellWithTooltip_(b,f,2,String(e)+" occurrences",h):this.appendTableCell_(b,f,2,"")}};return{AnalysisResults:d}});"use strict";base.require("tracing.analysis.util");base.require("ui");
307 base.exportTo("tracing.analysis",function(){return{analyzeSingleCounterSampleHit:function(d,b){for(var a=b.counter,c=b.sampleIndex,e=[],f=0;f<a.numSeries;++f)e.push(a.getSeries(f).getSample(c).value);var g=d.appendTable("analysis-counter-table",2);d.appendTableHeader(g,"Selected counter:");d.appendSummaryRow(g,"Title",a.name);d.appendSummaryRowTime(g,"Timestamp",a.timestamps[c]);for(f=0;f<a.numSeries;f++)d.appendSummaryRow(g,a.getSeries(f).name,e[f])},analyzeMultipleCounterSampleHits:function(d,b){for(var a=
308 {},c=0;c<b.length;c++){var e=b[c].counter;a[e.guid]||(a[e.guid]=[]);a[e.guid].push(b[c])}var f=d.appendTable("analysis-counter-table",2);d.appendTableHeader(f,"Counters:");for(var g in a){for(var h=a[g],e=h[0].counter,k=[],c=0;c<h.length;c++)k.push(h[c].sampleIndex);h=e.getSampleStatistics(k);for(c=0;c<h.length;c++){for(var l=[],m=0;m<k.length;++m)l.push(e.getSeries(c).getSample(k[m]).value);d.appendDataRow(f,e.name+": series("+e.getSeries(c).name+")",l,l.length,h[c])}}}}});"use strict";base.requireStylesheet("tracing.analysis.analyze_slices");
309 base.require("tracing.analysis.util");base.require("ui");
310 base.exportTo("tracing.analysis",function(){function d(b,a){var c=a.slice,e=b.appendTable("analysis-slice-table",2);b.appendTableHeader(e,"Selected slice:");b.appendSummaryRow(e,"Title",c.title);c.category&&b.appendSummaryRow(e,"Category",c.category);b.appendSummaryRowTime(e,"Start",c.start);b.appendSummaryRowTime(e,"Duration",c.duration);c.durationInUserTime&&b.appendSummaryRowTime(e,"Duration (U)",c.durationInUserTime);var f=0,d;for(d in c.args)f+=1;if(0<f)for(d in b.appendSummaryRow(e,"Args"),
311 c.args)b.appendSummaryRow(e," "+d,c.args[d])}return{analyzeSingleSliceHit:d,analyzeMultipleSliceHits:function(b,a){var c=a.bounds.min,e=a.bounds.max;a.map(function(a){return a.slice.title});for(var f=0,g={},h=0;h<a.length;h++){var k=a[h].slice;g[k.title]||(g[k.title]={hits:[]},f++);g[k.title].hits.push(a[h])}var l;l=b.appendTable("analysis-slices-table",3);b.appendTableHeader(l,"Slices:");var m=0;base.iterItems(g,function(a,c){for(var e=0,g=0,h=Number.MAX_VALUE,k=-Number.MAX_VALUE,s=Number.MAX_VALUE,
313 s.frequency-1E3/(c.hits[g].slice.start-c.hits[g-1].slice.start),r+=u*u;s.frequency_stddev=Math.sqrt(r/(h-1))}b.appendDataRow(l,a,e,c.hits.length,s,function(){return new tracing.Selection(c.hits)});if(1===f)for(g=0;g<c.hits.length;g++)d(b,c.hits[g])});1!==f&&(b.appendDataRow(l,"*Totals",m,a.length),b.appendSpacingRow(l));b.appendSummaryRowTime(l,"Selection start",c);b.appendSummaryRowTime(l,"Selection extent",e-c)}}});"use strict";base.require("tracing.analysis.analyze_counters");base.require("tracing.analysis.analyze_slices");
314 base.require("tracing.analysis.util");base.require("ui");
315 base.exportTo("tracing.analysis",function(){function d(a,c){var e=c.slices,f=c.counterSamples,d=new tracing.Selection;d.addSelection(c.objectSnapshots);d.addSelection(c.objectInstances);1==e.length?tracing.analysis.analyzeSingleSliceHit(a,e[0]):1<e.length&&tracing.analysis.analyzeMultipleSliceHits(a,e);1==f.length?tracing.analysis.analyzeSingleCounterSampleHit(a,f[0]):1<f.length&&tracing.analysis.analyzeMultipleCounterSampleHits(a,f);d.length&&b(a,d)}function b(a,c){c=base.asArray(c).sort(base.Range.compareByMinTimes);
317 "-"+h;k=n.typeName+" "+n.id;l=function(){var a=new tracing.Selection;a.addObjectInstance(c.track,n);return a}}a.appendTableCell(b,d,h);a.appendTableCell(b,d,"").appendChild(a.createSelectionChangingLink(k,l))})}return{analyzeSelection:function(a,c){d(a,c.getHitsOrganizedByType())},analyzeHitsByType:d}});"use strict";base.require("ui");
318 base.exportTo("tracing.analysis",function(){var d=ui.define("object-instance-view");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.objectInstance_=void 0},set modelObject(b){this.objectInstance=b},get modelObject(){return this.objectInstance},get objectInstance(){return this.objectInstance_},set objectInstance(b){this.objectInstance_=b;this.updateContents()},updateContents:function(){throw Error("Not implemented");}};d.typeNameToViewInfoMap={};d.register=function(b,a,c){if(d.typeNameToViewInfoMap[b])throw Error("Handler already registerd for "+
319 b);d.typeNameToViewInfoMap[b]={constructor:a,options:c||{showInTrackView:!0}}};d.unregister=function(b){if(void 0===d.typeNameToViewInfoMap[b])throw Error(b+" not registered");delete d.typeNameToViewInfoMap[b]};d.getViewInfo=function(b){return d.typeNameToViewInfoMap[b]};return{ObjectInstanceView:d}});"use strict";base.require("ui");
320 base.exportTo("tracing.analysis",function(){var d=ui.define("object-snapshot-view");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.objectSnapshot_=void 0},set modelObject(b){this.objectSnapshot=b},get modelObject(){return this.objectSnapshot},get objectSnapshot(){return this.objectSnapshot_},set objectSnapshot(b){this.objectSnapshot_=b;this.updateContents()},updateContents:function(){throw Error("Not implemented");}};d.typeNameToViewInfoMap={};d.register=function(b,a,c){if(d.typeNameToViewInfoMap[b])throw Error("Handler already registered for "+
321 b);d.typeNameToViewInfoMap[b]={constructor:a,options:c||{showInTrackView:!0}}};d.unregister=function(b){if(void 0===d.typeNameToViewInfoMap[b])throw Error(b+" not registered");delete d.typeNameToViewInfoMap[b]};d.getViewInfo=function(b){return d.typeNameToViewInfoMap[b]};return{ObjectSnapshotView:d}});"use strict";base.requireStylesheet("tracing.analysis.default_object_view");base.require("tracing.analysis.analysis_link");base.require("tracing.analysis.object_instance_view");base.require("tracing.analysis.object_snapshot_view");
322 base.require("tracing.analysis.util");
323 base.exportTo("tracing.analysis",function(){var d=tracing.analysis.tsRound,b=ui.define("default-object-snapshot-view",tracing.analysis.ObjectSnapshotView);b.prototype={__proto__:tracing.analysis.ObjectSnapshotView.prototype,decorate:function(){tracing.analysis.ObjectSnapshotView.prototype.decorate.apply(this);this.classList.add("default-object-view");this.classList.add("default-object-snapshot-view")},updateContents:function(){var a=this.objectSnapshot;if(a){var b=a.objectInstance,f;f=""+('<div class="title">Snapshot of <a id="instance-link"></a> @ '+
326 b+='<tr><td>snapshots:</td><td id="snapshots"></td></tr>\n';this.innerHTML=b+="</table>";var d=this.querySelector("#snapshots");a.snapshots.forEach(function(a){var c=new tracing.analysis.ObjectSnapshotLink;c.objectSnapshot=a;d.appendChild(c)})}else this.textContent=""}};return{DefaultObjectSnapshotView:b,DefaultObjectInstanceView:a}});"use strict";base.require("ui");
327 base.exportTo("tracing.analysis",function(){var d=ui.define("slice-view");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.objectInstance_=void 0},set modelObject(b){this.slice=b},get modelObject(){return this.slice},get slice(){return this.slice_},set slice(b){this.slice_=b;this.updateContents()},updateContents:function(){throw Error("Not implemented");}};d.titleToViewInfoMap={};d.register=function(b,a){if(d.titleToViewInfoMap[b])throw Error("Handler already registerd for "+
328 b);d.titleToViewInfoMap[b]={constructor:a}};d.unregister=function(b){if(void 0===d.titleToViewInfoMap[b])throw Error(b+" not registered");delete d.titleToViewInfoMap[b]};d.getViewInfo=function(b){return d.titleToViewInfoMap[b]};return{SliceView:d}});"use strict";base.requireStylesheet("tracing.analysis.analysis_view");base.require("base.guid");base.require("tracing.analysis.analysis_results");base.require("tracing.analysis.analyze_selection");base.require("tracing.analysis.default_object_view");base.require("tracing.analysis.object_instance_view");
329 base.require("tracing.analysis.object_snapshot_view");base.require("tracing.analysis.slice_view");base.require("tracing.analysis.util");base.require("ui");
330 base.exportTo("tracing.analysis",function(){var d=ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.className="analysis-view";this.currentSelection_=this.currentView_=void 0;this.selections_=[];this.guid_=base.GUID.allocate();window.addEventListener("popstate",this.onPopState.bind(this))},changeViewType:function(b){if(!(this.currentView_ instanceof b)){this.textContent="";try{this.currentView_=new b,this.appendChild(this.currentView_)}catch(a){throw this.currentView_=
334 (c=e.getViewInfo(c))?c.constructor:b;if(!b)return!1;this.changeViewType(b);this.currentView.modelObject=a;return!0}};return{AnalysisView:d}});"use strict";base.require("base.events");
335 base.exportTo("base",function(){function d(a,c,b,e,d,m){d=new base.Event(c+"Change",d,m);d.propertyName=c;d.newValue=b;d.oldValue=e;var n;d.throwError=function(a){n=a};a.dispatchEvent(d);if(n)throw n;}function b(a){return a.replace(/([A-Z])/g,"-$1").toLowerCase()}function a(a,c){switch(c){case e.JS:var d=a+"_base_";return function(){return this[d]};case e.ATTR:var k=b(a);return function(){return this.getAttribute(k)};case e.BOOL_ATTR:return k=b(a),function(){return this.hasAttribute(k)}}}function c(a,
337 BOOL_ATTR:"boolAttr"};return{PropertyKind:e,defineProperty:function(b,d,h,k,l,m){console.error("Don't use base.defineProperty");"function"==typeof b&&(b=b.prototype);h=h||e.JS;b.__lookupGetter__(d)||b.__defineGetter__(d,a(d,h));b.__lookupSetter__(d)||b.__defineSetter__(d,c(d,h,k,l,m))},dispatchPropertyChange:d,setPropertyAndDispatchChange:function(a,c,b){var e=a[c];a[c+"_"]=b;e!==b&&base.dispatchPropertyChange(a,c,b,e,!0,!1)}}});"use strict";base.requireStylesheet("ui.overlay");base.require("base.properties");
338 base.require("base.events");base.require("ui");
339 base.exportTo("ui",function(){var d=ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.classList.add("overlay-root");this.createToolBar_();this.contentHost=this.ownerDocument.createElement("div");this.contentHost.classList.add("content-host");this.tabCatcher=this.ownerDocument.createElement("span");this.tabCatcher.tabIndex=0;this.appendChild(this.contentHost);this.onKeydown_=this.onKeydown_.bind(this);this.onFocusIn_=this.onFocusIn_.bind(this);this.addEventListener("mousedown",
344 [];this.onKeyDown=this.onKeyDown.bind(this);this.onKeyPress=this.onKeyPress.bind(this);this.onDocumentClick=this.onDocumentClick.bind(this);this.addEventListener("visibleChange",b.prototype.onVisibleChange_.bind(this),!0);this.obeyCloseEvents=!0},get visible(){return this.visible_},set visible(a){base.setPropertyAndDispatchChange(this,"visible",a)},get obeyCloseEvents(){return this.obeyCloseEvents_},set obeyCloseEvents(a){base.setPropertyAndDispatchChange(this,"obeyCloseEvents",a);this.ownerDocument.querySelector(".overlay-root").toggleToolbar(a)},
347 !1;a.preventDefault()}}};return{Overlay:b}});"use strict";base.requireTemplate("tracing.category_filter_dialog");base.require("base.utils");base.require("tracing.filter");base.require("ui.overlay");
348 base.exportTo("tracing",function(){var d=ui.define("div");d.prototype={__proto__:ui.Overlay.prototype,decorate:function(){ui.Overlay.prototype.decorate.call(this);this.className="view-category-filter-overlay";this.obeyCloseEvents=!0;var b=base.instantiateTemplate("#view-category-filter-dialog-template");this.appendChild(b);this.formEl_=this.querySelector("form");this.categoriesEl_=this.querySelector(".categories");this.addEventListener("visibleChange",this.onVisibleChange_.bind(this))},set categories(b){this.categories_=
350 var d=document.createElement("label");d.textContent=c;d.setAttribute("for",c);c=document.createElement("div");c.appendChild(e);c.appendChild(d);this.categoriesEl_.appendChild(c)}},updateSetting_:function(b){void 0!==this.settingUpdatedCallback_&&this.settingUpdatedCallback_(this.unselectedCategories_())}};return{CategoryFilterDialog:d}});"use strict";base.exportTo("tracing",function(){return{mouseModeConstants:{MOUSE_MODE_SELECTION:1,MOUSE_MODE_PANSCAN:2,MOUSE_MODE_ZOOM:3}}});"use strict";base.require("base.events");
351 base.exportTo("tracing",function(){function d(a){this.parentEl_=a;this.modelTrackContainer_=null;this.scaleX_=1;this.gridTimebase_=this.panY_=this.panX_=0;this.gridStep_=1E3/60;this.hasCalledSetupFunction_=this.gridEnabled_=!1;this.onResize_=this.onResize_.bind(this);this.onModelTrackControllerScroll_=this.onModelTrackControllerScroll_.bind(this);this.checkForAttachInterval_=setInterval(this.checkForAttach_.bind(this),250);this.markers=[]}function b(a,c){this.viewport_=a;this.positionWorld_=c;this.selected_=
352 !1}d.prototype={__proto__:base.EventTarget.prototype,setWhenPossible:function(a){this.pendingSetFunction_=a},get isAttachedToDocument_(){var a=this.parentEl_;if(void 0!==a){for(;a.parentNode;)a=a.parentNode;return a==this.parentEl_.ownerDocument}},onResize_:function(){this.dispatchChangeEvent()},checkForAttach_:function(){if(this.isAttachedToDocument_&&0!=this.clientWidth){this.iframe_||(this.iframe_=document.createElement("iframe"),this.iframe_.style.cssText="position:absolute;width:100%;height:0;border:0;visibility:hidden;",
353 this.parentEl_.appendChild(this.iframe_),this.iframe_.contentWindow.addEventListener("resize",this.onResize_));var a=this.parentEl_.clientWidth+"x"+this.parentEl_.clientHeight;if(this.pendingSetFunction_){this.lastSize_=a;try{this.pendingSetFunction_()}catch(c){console.log("While running setWhenPossible:",c.message?c.message+"\n"+c.stack:c.stack)}this.pendingSetFunction_=void 0}window.clearInterval(this.checkForAttachInterval_);this.checkForAttachInterval_=void 0}},dispatchChangeEvent:function(){base.dispatchSimpleEvent(this,
354 "change")},dispatchMarkersChangeEvent_:function(){base.dispatchSimpleEvent(this,"markersChange")},detach:function(){this.checkForAttachInterval_&&(window.clearInterval(this.checkForAttachInterval_),this.checkForAttachInterval_=void 0);this.iframe_&&(this.iframe_.removeEventListener("resize",this.onResize_),this.parentEl_.removeChild(this.iframe_))},getStateInViewCoordinates:function(){return{panX:this.xWorldVectorToView(this.panX),panY:this.panY,scaleX:this.scaleX}},setStateInViewCoordinates:function(a){this.panX=
362 g.xWorldToView(h),a.moveTo(c,0),a.lineTo(c,d));a.strokeStyle=this.color;a.stroke()}};return{TimelineViewport:d,ViewportMarker:b}});"use strict";base.require("base.utils");
363 base.exportTo("base",function(){function d(a){try{a.callback.call(a.context)}catch(c){base.onAnimationFrameError(c,a.stack)}}function b(){k=!1;var a=f;h=g;f=[];g=[];for(var c=0;c<a.length;c++)d(a[c]);for(;0<h.length;)d(h.shift());h=void 0}function a(){if(!e)return"";var a=base.stackTrace();a.shift();return a.join("\n")}function c(c,e){g.push({callback:c,context:e||window,stack:a()});k||(k=!0,window.webkitRequestAnimationFrame(b))}var e=!1,f=[],g=[],h=void 0,k=!1;return{onAnimationFrameError:function(a,
364 c){c&&console.log(c);a.message?console.error(a.message,a.stack):console.error(a)},requestPreAnimationFrame:function(c,e){f.push({callback:c,context:e||window,stack:a()});k||(k=!0,window.webkitRequestAnimationFrame(b))},requestAnimationFrame:c,requestAnimationFrameInThisFrameIfPossible:function(b,e){h?h.push({callback:b,context:e||window,stack:a()}):c(b,e)}}});"use strict";base.require("base.events");base.require("ui");
365 base.exportTo("ui",function(){var d=ui.define("div");d.prototype={__proto__:HTMLUnknownElement.prototype,decorate:function(){this.observer_=new WebKitMutationObserver(this.didMutate_.bind(this));this.observer_.observe(this,{childList:!0});Object.defineProperty(this,"textContent",{get:void 0,set:this.onSetTextContent_})},appendChild:function(b){HTMLUnknownElement.prototype.appendChild.call(this,b);this.didMutate_(this.observer_.takeRecords())},insertBefore:function(b,a){HTMLUnknownElement.prototype.insertBefore.call(this,
368 "use strict";base.requireStylesheet("tracing.tracks.track");base.require("ui");base.require("ui.container_that_decorates_its_children");base.require("tracing.color_scheme");
369 base.exportTo("tracing.tracks",function(){var d=tracing.getColorPaletteHighlightIdBoost(),b=ui.define("track",ui.ContainerThatDecoratesItsChildren);b.prototype={__proto__:ui.ContainerThatDecoratesItsChildren.prototype,decorate:function(a){ui.ContainerThatDecoratesItsChildren.prototype.decorate.call(this);if(void 0===a)throw Error("viewport is required when creating a Track.");this.viewport_=a;this.classList.add("track");this.categoryFilter_=void 0},get viewport(){return this.viewport_},context:function(){if(this.parentNode){if(!this.parentNode.context)throw Error("Parent container does not support context() method.");
373 g);for(c=base.findLowIndexInSortedArray(a,function(a){return a.start},c);c<a.length;++c){var m=a[c],n=m.start;if(n>b)break;Math.max(m.duration,0.001);m=m.selected?m.colorId+d:m.colorId;0.001<k?h.fillRect(n,k,m):(f.fillStyle=l[m],f.beginPath(),f.moveTo(n-4*k,g),f.lineTo(n,0),f.lineTo(n+4*k,g),f.closePath(),f.fill())}h.flush();f.restore()}};return{Track:b}});"use strict";base.requireStylesheet("tracing.tracks.drawing_container");base.require("base.raf");base.require("tracing.tracks.track");base.require("ui");
374 base.exportTo("tracing.tracks",function(){var d={SLICE:1,INSTANT_EVENT:2},b=ui.define("drawing-container",tracing.tracks.Track);b.prototype={__proto__:tracing.tracks.Track.prototype,decorate:function(a){tracing.tracks.Track.prototype.decorate.call(this,a);this.classList.add("drawing-container");this.canvas_=document.createElement("canvas");this.canvas_.className="drawing-container-canvas";this.canvas_.style.left=tracing.constants.HEADING_WIDTH+"px";this.appendChild(this.canvas_);this.ctx_=this.canvas_.getContext("2d");
375 this.viewportChange_=this.viewportChange_.bind(this);this.viewport.addEventListener("change",this.viewportChange_)},get canvas(){return this.canvas_},context:function(){return this.ctx_},viewportChange_:function(){this.invalidate()},invalidate:function(){this.rafPending_||(this.rafPending_=!0,base.requestPreAnimationFrame(function(){this.rafPending_=!1;this.ctx_.clearRect(0,0,this.canvas_.width,this.canvas_.height);this.updateCanvasSizeIfNeeded_();base.requestAnimationFrameInThisFrameIfPossible(function(){for(var a=
377 base.asArray(this.children).filter(this.visibleFilter_),b=this.getBoundingClientRect(),e=a[0].getBoundingClientRect(),d=a[a.length-1].getBoundingClientRect(),a=e.width-tracing.constants.HEADING_WIDTH,d=d.bottom-e.top,g=window.devicePixelRatio||1;this.canvas_.width!=a*g&&(this.canvas_.width=a*g,this.canvas_.style.width=a+"px");this.canvas_.height!=d*g&&(this.canvas_.height=d*g,this.canvas_.style.height=d+"px");b=e.top-b.top+this.scrollTop;this.canvas_.style.top+"px"!==b&&(this.canvas_.style.top=b+
378 "px")},visibleFilter_:function(a){return a instanceof tracing.tracks.Track?"none"!==window.getComputedStyle(a).display:!1}};return{DrawingContainer:b,DrawType:d}});"use strict";base.exportTo("tracing",function(){return{constants:{HEADING_WIDTH:250}}});"use strict";base.requireStylesheet("tracing.tracks.heading_track");base.require("tracing.constants");base.require("tracing.tracks.track");base.require("ui");
379 base.exportTo("tracing.tracks",function(){var d=ui.define("heading-track",tracing.tracks.Track);d.prototype={__proto__:tracing.tracks.Track.prototype,decorate:function(b){tracing.tracks.Track.prototype.decorate.call(this,b);this.classList.add("heading-track");this.headingDiv_=document.createElement("heading");this.headingDiv_.style.width=tracing.constants.HEADING_WIDTH+"px";this.appendChild(this.headingDiv_)},get heading(){return this.headingDiv_.textContent},set heading(b){this.headingDiv_.textContent=
380 b},set tooltip(b){this.headingDiv_.title=b},draw:function(b,a,c){throw Error("draw implementation missing");}};return{HeadingTrack:d}});"use strict";base.requireStylesheet("tracing.tracks.ruler_track");base.require("tracing.constants");base.require("tracing.tracks.track");base.require("tracing.tracks.heading_track");base.require("ui");
381 base.exportTo("tracing.tracks",function(){var d=ui.define("ruler-track",tracing.tracks.HeadingTrack),b=Math.log(10);d.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("ruler-track");this.strings_secs_=[];this.strings_msecs_=[];this.addEventListener("mousedown",this.onMouseDown);this.viewportMarkersChange_=this.viewportMarkersChange_.bind(this);a.addEventListener("markersChange",this.viewportMarkersChange_)},
389 base.exportTo("base",function(){function d(){this.iframe_=void 0}d.prototype={__proto__:Object.prototype,measure:function(b){this.iframe_.contentDocument.body.appendChild(b);var a=this.iframe_.contentWindow.getComputedStyle(b),c=parseInt(a.width,10),a=parseInt(a.height,10);this.iframe_.contentDocument.body.removeChild(b);return{width:c,height:a}},attach:function(){var b=document.createElement("iframe");b.style.cssText="position:absolute;width:100%;height:0;border:0;visibility:hidden";document.body.appendChild(b);
390 this.iframe_=b;this.iframe_.contentDocument.body.style.cssText="padding:0;margin:0;overflow:hidden";for(var b=document.querySelectorAll("link[rel=stylesheet]"),a=0;a<b.length;a++){var c=b[a],e=this.iframe_.contentDocument.createElement("link");e.rel="stylesheet";e.href=c.href;this.iframe_.contentDocument.head.appendChild(e)}},detach:function(){document.body.removeChild(this.iframe_);this.iframe_=void 0}};return{MeasuringStick:d}});"use strict";base.require("tracing.tracks.track");base.require("tracing.filter");
391 base.require("ui");
392 base.exportTo("tracing.tracks",function(){var d=ui.define("container-track",tracing.tracks.Track);d.prototype={__proto__:tracing.tracks.Track.prototype,decorate:function(b){tracing.tracks.Track.prototype.decorate.call(this,b)},detach:function(){this.textContent=""},get tracks_(){for(var b=[],a=0;a<this.children.length;a++)this.children[a].classList.contains("track")&&b.push(this.children[a]);return b},drawTrack:function(b){for(var a=0;a<this.children.length;++a)this.children[a]instanceof tracing.tracks.Track&&
395 base.exportTo("tracing",function(){function d(b,a,c,e){this.ctx_=b;this.minRectSize_=a;this.maxMergeDist_=c;this.pallette_=e}d.prototype={y_:0,h_:0,merging_:!1,mergeStartX_:0,mergeCurRight_:0,setYandH:function(b,a){this.flush();this.y_=b;this.h_=a},fillRect:function(b,a,c){var e=b+a;a<this.minRectSize_?(e-this.mergeStartX_>this.maxMergeDist_&&this.flush(),this.merging_?(this.mergeCurRight_=e,this.mergedColorId=Math.max(this.mergedColorId,c)):(this.merging_=!0,this.mergeStartX_=b,this.mergeCurRight_=
396 e,this.mergedColorId=c)):(this.merging_&&this.flush(),this.ctx_.fillStyle=this.pallette_[c],this.ctx_.fillRect(b,this.y_,a,this.h_))},flush:function(){this.merging_&&(this.ctx_.fillStyle=this.pallette_[this.mergedColorId],this.ctx_.fillRect(this.mergeStartX_,this.y_,this.mergeCurRight_-this.mergeStartX_,this.h_),this.merging_=!1)}};return{FastRectRenderer:d}});"use strict";base.requireStylesheet("tracing.tracks.slice_track");base.require("base.sorted_array_utils");base.require("tracing.tracks.heading_track");
397 base.require("tracing.fast_rect_renderer");base.require("tracing.color_scheme");base.require("ui");
398 base.exportTo("tracing.tracks",function(){function d(){}function b(a,b){this.string=a;this.width=b}var a=tracing.getColorPalette(),c=ui.define("slice-track",tracing.tracks.HeadingTrack);c.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,SHOULD_ELIDE_TEXT:!0,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("slice-track");this.elidedTitleCache=new d;this.asyncStyle_=!1;this.slices_=null},get asyncStyle(){return this.asyncStyle_},set asyncStyle(a){this.asyncStyle_=
400 f=window.devicePixelRatio||1,g=this.getBoundingClientRect().height*f,p=this.viewport,q=p.xViewVectorToWorld(1);d.save();p.applyTransformToCanvas(d);this.asyncStyle_&&(d.globalAlpha=0.25);var t=new tracing.FastRectRenderer(d,2*q,2*q,a);t.setYandH(0,g);for(var v=this.slices_,w=base.findLowIndexInSortedArray(v,function(a){return a.start+a.duration},b),s=w;s<v.length;++s){var r=v[s],u=r.start;if(u>c)break;var x=Math.max(r.duration,0.001),y=r.selected?r.colorId+e:r.colorId;x<q&&(x=q);0<r.duration?t.fillRect(u,
402 this.elidedTitleCache.get(this,q,w,u,r.duration),w=u.string,u=u.width),u*q<r.duration&&(r=p.xWorldToView(r.start+0.5*r.duration),d.fillText(w,r,2.5*f,u)))}},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,b,c,e){base.iterateOverIntersectingIntervals(this.slices_,function(a){return a.start},function(a){return a.duration},a,b,function(a){a=e.addSlice(this,a);this.decorateHit(a)}.bind(this))},indexOfSlice_:function(a){for(var b=base.findLowIndexInSortedArray(this.slices_,function(a){return a.start},
404 b.addSlice(this,this.slices_[c]);this.decorateHit(e)}}};var e=tracing.getColorPaletteHighlightIdBoost(),f={},g={};d.prototype={get:function(a,c,e,d,f){var p=g[e];p||(p={},g[e]=p);d=p[c];d||(p[c]={},d=p[c]);p=d[f];if(void 0===p){for(p=!1;a.labelWidthWorld(e,c)>f&&!(1>0.75*e.length);)e=e.substring(0,0.75*e.length),p=!0;p&&3<e.length&&(e=e.substring(0,e.length-3)+"...");p=new b(e,a.labelWidth(e));d[f]=p}return p}};return{SliceTrack:c}});"use strict";base.require("tracing.tracks.container_track");base.require("tracing.tracks.slice_track");
405 base.require("tracing.filter");base.require("tracing.trace_model");base.require("ui");
406 base
408 this.appendChild(a)}}}};return{CpuTrack:d}});"use strict";base.requireStylesheet("tracing.tracks.object_instance_track");base.require("base.sorted_array_utils");base.require("tracing.tracks.heading_track");base.require("tracing.color_scheme");base.require("ui");
409 base.exportTo("tracing.tracks",function(){var d=tracing.getColorPalette(),b=tracing.getColorPaletteHighlightIdBoost(),a=ui.define("object-instance-track",tracing.tracks.HeadingTrack);a.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("object-instance-track");this.objectInstances_=[];this.objectSnapshots_=[]},get objectInstances(){return this.objectInstances_},set objectInstances(a){a&&0!=
411 d)}},drawSlices_:function(a,e){var f=this.context(),g=window.devicePixelRatio||1,h=this.getBoundingClientRect().height*g,k=0.5*h,l=2*Math.PI,m=this.viewport,n=this.snapshotRadiusView,p=m.xViewVectorToWorld(h),q;f.save();m.applyTransformToCanvas(f);var t=this.objectInstances_;q=base.findLowIndexInSortedArray(t,function(a){return a.deletionTs},a);f.globalAlpha=0.25;for(f.strokeStyle="rgb(0,0,0)";q<t.length;++q){var v=t[q],w=v.creationTs;if(w>e)break;var s=v.selected?v.colorId+b:v.colorId,v=v.deletionTs==
412 Number.MAX_VALUE?e:v.deletionTs;f.fillStyle=d[s];f.fillRect(w,g,v-w,h-2*g)}f.globalAlpha=1;f.restore();g=this.objectSnapshots_;for(q=base.findLowIndexInSortedArray(g,function(a){return a.ts+p},a);q<g.length;++q){h=g[q];w=h.ts;if(w-p>e)break;w=m.xWorldToView(w);s=h.selected?h.objectInstance.colorId+b:h.objectInstance.colorId;f.fillStyle=d[s];f.beginPath();f.arc(w,k,n,0,l);f.fill();h.selected?(f.lineWidth=5,f.strokeStyle="rgb(100,100,0)",f.stroke(),f.beginPath(),f.arc(w,k,n-1,0,l),f.lineWidth=2,f.strokeStyle=
413 "rgb(255,255,0)"):(f.lineWidth=1,f.strokeStyle="rgb(0,0,0)");f.stroke()}f.lineWidth=1},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,b,d,g){function h(a){g.addObjectInstance(k,a)}var k=this,l=!1,m=d*this.snapshotRadiusView;base.iterateOverIntersectingIntervals(this.objectSnapshots_,function(a){return a.ts-m},function(a){return 2*m},a,b,function(a){g.addObjectSnapshot(k,a);l=!0});l||base.iterateOverIntersectingIntervals(this.objectInstances_,function(a){return a.creationTs},function(a){return a.deletionTs-
415 return!1},addAllObjectsMatchingFilterToSelection:function(a,b){}};a.typeNameToTrackConstructorMap={};a.register=function(b,e){if(a.typeNameToTrackConstructorMap[b])throw Error("Handler already registered for "+b);a.typeNameToTrackConstructorMap[b]=e};a.getTrackConstructor=function(b){return a.typeNameToTrackConstructorMap[b]};return{ObjectInstanceTrack:a}});"use strict";base.requireStylesheet("tcmalloc.heap_instance_track");base.require("base.sorted_array_utils");base.require("tracing.tracks.heading_track");
416 base.require("tracing.tracks.object_instance_track");base.require("tracing.color_scheme");base.require("ui");
417 base.exportTo("tcmalloc",function(){var d=tracing.getColorPalette(),b=tracing.getColorPaletteHighlightIdBoost(),a=ui.define("heap-instance-track",tracing.tracks.HeadingTrack);a.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("heap-instance-track");this.objectInstance_=null},set objectInstances(a){if(a){if(1!=a.length)throw Error("Bad object instance count.");this.objectInstance_=a[0];this.maxBytes_=
419 g=window.devicePixelRatio||1,h=this.getBoundingClientRect(),k=h.width*g,g=h.height*g,h=this.viewport,l=this.maxBytes_,m=this.objectInstance_.snapshots,n=base.findLowIndexInSortedArray(m,function(a){return a.ts},a);for(0<n&&(n-=1);n<m.length;++n){var p=m[n],q=p.ts;if(q>e)break;q=h.xWorldToView(q);0>q&&(q=0);var t=h.xWorldToView(n<m.length-1?m[n+1].ts:m[m.length-1].ts+5E3);t>k&&(t=k);for(var q=Math.floor(q),t=Math.floor(t),v=g,w=Object.keys(p.heap_.children),s=w.length-1;0<=s;s--){var r=p.heap_.children[w[s]];
420 f.fillStyle=this.objectInstance_.selectedTraces&&0<this.objectInstance_.selectedTraces.length&&this.objectInstance_.selectedTraces[0]==w[s]?"rgb(239, 248, 206)":d[(p.selected?p.objectInstance.colorId+b:p.objectInstance.colorId)+s];r=g*r.currentBytes/l;f.fillRect(q,v-r,Math.max(t-q,1),r);v-=r}}f.lineWidth=1},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,b,d,g){var h=this;base.iterateOverIntersectingIntervals(this.objectInstance_.snapshots,function(a){return a.ts},function(a){return 5E3},
421 a,b,function(a){g.addObjectSnapshot(h,a)})},addItemNearToProvidedHitToSelection:function(a,b,d){if(a instanceof tracing.SelectionObjectSnapshotHit){var g=this.objectInstance_.snapshots;a=g.indexOf(a.objectSnapshot)+b;if(0<=a&&a<g.length)return d.addObjectSnapshot(this,g[a]),!0}else throw Error("Unrecognized hit");return!1},addAllObjectsMatchingFilterToSelection:function(a,b){}};tracing.tracks.ObjectInstanceTrack.register("memory::Heap",a);return{HeapInstanceTrack:a}});"use strict";base.requireStylesheet("tracing.tracks.counter_track");
422 base.require("tracing.tracks.heading_track");base.require("tracing.color_scheme");base.require("ui");
423 base.exportTo("tracing.tracks",function(){var d=tracing.getColorPalette(),b=ui.define("counter-track",tracing.tracks.HeadingTrack);b.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(a){tracing.tracks.HeadingTrack.prototype.decorate.call(this,a);this.classList.add("counter-track");this.selectedSamples_={};this.categoryFilter_=new tracing.Filter},decorateHit:function(a){},get counter(){return this.counter_},set counter(a){this.counter_=a;this.heading=a.name+": "},get categoryFilter(){return this.categoryFilter_},
424 set categoryFilter(a){this.categoryFilter_=a},get selectedSamples(){return this.selectedSamples_},draw:function(a,b,e){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,e)}},drawSlices_:function(a,b){var e=this.context(),f=window.devicePixelRatio||1,f=this.getBoundingClientRect().height*f,g=this.counter_,h=this.viewport,k=h.xViewVectorToWorld(1),l=h.xViewVectorToWorld(1);e.save();h.applyTransformToCanvas(e);for(var h=g.numSeries,m=g.numSamples,n=base.findLowIndexInSortedArray(g.timestamps,
426 "rgba(255, 0, 0, 1)";for(r in this.selectedSamples_)if(this.selectedSamples_[r])for(u=g.timestamps[r],q=g.numSeries-1;0<=q;q--)x=g.totals[r*h+q],x=f-p*x,e.fillRect(u-k,x-1,3*k,3);e.restore()},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,b,e,d){function g(a,b){return b===h.timestamps.length-1?0:h.timestamps[b+1]-h.timestamps[b]}var h=this.counter_;a=base.findLowIndexInSortedIntervals(h.timestamps,function(a){return a},g,a);for(b=base.findLowIndexInSortedIntervals(h.timestamps,function(a){return a},
427 g,b);a<=b;a++)0>a||a>=h.timestamps.length||(e=d.addCounterSample(this,this.counter,a),this.decorateHit(e))},addAllObjectsMatchingFilterToSelection:function(a,b){}};return{CounterTrack:b}});"use strict";base.requireStylesheet("tracing.tracks.spacing_track");base.require("tracing.tracks.heading_track");
428 base.exportTo("tracing.tracks",function(){var d=ui.define("spacing-track",tracing.tracks.HeadingTrack);d.prototype={__proto__:tracing.tracks.HeadingTrack.prototype,decorate:function(b){tracing.tracks.HeadingTrack.prototype.decorate.call(this,b);this.classList.add("spacing-track")},draw:function(b,a,c){},addAllObjectsMatchingFilterToSelection:function(b,a){}};return{SpacingTrack:d}});"use strict";base.require("base.sorted_array_utils");base.require("tracing.tracks.container_track");base.require("ui");
429 base.exportTo("tracing.tracks",function(){var d=ui.define("slice-group-track",tracing.tracks.ContainerTrack);d.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(b){tracing.tracks.ContainerTrack.prototype.decorate.call(this,b);this.classList.add("slice-group-track");this.heading_=this.tooltip_=""},get group(){return this.group_},set group(b){this.group_=b;this.updateContents_()},get heading(){return this.heading_},set heading(b){this.heading_=b;this.updateContents_()},
430 get tooltip(){return this.tooltip_},set tooltip(b){this.tooltip_=b;this.updateContents_()},set decorateHit(b){this.decorateHit_=b;this.updateContents_()},addSliceTrack_:function(b){var a=new tracing.tracks.SliceTrack(this.viewport);a.slices=b;a.decorateHit=this.decorateHit_;a.categoryFilter_=this.categoryFilter;this.appendChild(a);return a},get subRows(){return base.asArray(this.children).map(function(b){return b.slices})},get hasVisibleContent(){return 0<this.children.length},updateContents_:function(){if(this.group_){var b=
433 k.subSlices&&k.subSlices.push(d);g=!0;break}}g||e[0].push(d)}return e},areArrayContentsSame_:function(b,a){if(!(b&&a&&b.length&&a.length)||b.length!=a.length)return!1;for(var c=0;c<b.length;++c)if(b[c]!=a[c])return!1;return!0}};return{SliceGroupTrack:d}});"use strict";base.require("tracing.tracks.slice_group_track");base.require("ui");
434 base.exportTo("tracing.tracks",function(){var d=ui.define("async-slice-group-track",tracing.tracks.SliceGroupTrack);d.prototype={__proto__:tracing.tracks.SliceGroupTrack.prototype,decorate:function(b){tracing.tracks.SliceGroupTrack.prototype.decorate.call(this,b);this.classList.add("async-slice-group-track")},addSliceTrack_:function(b){b=tracing.tracks.SliceGroupTrack.prototype.addSliceTrack_.call(this,b);b.asyncStyle=!0;return b},buildSubRows_:function(){var b=tracing.filterSliceArray(this.categoryFilter,
436 base.requireStylesheet("tracing.tracks.thread_track");base.require("tracing.tracks.container_track");base.require("tracing.tracks.slice_track");base.require("tracing.tracks.slice_group_track");base.require("tracing.tracks.async_slice_group_track");base.require("tracing.filter");base.require("ui");
437 base.exportTo("tracing.tracks",function(){var d=ui.define("thread-track",tracing.tracks.ContainerTrack);d.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(b){tracing.tracks.ContainerTrack.prototype.decorate.call(this,b);this.classList.add("thread-track")},get thread(){return this.thread_},set thread(b){this.thread_=b;this.updateContents_()},get hasVisibleContent(){return 0<this.tracks_.length},updateContents_:function(){this.detach();if(this.thread_){this.heading=this.thread_.userFriendlyName+
440 b.group=this.thread_.sliceGroup,b.hasVisibleContent&&this.appendChild(b))}},collapsedDidChange:function(b){if(b){b=parseInt(this.tracks[0].height);for(var a=0;a<this.tracks.length;++a)2<b?this.tracks[a].height=Math.floor(b)+"px":this.tracks[a].style.display="none",b*=0.5}else for(a=0;a<this.tracks.length;++a)this.tracks[a].height=this.tracks[0].height,this.tracks[a].style.display=""}};return{ThreadTrack:d}});"use strict";base.require("ui");base.require("base.settings");
441 base
442 b,e,d,g){function h(d){d=n.selectedOptions[0].targetPropertyValue;base.Settings.set(e,d);a[b]=d}for(var k,l=0;l<g.length;l++){var m=g[l];if(m.value==d){k=l;break}}if(void 0===k)throw Error("defaultValue must be in the items list");var n=document.createElement("select");n.addEventListener("change",h);for(l=0;l<g.length;l++){var m=g[l],p=document.createElement("option");p.textContent=m.label;p.targetPropertyValue=m.value;n.appendChild(p)}a.__lookupSetter__("selectedIndex");n.__defineGetter__("selectedValue",
443 function(a){return n.children[n.selectedIndex].targetPropertyValue});n.__defineSetter__("selectedValue",function(a){for(var b=0;b<n.children.length;b++)if(n.children[b].targetPropertyValue==a){n.selectedIndex=b;h();return}throw Error("Not a valid value");});g=base.Settings.get(e,d);m=!1;for(l=0;l<n.children.length;l++)if(n.children[l].targetPropertyValue==g){m=!0;a[b]=g;n.selectedIndex=l;break}m||(n.selectedIndex=k,a[b]=d);return n},createCheckBox:function(a,c,e,f,g){function h(){base.Settings.set(e,
444 k.checked);a[c]=k.checked}var k=document.createElement("input");k.type="checkbox";f=base.Settings.get(e,f);k.checked=!!f;a[c]=f;k.addEventListener("change",h);f="#checkbox-"+b++;var l=d({className:"labeled-checkbox"});k.setAttribute("id",f);var m=document.createElement("label");m.textContent=g;m.setAttribute("for",f);l.appendChild(k);l.appendChild(m);l.__defineSetter__("checked",function(a){k.checked=!!a;h()});l.__defineGetter__("checked",function(){return k.checked});return l}}});"use strict";base.require("tcmalloc.heap_instance_track");
445 base.require("tracing.analysis.object_snapshot_view");base.require("tracing.analysis.object_instance_view");base.require("tracing.tracks.container_track");base.require("tracing.tracks.counter_track");base.require("tracing.tracks.object_instance_track");base.require("tracing.tracks.spacing_track");base.require("tracing.tracks.thread_track");base.require("tracing.trace_model_settings");base.require("tracing.filter");base.require("ui");base.require("ui.dom_helpers");base.requireStylesheet("tracing.tracks.process_track_base");
446 base.exportTo("tracing.tracks",function(){var d=tracing.analysis.ObjectSnapshotView,b=tracing.analysis.ObjectInstanceView,a=tracing.TraceModelSettings,c=tracing.tracks.SpacingTrack,e=ui.define("process-track-base",tracing.tracks.ContainerTrack);e.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(a){tracing.tracks.ContainerTrack.prototype.decorate.call(this,a);this.processBase_=void 0;this.classList.add("process-track-base");this.classList.add("expanded");this.expandEl_=
450 this.appendThreadTracks_(),this.didAppendTracks_())},willAppendTracks_:function(){},didAppendTracks_:function(){},appendObjectInstanceTracks_:function(){var a=this.processBase_.objects.getAllInstancesByTypeName(),e=base.dictionaryKeys(a);e.sort();var h=!1;e.forEach(function(c){var e=a[c],g=b.getViewInfo(c),n=d.getViewInfo(c);g&&!g.options.showInTrackView&&(g=void 0);n&&!n.options.showInTrackView&&(n=void 0);for(var n=g||n,g=[],p=0;p<e.length;p++){var q=e[p];0!==q.snapshots.length&&(q.hasImplicitSnapshots&&
451 !n||g.push(q))}0!==g.length&&(c=tracing.tracks.ObjectInstanceTrack.getTrackConstructor(c),c||(c=tracing.tracks.ObjectInstanceTrack),c=new c(this.viewport),c.categoryFilter=this.categoryFilter_,c.objectInstances=g,this.appendChild(c),h=!0)},this);h&&this.appendChild(new c(this.viewport))},appendCounterTracks_:function(){var a=base.dictionaryValues(this.processBase.counters).filter(this.categoryFilter.matchCounter,this.categoryFilter);a.sort(tracing.trace_model.Counter.compare);a.forEach(function(a){var b=
452 new tracing.tracks.CounterTrack(this.viewport);b.categoryFilter=this.categoryFilter_;b.counter=a;this.appendChild(b);this.appendChild(new c(this.viewport))}.bind(this))},appendThreadTracks_:function(){var a=base.dictionaryValues(this.processBase.threads).filter(function(a){return this.categoryFilter_.matchThread(a)},this);a.sort(tracing.trace_model.Thread.compare);a.forEach(function(a){var b=new tracing.tracks.ThreadTrack(this.viewport);b.categoryFilter=this.categoryFilter_;b.thread=a;b.hasVisibleContent&&
453 (this.appendChild(b),this.appendChild(new c(this.viewport)))}.bind(this))}};return{ProcessTrackBase:e}});"use strict";base.require("tracing.tracks.process_track_base");base.require("tracing.tracks.cpu_track");base.require("tracing.tracks.spacing_track");
454 base.exportTo("tracing.tracks",function(){var d=tracing.tracks.ProcessTrackBase,b=tracing.tracks.SpacingTrack,a=ui.define("kernel-track",d);a.prototype={__proto__:d.prototype,decorate:function(a){tracing.tracks.ProcessTrackBase.prototype.decorate.call(this,a)},set kernel(a){this.processBase=a},get kernel(){return this.processBase},willAppendTracks_:function(){var a=this.categoryFilter,d=base.dictionaryValues(this.kernel.cpus);d.sort(tracing.trace_model.Cpu.compare);for(var f=!1,g=0;g<d.length;++g){var h=
455 d[g];if(!a.matchCpu(h))return;var k=new tracing.tracks.CpuTrack(this.viewport);k.categoryFilter=a;k.cpu=h;k.hasVisibleContent&&(this.appendChild(k),f=!0)}f&&this.appendChild(new b(this.viewport))}};return{KernelTrack:a}});"use strict";base.require("tracing.tracks.process_track_base");
456 base.exportTo("tracing.tracks",function(){var d=tracing.tracks.ProcessTrackBase,b=ui.define("process-track",d);b.prototype={__proto__:d.prototype,decorate:function(a){tracing.tracks.ProcessTrackBase.prototype.decorate.call(this,a)},drawTrack:function(a){switch(a){case tracing.tracks.DrawType.INSTANT_EVENT:if(!this.processBase.instantEvents||0===this.processBase.instantEvents.length)break;var b=this.context();if(void 0===b)break;b.save();var d=this.setupCanvasForDraw_();this.drawInstantEvents_(this.processBase.instantEvents,
457 d.left,d.right);b.restore()}tracing.tracks.ContainerTrack.prototype.drawTrack.call(this,a)},set process(a){this.processBase=a},get process(){return this.processBase},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,b,d,f){base.iterateOverIntersectingIntervals(this.processBase.instantEvents,function(a){return a.start},function(a){return a.duration},a,b,function(a){a=f.addSlice(this,a);this.decorateHit(a)}.bind(this));tracing.tracks.ContainerTrack.prototype.addIntersectingItemsInRangeToSelectionInWorldSpace.apply(this,
458 arguments)}};return{ProcessTrack:b}});"use strict";base.requireStylesheet("tracing.tracks.trace_model_track");base.require("base.measuring_stick");base.require("tracing.tracks.container_track");base.require("tracing.tracks.kernel_track");base.require("tracing.tracks.process_track");base.require("ui");
459 base.exportTo("tracing.tracks",function(){var d=ui.define("trace-model-track",tracing.tracks.ContainerTrack);d.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(b){tracing.tracks.ContainerTrack.prototype.decorate.call(this,b);this.classList.add("model-track")},detach:function(){tracing.tracks.ContainerTrack.prototype.detach.call(this)},get model(){return this.model_},set model(b){this.model_=b;this.updateContents_()},get hasVisibleContent(){return 0<this.children.length},
462 b)},addIntersectingItemsInRangeToSelectionInWorldSpace:function(b,a,c,d){base.iterateOverIntersectingIntervals(this.model_.instantEvents,function(a){return a.start},function(a){return a.duration},b,a,function(a){a=d.addSlice(this,a);this.decorateHit(a)}.bind(this));tracing.tracks.ContainerTrack.prototype.addIntersectingItemsInRangeToSelectionInWorldSpace.apply(this,arguments)}};return{TraceModelTrack:d}});"use strict";base.requireStylesheet("ui.tool_button");base.requireStylesheet("ui.mouse_mode_selector");
463 base.requireTemplate("ui.mouse_mode_selector");base.require("base.events");base.require("tracing.mouse_mode_constants");base.require("ui");
464 base.exportTo("ui",function(){var d=ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(b){this.classList.add("mouse-mode-selector");this.parentEl_=b;b=base.instantiateTemplate("#mouse-mode-selector-template");this.appendChild(b);this.buttonsEl_=this.querySelector(".buttons");this.dragHandleEl_=this.querySelector(".drag-handle");this.panScanModeButton_=this.buttonsEl_.querySelector(".pan-scan-mode-button");this.selectionModeButton_=this.buttonsEl_.querySelector(".selection-mode-button");
465 this.zoomModeButton_=this.buttonsEl_.querySelector(".zoom-mode-button");this.pos_={x:base.Settings.get("mouse_mode_selector.x",window.innerWidth-50),y:base.Settings.get("mouse_mode_selector.y",100)};this.constrainPositionToWindowBounds_();this.updateStylesFromPosition_();this.isDraggingModeSelectorDragHandle_=!1;this.initialRelativeMouseDownPos_={x:0,y:0};this.dragHandleEl_.addEventListener("mousedown",this.onDragHandleMouseDown_.bind(this));document.addEventListener("mousemove",this.onDragHandleMouseMove_.bind(this));
467 this.onMouseDown_.bind(this));document.addEventListener("keypress",this.onKeyPress_.bind(this));document.addEventListener("keydown",this.onKeyDown_.bind(this));document.addEventListener("keyup",this.onKeyUp_.bind(this));this.mode=base.Settings.get("mouse_mode_selector.mouseMode",tracing.mouseModeConstants.MOUSE_MODE_PANSCAN);this.isInteracting_=this.isInTemporaryAlternativeMouseMode_=!1},get mode(){return this.currentMode_},set mode(b){if(this.currentMode_!==b){var a=tracing.mouseModeConstants;this.currentMode_=
468 b;this.panScanModeButton_.classList.remove("active");this.selectionModeButton_.classList.remove("active");this.zoomModeButton_.classList.remove("active");switch(b){case a.MOUSE_MODE_PANSCAN:this.panScanModeButton_.classList.add("active");break;case a.MOUSE_MODE_SELECTION:this.selectionModeButton_.classList.add("active");break;case a.MOUSE_MODE_ZOOM:this.zoomModeButton_.classList.add("active");break;default:throw Error("Unknown selection mode: "+b);}base.Settings.set("mouse_mode_selector.mouseMode",
470 a=new base.Event(a.begin,!0,!0);a.data=b;this.dispatchEvent(a);this.isInteracting_=!0},onMouseMove_:function(b){var a=this.getCurrentModeEventNames_(),a=new base.Event(a.update,!0,!0);a.data=b;this.dispatchEvent(a)},onMouseUp_:function(b){var a=this.getCurrentModeEventNames_(),a=new base.Event(a.end,!0,!0),c=!b.shiftKey,d=base.isMac&&!b.metaKey||!base.isMac&&!b.ctrlKey;a.data=b;this.dispatchEvent(a);this.isInteracting_=!1;this.isInTemporaryAlternativeMouseMode_&&(c&&d)&&(this.mode=tracing.mouseModeConstants.MOUSE_MODE_PANSCAN)},
472 this.isInTemporaryAlternativeMouseMode_=!1},onKeyPress_:function(b){if(!this.isInteracting_){var a=tracing.mouseModeConstants;switch(b.keyCode){case 49:this.mode=a.MOUSE_MODE_PANSCAN;break;case 50:this.mode=a.MOUSE_MODE_SELECTION;break;case 51:this.mode=a.MOUSE_MODE_ZOOM}}},onKeyDown_:function(b){if(!this.isInteracting_){var a=tracing.mouseModeConstants,c=base.isMac&&b.metaKey||!base.isMac&&b.ctrlKey,d=b.shiftKey;this.mode===a.MOUSE_MODE_PANSCAN&&(c||d)&&(this.mode=c?a.MOUSE_MODE_ZOOM:a.MOUSE_MODE_SELECTION,
473 this.isInTemporaryAlternativeMouseMode_=!0,b.preventDefault())}},onKeyUp_:function(b){if(!this.isInteracting_){var a=tracing.mouseModeConstants,c=base.isMac&&!b.metaKey||!base.isMac&&!b.ctrlKey;b=b.shiftKey;this.isInTemporaryAlternativeMouseMode_&&(c||b)&&(this.mode=a.MOUSE_MODE_PANSCAN);this.isInTemporaryAlternativeMouseMode_=!1}},constrainPositionToWindowBounds_:function(){var b=window.innerHeight-this.offsetHeight,a=window.innerWidth-this.offsetWidth;this.pos_.x=Math.max(this.pos_.x,0);this.pos_.x=
474 Math.min(this.pos_.x,a);this.pos_.y=Math.max(this.pos_.y,0);this.pos_.y=Math.min(this.pos_.y,b)},updateStylesFromPosition_:function(){this.style.left=this.pos_.x+"px";this.style.top=this.pos_.y+"px";base.Settings.set("mouse_mode_selector.x",this.pos_.x);base.Settings.set("mouse_mode_selector.y",this.pos_.y)},onDragHandleMouseDown_:function(b){b.preventDefault();b.stopImmediatePropagation();this.isDraggingModeSelectorDragHandle_=!0;this.initialRelativeMouseDownPos_.x=b.clientX-this.offsetLeft;this.initialRelativeMouseDownPos_.y=
476 "use strict";base.requireStylesheet("tracing.timeline_track_view");base.require("base.events");base.require("base.properties");base.require("base.settings");base.require("tracing.filter");base.require("tracing.selection");base.require("tracing.timeline_viewport");base.require("tracing.mouse_mode_constants");base.require("tracing.tracks.drawing_container");base.require("tracing.tracks.trace_model_track");base.require("tracing.tracks.ruler_track");base.require("ui");base.require("ui.mouse_mode_selector");
477 base.exportTo("tracing",function(){var d=tracing.Selection,b=tracing.TimelineViewport,a=ui.define("div");a.prototype={__proto__:HTMLDivElement.prototype,model_:null,decorate:function(){this.classList.add("timeline-track-view");this.categoryFilter_=new tracing.CategoryFilter;this.viewport_=new b(this);this.viewportStateAtMouseDown_=null;this.rulerTrackContainer_=new tracing.tracks.DrawingContainer(this.viewport_);this.appendChild(this.rulerTrackContainer_);this.rulerTrackContainer_.invalidate();this.rulerTrack_=
483 a;this.modelTrack_.categoryFilter=a},get model(){return this.model_},set model(a){if(!a)throw Error("Model cannot be null");var b=this.model_!=a;this.model_=a;this.modelTrack_.model=a;this.modelTrack_.categoryFilter=this.categoryFilter;b&&this.viewport_.setWhenPossible(this.setInitialViewport_.bind(this));base.setPropertyAndDispatchChange(this,"model",a)},get hasVisibleContent(){return this.modelTrack_.hasVisibleContent},setInitialViewport_:function(){var a=this.modelTrackContainer_.canvas.width,
492 get selection(){return this.selection_},set selection(a){if(!(a instanceof d))throw Error("Expected Selection");var b;for(b=0;b<this.selection_.length;b++)this.selection_[b].selected=!1;this.selection_.clear();this.selection_.addSelection(a);base.dispatchSimpleEvent(this,"selectionChange");for(b=0;b<this.selection_.length;b++)this.selection_[b].selected=!0;this.selection_.length&&this.selection_[0].track&&this.selection_[0].track.scrollIntoViewIfNeeded();this.viewport_.dispatchChangeEvent()},hideDragBox_:function(){this.dragBox_.style.left=
494 Math.max(m,h),p.right=Math.min(n,d),p.bottom=Math.min(k,g),p.width=p.right-p.left,p.height=p.bottom-p.top,h=p);this.dragBox_.style.left=h.left+"px";this.dragBox_.style.width=h.width+"px";this.dragBox_.style.top=h.top+"px";this.dragBox_.style.height=h.height+"px";h=window.devicePixelRatio||1;d=this.modelTrackContainer_.canvas;b=this.viewport_.xViewToWorld((b-d.offsetLeft)*h);h=this.viewport_.xViewToWorld((a-d.offsetLeft)*h);a=Math.round(100*(h-b))/100;this.dragBox_.textContent=a+"ms";a=new base.Event("selectionChanging");
496 a;this.viewport_.gridTimebase=b}},canBeginInteraction_:function(a){return 0!=a.button||ui.elementIsChildOf(a.target,this.rulerTrack_)?!1:!0},onDblClick_:function(a){if(this.isPanningAndScanning_){var b=new base.Event("endpan");b.data=a;this.onEndPanScan_(b)}this.isZooming_&&(b=new base.Event("endzoom"),b.data=a,this.onEndZoom_(b));this.rulerTrack_.placeAndBeginDraggingMarker(a.clientX);a.preventDefault()},storeLastMousePos_:function(a){this.lastMouseViewPos_=this.extractRelativeMousePosition_(a)},
502 b,g,h,f);this.selection=f;(base.isMac&&a.metaKey||!base.isMac&&a.ctrlKey)&&this.zoomToSelection_()}},onBeginZoom_:function(a){a=a.data;this.canBeginInteraction_(a)&&(this.isZooming_=!0,this.storeInitialInteractionPositionsAndFocus_(a),a.preventDefault())},onUpdateZoom_:function(a){if(this.isZooming_){a=a.data;var b=this.extractRelativeMousePosition_(a);this.zoomBy_(1+0.01*(this.lastMouseViewPos_.y-b.y));this.storeLastMousePos_(a)}},onEndZoom_:function(a){this.isZooming_=!1}};return{TimelineTrackView:a}});
503 "use strict";base.require("tracing.timeline_track_view");base.require("tracing.filter");base.require("ui.overlay");
504 base.exportTo("tracing",function(){function d(){this.model_=this.timeline_=void 0;this.filterText_="";this.filterHits_=new tracing.Selection;this.filterHitsDirty_=!0;this.currentHitIndex_=-1}var b=ui.define("div");b.prototype={__proto__:ui.Overlay.prototype,decorate:function(){ui.Overlay.prototype.decorate.call(this);this.className="find-control";this.hitCountEl_=document.createElement("div");this.hitCountEl_.className="hit-count-label";this.hitCountEl_.textContent="1 of 7";var a=document.createElement("div");
510 -1===this.currentHitIndex_;b&&0>a&&(this.currentHitIndex_=0);var d=this.filterHits.length;this.currentHitIndex_=(this.currentHitIndex_+a+d)%d;a=this.filterHits.subSelection(this.currentHitIndex_);this.showHits_(a,b,!0)},findNext:function(){this.find_(1)},findPrevious:function(){this.find_(-1)},reset:function(){this.filterText_="";this.filterHitsDirty_=!0}};return{FindControl:b,FindController:d}});"use strict";base.require("ui");base.requireStylesheet("ui.drag_handle");
511 base.exportTo("ui",function(){var d=ui.define("x-drag-handle");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.lastMousePos_=0;this.onMouseMove_=this.onMouseMove_.bind(this);this.onMouseUp_=this.onMouseUp_.bind(this);this.addEventListener("mousedown",this.onMouseDown_);this.target_=void 0;this.horizontal=!0;this.observer_=new WebKitMutationObserver(this.didTargetMutate_.bind(this));this.targetSizesByModeKey_={}},get modeKey_(){return""==this.target_.className?".":this.target_.className},
515 this.horizontal_?b.clientY:b.clientX,document.addEventListener("mousemove",this.onMouseMove_),document.addEventListener("mouseup",this.onMouseUp_),b.preventDefault(),!0},onMouseUp_:function(b){document.removeEventListener("mousemove",this.onMouseMove_);document.removeEventListener("mouseup",this.onMouseUp_);b.preventDefault()}};return{DragHandle:d}});"use strict";base.requireStylesheet("tracing.timeline_view");base.requireTemplate("tracing.timeline_view");base.require("base.utils");base.require("base.settings");
516 base.require("tracing.analysis.analysis_view");base.require("tracing.category_filter_dialog");base.require("tracing.filter");base.require("tracing.find_control");base.require("tracing.timeline_track_view");base.require("ui.overlay");base.require("ui.drag_handle");
517 base.exportTo("tracing",function(){var d=ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.classList.add("timeline-view");var b=base.instantiateTemplate("#timeline-view-template");this.appendChild(b);this.titleEl_=this.querySelector(".title");this.leftControlsEl_=this.querySelector("#left-controls");this.rightControlsEl_=this.querySelector("#right-controls");this.timelineContainer_=this.querySelector(".container");this.categoryFilterButton_=this.createCategoryFilterButton_();
519 this.analysisEl_=new tracing.analysis.AnalysisView;this.analysisEl_.addEventListener("requestSelectionChange",this.onRequestSelectionChange_.bind(this));this.appendChild(this.analysisEl_);this.onSelectionChanged_=this.onSelectionChanged_.bind(this);document.addEventListener("keypress",this.onKeypress_.bind(this),!0);this.dragEl_.target=this.analysisEl_},createImportErrorsButton_:function(){var b=base.instantiateTemplate("#import-errors-btn-template"),a=b.querySelector(".view-import-errors-button"),
521 new tracing.CategoryFilter(b))},createCategoryFilterButton_:function(){var b=base.instantiateTemplate("#category-filter-btn-template").querySelector(".view-info-button");b.addEventListener("click",function(){var a=new tracing.CategoryFilterDialog;a.categories=this.model.categories;a.settings_key="categories";a.settingUpdatedCallback=this.updateCategoryFilter_.bind(this);a.visible=!0}.bind(this));var a=function(){b.style.display=this.model?"":"none"}.bind(this);a();this.addEventListener("modelChange",
522 a);return b},createHelpButton_:function(){var b=base.instantiateTemplate("#help-btn-template"),a=b.querySelector(".view-help-button"),c=b.querySelector(".view-help-text"),d=new ui.Overlay;d.classList.add("view-help-overlay");d.obeyCloseEvents=!0;d.additionalCloseKeyCodes.push(63);d.appendChild(c);a.addEventListener("click",function(a){d.visible=!0;c.textContent=this.timeline_?this.timeline_.keyHelp:"No content loaded. For interesting help, load something.";a.stopPropagation();return!1}.bind(this));
523 return a},createMetadataButton_:function(){var b=base.instantiateTemplate("#metadata-btn-template"),a=b.querySelector(".view-metadata-button"),b=b.querySelector(".info-button-container"),c=b.querySelector(".info-button-text"),d=new ui.Overlay;d.classList.add("view-metadata-overlay");d.obeyCloseEvents=!0;d.appendChild(b);a.addEventListener("click",function(){d.visible=!0;var a=[],b=this.model,h;for(h in b.metadata){var k=b.metadata[h],l=JSON.stringify(k.name),k=JSON.stringify(k.value,void 0," ");a.push(l+
526 this.focusElement_:this.parentElement,this.timelineContainer_.appendChild(this.timeline_),this.findCtl_.controller.timeline=this.timeline_,this.timeline_.addEventListener("selectionChange",this.onSelectionChanged_),this.analysisEl_.clearSelectionHistory());c&&(this.timeline_.model=b);base.dispatchSimpleEvent(this,"modelChange");if(a)this.onSelectionChanged_()},get timeline(){return this.timeline_},get settings(){this.settings_||(this.settings_=new base.Settings);return this.settings_},set focusElement(b){this.focusElement_=
529 var a=this.timeline_?this.timeline_.selection:new tracing.Selection;this.analysisEl_.selection=a;this.timelineContainer_.scrollTop=b},onRequestSelectionChange_:function(b){this.timeline_.selection=b.selection;b.stopPropagation()}};return{TimelineView:d}});"use strict";base.require("tracing.timeline_view");base.require("tracing.importer");