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

Issue 2638623004: Stop using DEFINE_STATIC_LOCAL in ResourceResponse.cpp. (Closed)

Created:
3 years, 11 months ago by horo
Modified:
3 years, 11 months ago
CC:
chromium-reviews, blink-reviews, kinuko+watch, blink-reviews-wtf_chromium.org, Mikhail, serviceworker-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Stop using DEFINE_STATIC_LOCAL in ResourceResponse.cpp. There are several AtomicStrings defined using DEFINE_STATIC_LOCAL in ResourceResponse.cpp. When those strings are touched on the worker thread, the ThreadRestrictionVerifier check in StringImpl.h fails. https://crbug.com/681581#c5 To avoid this check failure, this CL makes those strings static. BUG=681581 Review-Url: https://codereview.chromium.org/2638623004 Cr-Commit-Position: refs/heads/master@{#444016} Committed: https://chromium.googlesource.com/chromium/src/+/ad218510d6560dbc2b87d878f4e8b2ed5ac9730a

Patch Set 1 #

Patch Set 2 : remove out of date comment in AtomicString.h #

Patch Set 3 : add test and more AtomicStrings in parseCacheControlDirectives() #

Patch Set 4 : use const char[] #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -55 lines) Patch
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 2 chunks +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/network/HTTPParsers.cpp View 1 2 3 1 chunk +5 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceResponse.cpp View 1 2 3 8 chunks +42 lines, -47 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceResponseTest.cpp View 1 2 2 chunks +47 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (27 generated)
horo
haraken@ Could you please review this?
3 years, 11 months ago (2017-01-17 02:20:44 UTC) #13
Charlie Harrison
drive by: would you mind adding a unit test / layout test that triggers the ...
3 years, 11 months ago (2017-01-17 02:39:31 UTC) #15
haraken
Can we use DEFINE_THREAD_SAFE_STATIC_LOCAL instead? I'm not sure if these AtomicStrings are common enough to ...
3 years, 11 months ago (2017-01-17 02:45:37 UTC) #17
horo
On 2017/01/17 02:39:31, Charlie Harrison wrote: > drive by: would you mind adding a unit ...
3 years, 11 months ago (2017-01-17 05:48:10 UTC) #22
sof
On 2017/01/17 02:45:37, haraken wrote: > Can we use DEFINE_THREAD_SAFE_STATIC_LOCAL instead? > > I'm not ...
3 years, 11 months ago (2017-01-17 07:29:59 UTC) #25
kinuko
On 2017/01/17 07:29:59, sof wrote: > On 2017/01/17 02:45:37, haraken wrote: > > Can we ...
3 years, 11 months ago (2017-01-17 08:10:39 UTC) #26
esprehn
On 2017/01/17 at 02:45:37, haraken wrote: > Can we use DEFINE_THREAD_SAFE_STATIC_LOCAL instead? You can't do ...
3 years, 11 months ago (2017-01-17 08:23:00 UTC) #27
esprehn
You can fix this a few ways: - using a ThreadSpecific<AtomicString>, but now you pay ...
3 years, 11 months ago (2017-01-17 08:28:15 UTC) #28
horo
On 2017/01/17 08:10:39, kinuko wrote: > On 2017/01/17 07:29:59, sof wrote: > > On 2017/01/17 ...
3 years, 11 months ago (2017-01-17 08:34:33 UTC) #31
haraken
LGTM
3 years, 11 months ago (2017-01-17 08:49:00 UTC) #32
horo
On 2017/01/17 08:49:00, haraken wrote: > LGTM Thank you
3 years, 11 months ago (2017-01-17 08:54:46 UTC) #33
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/2638623004/20002
3 years, 11 months ago (2017-01-17 08:55:14 UTC) #36
sof
Opting for short literal strings for equalIgnoringCase() uses seems fine, but could you write out ...
3 years, 11 months ago (2017-01-17 09:04:29 UTC) #38
commit-bot: I haz the power
Committed patchset #4 (id:20002) as https://chromium.googlesource.com/chromium/src/+/ad218510d6560dbc2b87d878f4e8b2ed5ac9730a
3 years, 11 months ago (2017-01-17 09:58:29 UTC) #41
Charlie Harrison
3 years, 11 months ago (2017-01-17 13:32:39 UTC) #42
Message was sent while issue was closed.
LGTM but by making the header map strings non atomic we are explicitly opting
into re-hashing the string for every lookup (to find it in the atomic string
table). This can be expensive, so if we see it show up in profiles we may want
to re-consider this approach.

Powered by Google App Engine
This is Rietveld 408576698