v8/tools/system-analyzer/events.mjs
Zeynep Cankara fec33d84cd [tools][system-analyzer] Implement drag-handlers to timeline panel
This CL adds drag handlers to the timeline panel
to filter events based on the selected portion
of the timeline tracks.

Bug: v8:10644
Change-Id: Ic8a38493eacb62844b3fed5a027f8b1367f2bb59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2346275
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69669}
2020-09-02 11:33:40 +00:00

47 lines
1.2 KiB
JavaScript

// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
class SelectionEvent extends CustomEvent {
static name = "showentries";
constructor(entries) {
super(SelectionEvent.name, { bubbles: true, composed: true });
if (!Array.isArray(entries) || entries.length == 0) {
throw new Error("No valid entries selected!");
}
this.entries = entries;
}
}
class FocusEvent extends CustomEvent {
static name = "showentrydetail";
constructor(entry) {
super(FocusEvent.name, { bubbles: true, composed: true });
this.entry = entry;
}
}
class SelectTimeEvent extends CustomEvent {
static name = 'timerangeselect';
constructor(start, end) {
super(SelectTimeEvent.name, { bubbles: true, composed: true });
this.start = start;
this.end = end;
}
}
class SynchronizeSelectionEvent extends CustomEvent {
static name = 'syncselection';
constructor(start, end) {
super(SynchronizeSelectionEvent.name, { bubbles: true, composed: true });
this.start = start;
this.end = end;
}
}
export {
SelectionEvent, FocusEvent, SelectTimeEvent,
SynchronizeSelectionEvent
};