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

Issue 2783103002: Dispose temporary and not-cached Range in DOMSelection

Created:
3 years, 8 months ago by yoichio
Modified:
3 years, 8 months ago
Reviewers:
tkent, yosin_UTC9
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Dispose temporary and not-cached Range in DOMSelection We can dispose temporary Range in Selection of shadow root because it is neither cached nor exposed to js but we create it each time when we call getRangeAt(). BUG=693975

Patch Set 1 #

Patch Set 2 : update #

Total comments: 1

Patch Set 3 : update #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -1 line) Patch
M third_party/WebKit/Source/core/editing/DOMSelection.cpp View 1 2 1 chunk +6 lines, -1 line 4 comments Download

Messages

Total messages: 19 (10 generated)
yoichio
3 years, 8 months ago (2017-03-30 08:28:40 UTC) #7
tkent
> // However, Selection of shadow root returns copied Range everytime so far This is ...
3 years, 8 months ago (2017-03-30 08:53:09 UTC) #8
yosin_UTC9
https://codereview.chromium.org/2783103002/diff/20001/third_party/WebKit/Source/core/editing/DOMSelection.cpp File third_party/WebKit/Source/core/editing/DOMSelection.cpp (right): https://codereview.chromium.org/2783103002/diff/20001/third_party/WebKit/Source/core/editing/DOMSelection.cpp#newcode128 third_party/WebKit/Source/core/editing/DOMSelection.cpp:128: class ScopedRange { Please introduce a function acts like ...
3 years, 8 months ago (2017-03-30 08:58:17 UTC) #9
yoichio
> Range* DOMSelection::primaryRangeOrNull() const { > if (rangeCount() <= 0) > return nullptr; > Range* ...
3 years, 8 months ago (2017-04-03 08:51:54 UTC) #14
yoichio
PTAL
3 years, 8 months ago (2017-04-04 01:55:49 UTC) #15
yosin_UTC9
https://codereview.chromium.org/2783103002/diff/40001/third_party/WebKit/Source/core/editing/DOMSelection.cpp File third_party/WebKit/Source/core/editing/DOMSelection.cpp (right): https://codereview.chromium.org/2783103002/diff/40001/third_party/WebKit/Source/core/editing/DOMSelection.cpp#newcode544 third_party/WebKit/Source/core/editing/DOMSelection.cpp:544: if (!isSelectionOfDocument()) I'm not a fan of this approach. ...
3 years, 8 months ago (2017-04-04 04:50:07 UTC) #16
yoichio
https://codereview.chromium.org/2783103002/diff/40001/third_party/WebKit/Source/core/editing/DOMSelection.cpp File third_party/WebKit/Source/core/editing/DOMSelection.cpp (right): https://codereview.chromium.org/2783103002/diff/40001/third_party/WebKit/Source/core/editing/DOMSelection.cpp#newcode544 third_party/WebKit/Source/core/editing/DOMSelection.cpp:544: if (!isSelectionOfDocument()) On 2017/04/04 04:50:07, yosin_UTC9 wrote: > I'm ...
3 years, 8 months ago (2017-04-04 05:32:42 UTC) #17
yosin_UTC9
https://codereview.chromium.org/2783103002/diff/40001/third_party/WebKit/Source/core/editing/DOMSelection.cpp File third_party/WebKit/Source/core/editing/DOMSelection.cpp (right): https://codereview.chromium.org/2783103002/diff/40001/third_party/WebKit/Source/core/editing/DOMSelection.cpp#newcode544 third_party/WebKit/Source/core/editing/DOMSelection.cpp:544: if (!isSelectionOfDocument()) On 2017/04/04 at 05:32:42, yoichio wrote: > ...
3 years, 8 months ago (2017-04-04 07:21:31 UTC) #18
tkent
3 years, 8 months ago (2017-04-04 08:41:24 UTC) #19
https://codereview.chromium.org/2783103002/diff/40001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/editing/DOMSelection.cpp (right):

https://codereview.chromium.org/2783103002/diff/40001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/editing/DOMSelection.cpp:544: if
(!isSelectionOfDocument())
> Calling Range::dispose() is error prone in this case and hacky.
> Let's make clear code rather hacky code.

I agree that it's a hack :)
If we have no reason to be hurry, we should avoid this approach.

Powered by Google App Engine
This is Rietveld 408576698