Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: tools/turbolizer/util.js

Issue 2169043002: [turbolizer] Factor out some user actions into methods of GraphView. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@t-p6-base
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/turbolizer/graph-view.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 function makeContainerPosVisible(container, pos) { 7 function makeContainerPosVisible(container, pos) {
8 var height = container.offsetHeight; 8 var height = container.offsetHeight;
9 var margin = Math.floor(height / 4); 9 var margin = Math.floor(height / 4);
10 if (pos < container.scrollTop + margin) { 10 if (pos < container.scrollTop + margin) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 function sortUnique(arr, f) { 62 function sortUnique(arr, f) {
63 arr = arr.sort(f); 63 arr = arr.sort(f);
64 let ret = [arr[0]]; 64 let ret = [arr[0]];
65 for (var i = 1; i < arr.length; i++) { 65 for (var i = 1; i < arr.length; i++) {
66 if (arr[i-1] !== arr[i]) { 66 if (arr[i-1] !== arr[i]) {
67 ret.push(arr[i]); 67 ret.push(arr[i]);
68 } 68 }
69 } 69 }
70 return ret; 70 return ret;
71 } 71 }
72
73 // Partial application without binding the receiver
74 function partial(f) {
75 var arguments1 = Array.prototype.slice.call(arguments, 1);
76 return function() {
77 var arguments2 = Array.from(arguments);
78 f.apply(this, arguments1.concat(arguments2));
79 }
80 }
OLDNEW
« no previous file with comments | « tools/turbolizer/graph-view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698