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

Side by Side Diff: tools/turbolizer/selection-broker.js

Issue 729913004: Add a html-based visualizer for TurboFan graphs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 4 years, 7 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/selection.js ('k') | tools/turbolizer/text-view.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 var SelectionBroker = function() {
6 this.brokers = [];
7 this.dispatching = false;
8 this.lastDispatchingHandler = null;
9 };
10
11 SelectionBroker.prototype.addSelectionHandler = function(handler) {
12 this.brokers.push(handler);
13 }
14
15 SelectionBroker.prototype.select = function(from, ranges, selected) {
16 if (!this.dispatching) {
17 this.lastDispatchingHandler = from;
18 try {
19 this.dispatching = true;
20 for (var b of this.brokers) {
21 if (b != from) {
22 b.brokeredSelect(ranges, selected);
23 }
24 }
25 }
26 finally {
27 this.dispatching = false;
28 }
29 }
30 }
31
32 SelectionBroker.prototype.clear = function(from) {
33 this.lastDispatchingHandler = null;
34 if (!this.dispatching) {
35 try {
36 this.dispatching = true;
37 this.brokers.forEach(function(b) {
38 if (b != from) {
39 b.brokeredClear();
40 }
41 });
42 } finally {
43 this.dispatching = false;
44 }
45 }
46 }
OLDNEW
« no previous file with comments | « tools/turbolizer/selection.js ('k') | tools/turbolizer/text-view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698