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

Issue 2903373002: Fix a crash when getElementsByClassName() is called twice with the same argument including capital … (Closed)

Created:
3 years, 7 months ago by tkent
Modified:
3 years, 7 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix a crash when getElementsByClassName() is called twice with the same argument including capital letters. This fixes a regression by crrev.com/474217, which deleted a protector AtomicString accidentally. This CL removes a tricky StringImpl* hash key in NodeListsNodeData. BUG=725929 R=yosin@chromium.org Review-Url: https://codereview.chromium.org/2903373002 . Cr-Commit-Position: refs/heads/master@{#474870} Committed: https://chromium.googlesource.com/chromium/src/+/9cf04000e65705ebced49e4bc7e04ae0d2c7d895

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -11 lines) Patch
M third_party/WebKit/Source/core/dom/ElementTest.cpp View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/NodeListsNodeData.h View 2 chunks +8 lines, -11 lines 0 comments Download

Messages

Total messages: 11 (5 generated)
tkent
yosin@, would you review this please? This fixes the top crasher on Canary.
3 years, 7 months ago (2017-05-26 00:43:17 UTC) #5
yosin_UTC9
lgtm We need to keep |String| member of |AtomicString| in |std::pair<unsigned char, AtomicString>| in key ...
3 years, 7 months ago (2017-05-26 01:35:41 UTC) #6
tkent
On 2017/05/26 at 01:35:41, yosin wrote: > BTW, it is better to use |std::pair<CollectionType, AtomicString>| ...
3 years, 7 months ago (2017-05-26 01:40:49 UTC) #7
tkent
Committed patchset #1 (id:1) manually as 9cf04000e65705ebced49e4bc7e04ae0d2c7d895 (presubmit successful).
3 years, 7 months ago (2017-05-26 01:42:56 UTC) #9
tkent
On 2017/05/26 at 01:40:49, tkent wrote: > On 2017/05/26 at 01:35:41, yosin wrote: > > ...
3 years, 7 months ago (2017-05-26 07:52:13 UTC) #10
yosin_UTC9
3 years, 7 months ago (2017-05-26 09:42:32 UTC) #11
Message was sent while issue was closed.
On 2017/05/26 at 07:52:13, tkent wrote:
> On 2017/05/26 at 01:40:49, tkent wrote:
> > On 2017/05/26 at 01:35:41, yosin wrote:
> > > BTW, it is better to use |std::pair<CollectionType, AtomicString>| instead
of |unsigned char|
> > > with declaring |enum CollectionType : uint8_t|.
> > 
> > Yeah, I agree that |unsigned char| here doesn't make sense.  I'll change it
in a separated CL.
> 
> I found we needed to add a dedicated HashTraits for CollectionType in that
case. So it's not worth changing it from |unsigned char|.

It seems we don't have HashTrait<T> for |enum| and |enum class|.
Once we have them, we can use enum as hash key easier.
Can be done with std::is_enum<T> and std::underlying_type<T>?

Powered by Google App Engine
This is Rietveld 408576698