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

Issue 2799043006: DevTools: make console viewport less error prone by always defining cumulativeHeights (Closed)

Created:
3 years, 8 months ago by luoe
Modified:
3 years, 8 months ago
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, pfeldman, kozyatinskiy+blink_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: make console viewport less error prone by always defining cumulativeHeights ConsoleViewport's firstVisibleIndex() may throw an error if it calls 'lowerBound' while _cumulativeHeights is not defined. This scenario happens when loading console after invalidating an empty viewport. Invalidate() deletes _cumulativeHeights, the prompt text is changed, then firstVisibleIndex() is called. To make viewport's public functions less error prone, we can ensure that _cumulativeHeights is always defined, using an empty typed array by default. BUG=708845 Review-Url: https://codereview.chromium.org/2799043006 Cr-Commit-Position: refs/heads/master@{#463333} Committed: https://chromium.googlesource.com/chromium/src/+/2d95267d052ef6af703663efd9fde7c3bb1730ba

Patch Set 1 #

Total comments: 6

Patch Set 2 : ac #

Patch Set 3 : remove unrelated changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -15 lines) Patch
M third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js View 1 8 chunks +10 lines, -15 lines 0 comments Download

Messages

Total messages: 19 (12 generated)
luoe
Please take a look https://codereview.chromium.org/2799043006/diff/1/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js (left): https://codereview.chromium.org/2799043006/diff/1/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js#oldcode182 third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js:182: this._viewport.invalidate(); drive by: Orthogonal to ...
3 years, 8 months ago (2017-04-07 01:19:39 UTC) #4
dgozman
Seems legit, but lushnikov@ knows better. https://codereview.chromium.org/2799043006/diff/1/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js (right): https://codereview.chromium.org/2799043006/diff/1/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js#newcode304 third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js:304: this._viewport.invalidate(); Why this ...
3 years, 8 months ago (2017-04-07 20:31:44 UTC) #6
luoe
Ready for review https://codereview.chromium.org/2799043006/diff/1/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js (right): https://codereview.chromium.org/2799043006/diff/1/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js#newcode304 third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js:304: this._viewport.invalidate(); I actually think we don't ...
3 years, 8 months ago (2017-04-07 22:09:55 UTC) #7
lushnikov
viewport lgtm! Let's have consoleview changes separately
3 years, 8 months ago (2017-04-07 23:26:41 UTC) #8
luoe
Done, I'll make a separate patch for the unrelated stuff. Thanks for the quick review
3 years, 8 months ago (2017-04-07 23:40:26 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2799043006/40001
3 years, 8 months ago (2017-04-10 16:43:27 UTC) #16
commit-bot: I haz the power
3 years, 8 months ago (2017-04-10 18:25:31 UTC) #19
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/2d95267d052ef6af703663efd9fd...

Powered by Google App Engine
This is Rietveld 408576698