Commit ea63ce7d authored by Zeynep Cankara's avatar Zeynep Cankara Committed by Commit Bot

[tools][system-analyzer] Fix Chunk Selection and Consecutive file upload

Bug fixes:

* Wrong time range selection of timeline chunks handled by mouse events.
* Consecutive file uploads does not create a new Model object causing
bugs on timeline-track start and end times.

Bug: v8:10644

Change-Id: I3d31ddda1ffca70c18c87dd103f2b788713c2911
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2379863Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Cr-Commit-Position: refs/heads/master@{#69598}
parent 2a49c903
...@@ -106,8 +106,13 @@ class App { ...@@ -106,8 +106,13 @@ class App {
console.log("source positions: ", sourcePositions); console.log("source positions: ", sourcePositions);
} }
handleFileUpload(e) { handleFileUpload(e) {
this.restartApp();
$("#container").className = "initial"; $("#container").className = "initial";
} }
restartApp() {
this.#state = new State();
this.#navigation = new Navigation(this.#state, this.#view);
}
// Map event log processing // Map event log processing
handleLoadTextMapProcessor(text) { handleLoadTextMapProcessor(text) {
let mapProcessor = new MapProcessor(); let mapProcessor = new MapProcessor();
......
...@@ -157,7 +157,9 @@ defineCustomElement('./timeline/timeline-track', (templateText) => ...@@ -157,7 +157,9 @@ defineCustomElement('./timeline/timeline-track', (templateText) =>
positionToTime(posX) { positionToTime(posX) {
let rect = this.timeline.getBoundingClientRect(); let rect = this.timeline.getBoundingClientRect();
let posClickedX = posX - rect.left + this.timeline.scrollLeft; let timeStartOffset = this.data.startTime * this.#timeToPixel;
let posClickedX =
posX - rect.left + this.timeline.scrollLeft + timeStartOffset;
let selectedTime = posClickedX / this.#timeToPixel; let selectedTime = posClickedX / this.#timeToPixel;
return selectedTime; return selectedTime;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment