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

Issue 102103002: Have HashMap<KeyType, AtomicString>::get() return a const reference (Closed)

Created:
7 years ago by Inactive
Modified:
7 years ago
CC:
blink-reviews, devtools-reviews_chromium.org, caseq+blink_chromium.org, Nate Chapin, loislo+blink_chromium.org, eustas+blink_chromium.org, alph+blink_chromium.org, eae+blinkwatch, yurys+blink_chromium.org, lushnikov+blink_chromium.org, abarth-chromium, vsevik+blink_chromium.org, pfeldman+blink_chromium.org, dglazkov+blink, paulirish+reviews_chromium.org, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, aandrey+blink_chromium.org, gavinp+loader_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Have HashMap<KeyType, AtomicString>::get() return a const reference Have HashMap<KeyType, AtomicString>::get() return nullAtom instead of AtomicString() when the key cannot be found so that the method can now return a const reference. This avoids useless copies of the AtomicString when calling HashMap::get() when the value type is AtomicString. This CL already makes use of this optimization in relevant call sites. R=tkent Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163179

Patch Set 1 #

Total comments: 6

Patch Set 2 : Use AtomicString::ConstructFromLiteral #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -67 lines) Patch
M Source/core/css/StyleSheetContents.cpp View 1 chunk +1 line, -4 lines 0 comments Download
M Source/core/dom/Document.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.cpp View 1 2 chunks +7 lines, -7 lines 0 comments Download
M Source/core/fetch/CSSStyleSheetResource.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/CrossOriginAccessControl.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/fetch/ResourceFetcher.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLElement.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/html/forms/FormController.cpp View 3 chunks +9 lines, -10 lines 0 comments Download
M Source/core/html/parser/XSSAuditor.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/inspector/InspectorPageAgent.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorPageAgent.cpp View 1 1 chunk +7 lines, -7 lines 0 comments Download
M Source/core/loader/FrameLoader.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/timing/Performance.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 4 chunks +4 lines, -6 lines 0 comments Download
M Source/platform/network/HTTPHeaderMap.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/network/HTTPHeaderMap.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/network/ResourceRequest.h View 2 chunks +6 lines, -6 lines 0 comments Download
M Source/platform/network/ResourceRequest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/network/ResourceResponse.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/network/ResourceResponse.cpp View 5 chunks +5 lines, -5 lines 0 comments Download
M Source/wtf/text/AtomicStringHash.h View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Inactive
7 years ago (2013-12-03 15:51:11 UTC) #1
tkent
lgtm https://codereview.chromium.org/102103002/diff/1/Source/core/html/parser/XSSAuditor.cpp File Source/core/html/parser/XSSAuditor.cpp (right): https://codereview.chromium.org/102103002/diff/1/Source/core/html/parser/XSSAuditor.cpp#newcode266 Source/core/html/parser/XSSAuditor.cpp:266: DEFINE_STATIC_LOCAL(const AtomicString, XSSProtectionHeader, ("X-XSS-Protection")); should have ConstructFromLiteral argument. ...
7 years ago (2013-12-04 01:01:00 UTC) #2
Inactive
https://codereview.chromium.org/102103002/diff/1/Source/core/html/parser/XSSAuditor.cpp File Source/core/html/parser/XSSAuditor.cpp (right): https://codereview.chromium.org/102103002/diff/1/Source/core/html/parser/XSSAuditor.cpp#newcode266 Source/core/html/parser/XSSAuditor.cpp:266: DEFINE_STATIC_LOCAL(const AtomicString, XSSProtectionHeader, ("X-XSS-Protection")); On 2013/12/04 01:01:00, tkent wrote: ...
7 years ago (2013-12-04 14:11:26 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/102103002/20001
7 years ago (2013-12-04 14:11:56 UTC) #4
commit-bot: I haz the power
7 years ago (2013-12-04 15:49:01 UTC) #5
Message was sent while issue was closed.
Change committed as 163179

Powered by Google App Engine
This is Rietveld 408576698