cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / ntp4 / logging.js
blob1edb7a4a09e8e43689819d7dd238a67d43860e5d
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 /**
6 * @fileoverview
7 * Logging info for benchmarking purposes. Should be the first js file included.
8 */
10 /* Stack of events that has been logged. */
11 var eventLog = [];
13 /**
14 * Logs an event.
15 * @param {string} name The name of the event (can be any string).
16 * @param {boolean=} opt_shouldLogTime If true, the event is used for
17 * benchmarking and the time is logged. Otherwise, just push the event on
18 * the event stack.
20 function logEvent(name, opt_shouldLogTime) {
21 if (opt_shouldLogTime)
22 chrome.send('metricsHandler:logEventTime', [name]);
23 eventLog.push([name, Date.now()]);
26 logEvent('Tab.NewTabScriptStart', true);
27 window.addEventListener('load', function(e) {
28 logEvent('Tab.NewTabOnload', true);
29 });
30 document.addEventListener('DOMContentLoaded', function(e) {
31 logEvent('Tab.NewTabDOMContentLoaded', true);
32 });