|
|
Created:
3 years, 7 months ago by caseq Modified:
3 years, 7 months ago Reviewers:
lushnikov 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. |
DescriptionDevTools: fix race when revealing formatted source code
The porblem was caused by trying to format and add a source code twice.
As a drive by, do not reveal the source code if the user navigated away.
BUG=723098
Review-Url: https://codereview.chromium.org/2888843002
Cr-Commit-Position: refs/heads/master@{#473510}
Committed: https://chromium.googlesource.com/chromium/src/+/88ed93a30047ad7f2b91312c644abc0dbe98c2ff
Patch Set 1 #
Total comments: 8
Patch Set 2 : races on discard fixed #Patch Set 3 : rebased #
Messages
Total messages: 29 (14 generated)
caseq@chromium.org changed reviewers: + lushnikov@chromium.org
https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... File third_party/WebKit/Source/devtools/front_end/coverage/CoverageListView.js (right): https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/coverage/CoverageListView.js:120: async _revealSourceForSelectedNode() { is this change necessary? https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/coverage/CoverageListView.js:130: var formatData = await Sources.sourceFormatter.format(sourceCode); not: as per decision taken in performance-room, we now should put '// ----- ASYNC ------ comment before every await statement https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... File third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js (right): https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js:54: formatDataPromise.then(formatData => this.discardFormattedUISourceCode(formatData.formattedSourceCode)); Since you're caching per projectId + uiSourceCodeURL, do you expect the _uiSourceCodeRemoved to happen multiple times? In this case, the discardFormattedUISourceCode might be called multiple times, which you probably don't want. (However, caching by project.id() + url is almost the same as caching by UISourceCode instance itself)
https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... File third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js (right): https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js:54: formatDataPromise.then(formatData => this.discardFormattedUISourceCode(formatData.formattedSourceCode)); this._formattedPath.delete(path); https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js:109: var formattedURL = uiSourceCode.url() + ':formatted'; if (this._formattedPaths.get(path) !== resultPromise) return;
Patchset #2 (id:20001) has been deleted
PTAL, I resolved the races against either source code removal, changed caching to be performed based on UISourceCode instead of project+path and fixed formatted path generation to resolve collisions in case of multiple UISourceCodes with same URL. https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... File third_party/WebKit/Source/devtools/front_end/coverage/CoverageListView.js (right): https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/coverage/CoverageListView.js:120: async _revealSourceForSelectedNode() { On 2017/05/17 23:39:08, lushnikov wrote: > is this change necessary? This is not directly related, but seems like a reasonable drive-by -- we don't want late "reveal" to be completed if user navigated away. https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/coverage/CoverageListView.js:130: var formatData = await Sources.sourceFormatter.format(sourceCode); On 2017/05/17 23:39:08, lushnikov wrote: > not: as per decision taken in performance-room, we now should put '// ----- > ASYNC ------ comment before every await statement Done. https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... File third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js (right): https://codereview.chromium.org/2888843002/diff/1/third_party/WebKit/Source/d... third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js:109: var formattedURL = uiSourceCode.url() + ':formatted'; On 2017/05/17 23:57:32, lushnikov wrote: > if (this._formattedPaths.get(path) !== resultPromise) > return; Done.
lgtm
The CQ bit was checked by caseq@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by caseq@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by caseq@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from lushnikov@chromium.org Link to the patchset: https://codereview.chromium.org/2888843002/#ps60001 (title: "rebased")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by caseq@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by caseq@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 60001, "attempt_start_ts": 1495427245370160, "parent_rev": "c2bc18b08c8f89e49dccb2c9708c64ec318aadf7", "commit_rev": "88ed93a30047ad7f2b91312c644abc0dbe98c2ff"}
Message was sent while issue was closed.
Description was changed from ========== DevTools: fix race when revealing formatted source code The porblem was caused by trying to format and add a source code twice. As a drive by, do not reveal the source code if the user navigated away. BUG=723098 ========== to ========== DevTools: fix race when revealing formatted source code The porblem was caused by trying to format and add a source code twice. As a drive by, do not reveal the source code if the user navigated away. BUG=723098 Review-Url: https://codereview.chromium.org/2888843002 Cr-Commit-Position: refs/heads/master@{#473510} Committed: https://chromium.googlesource.com/chromium/src/+/88ed93a30047ad7f2b91312c644a... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as https://chromium.googlesource.com/chromium/src/+/88ed93a30047ad7f2b91312c644a... |