OLD | NEW |
| 1 // Copyright (c) 2013 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. |
| 4 |
1 // The port for communicating back to the extension. | 5 // The port for communicating back to the extension. |
2 var benchmarkExtensionPort = chrome.extension.connect(); | 6 var benchmarkExtensionPort = chrome.runtime.connect(); |
3 | 7 |
4 // The url is what this page is known to the benchmark as. | 8 // The url is what this page is known to the benchmark as. |
5 // The benchmark uses this id to differentiate the benchmark's | 9 // The benchmark uses this id to differentiate the benchmark's |
6 // results from random pages being browsed. | 10 // results from random pages being browsed. |
7 | 11 |
8 // TODO(mbelshe): If the page redirects, the location changed and the | 12 // TODO(mbelshe): If the page redirects, the location changed and the |
9 // benchmark stalls. | 13 // benchmark stalls. |
10 var benchmarkExtensionUrl = window.location.toString(); | 14 var benchmarkExtensionUrl = window.location.toString(); |
11 | 15 |
12 // Compute max/min/avg dom tree depth. | 16 // Compute max/min/avg dom tree depth. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 domNum: dom.length, | 70 domNum: dom.length, |
67 domDepths: depths }); | 71 domDepths: depths }); |
68 } else { | 72 } else { |
69 window.setTimeout(sendTimesToExtension, 100); | 73 window.setTimeout(sendTimesToExtension, 100); |
70 } | 74 } |
71 } | 75 } |
72 | 76 |
73 // We can't use the onload event because this script runs at document idle, | 77 // We can't use the onload event because this script runs at document idle, |
74 // which may run after the onload has completed. | 78 // which may run after the onload has completed. |
75 sendTimesToExtension(); | 79 sendTimesToExtension(); |
OLD | NEW |