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

Issue 84713002: Add number() static methods to AtomicString class (Closed)

Created:
7 years ago by Inactive
Modified:
7 years ago
Reviewers:
tkent, eseidel
CC:
blink-reviews, Nils Barth (inactive), kojih, arv+blink, jsbell+bindings_chromium.org, feature-media-reviews_chromium.org, gasubic, philipj_slow, eae+blinkwatch, yurys+blink_chromium.org, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, nessy, adamk+blink_chromium.org, haraken, loislo+blink_chromium.org, Nate Chapin, vcarbune.chromium, Inactive
Visibility:
Public.

Description

Add number() static methods to AtomicString class Add number() static methods to AtomicString class as a lot of callers need it and previously had to use String::number() then convert the String to an AtomicString. Calling AtomicString::number() directly when the caller needs an AtomicString is ~2% faster. Also refactored HTML code to use the Element helper methods for Number attributes. R=eseidel Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162593

Patch Set 1 #

Total comments: 11

Patch Set 2 : Take feedback into consideration #

Patch Set 3 : Take feedback into consideration #

Patch Set 4 : Take feedback into consideration #

Patch Set 5 : Take feedback into consideration (getting AppEngine errors...) #

Total comments: 3

Patch Set 6 : Pass NaN as default argument #

Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -81 lines) Patch
M Source/bindings/v8/V8StringResource.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/DOMStringMap.h View 1 chunk +1 line, -1 line 0 comments Download
Source/core/dom/Element.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 2 chunks +12 lines, -4 lines 0 comments Download
M Source/core/editing/BreakBlockquoteCommand.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLBodyElement.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLCanvasElement.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLElement.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLImageElement.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 3 chunks +4 lines, -4 lines 0 comments Download
M Source/core/html/HTMLMeterElement.cpp View 1 7 chunks +12 lines, -12 lines 0 comments Download
M Source/core/html/HTMLOListElement.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLProgressElement.cpp View 1 3 chunks +5 lines, -4 lines 0 comments Download
M Source/core/html/HTMLSelectElement.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTableCellElement.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTableColElement.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTextAreaElement.cpp View 1 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/html/HTMLViewSourceDocument.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/HTMLParserIdioms.h View 1 2 3 4 5 2 chunks +3 lines, -6 lines 0 comments Download
M Source/core/html/parser/HTMLParserIdioms.cpp View 1 2 3 4 5 3 chunks +0 lines, -11 lines 0 comments Download
M Source/core/html/shadow/MediaControlElements.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/storage/Storage.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/wtf/text/AtomicString.h View 1 chunk +9 lines, -0 lines 0 comments Download
M Source/wtf/text/AtomicString.cpp View 2 chunks +38 lines, -0 lines 0 comments Download
A + Source/wtf/text/AtomicStringTest.cpp View 1 1 chunk +27 lines, -16 lines 0 comments Download
M Source/wtf/text/IntegerToStringConversion.h View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/wtf/wtf.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Inactive
7 years ago (2013-11-24 20:30:39 UTC) #1
tkent
lgtm with a nit. It seems V8StringResource still uses String::number(). https://codereview.chromium.org/84713002/diff/1/Source/wtf/text/AtomicStringTest.cpp File Source/wtf/text/AtomicStringTest.cpp (right): https://codereview.chromium.org/84713002/diff/1/Source/wtf/text/AtomicStringTest.cpp#newcode38 ...
7 years ago (2013-11-24 21:20:03 UTC) #2
eseidel
lgtm. We can fix all the various usage nits in a later patch. https://codereview.chromium.org/84713002/diff/1/Source/core/html/HTMLBodyElement.cpp File ...
7 years ago (2013-11-24 21:37:43 UTC) #3
Inactive
https://codereview.chromium.org/84713002/diff/1/Source/bindings/v8/V8StringResource.cpp File Source/bindings/v8/V8StringResource.cpp (right): https://codereview.chromium.org/84713002/diff/1/Source/bindings/v8/V8StringResource.cpp#newcode195 Source/bindings/v8/V8StringResource.cpp:195: webCoreString = String::number(value); tkent, are you referring to this ...
7 years ago (2013-11-24 21:48:13 UTC) #4
tkent
https://codereview.chromium.org/84713002/diff/1/Source/bindings/v8/V8StringResource.cpp File Source/bindings/v8/V8StringResource.cpp (right): https://codereview.chromium.org/84713002/diff/1/Source/bindings/v8/V8StringResource.cpp#newcode195 Source/bindings/v8/V8StringResource.cpp:195: webCoreString = String::number(value); On 2013/11/24 21:48:13, Chris Dumez wrote: ...
7 years ago (2013-11-24 22:03:25 UTC) #5
Inactive
https://codereview.chromium.org/84713002/diff/1/Source/core/html/HTMLProgressElement.cpp File Source/core/html/HTMLProgressElement.cpp (right): https://codereview.chromium.org/84713002/diff/1/Source/core/html/HTMLProgressElement.cpp#newcode122 Source/core/html/HTMLProgressElement.cpp:122: setAttribute(maxAttr, AtomicString::number(max > 0 ? max : 1)); On ...
7 years ago (2013-11-24 22:06:19 UTC) #6
Inactive
https://codereview.chromium.org/84713002/diff/1/Source/core/html/HTMLBodyElement.cpp File Source/core/html/HTMLBodyElement.cpp (right): https://codereview.chromium.org/84713002/diff/1/Source/core/html/HTMLBodyElement.cpp#newcode172 Source/core/html/HTMLBodyElement.cpp:172: setAttribute(marginheightAttr, AtomicString::number(marginHeight)); On 2013/11/24 21:37:44, eseidel wrote: > Looks ...
7 years ago (2013-11-24 22:30:00 UTC) #7
Inactive
I updated the patch according to feedback, thanks. Please take another look. I'm getting AppEngine ...
7 years ago (2013-11-24 23:19:16 UTC) #8
eseidel
lgtm https://codereview.chromium.org/84713002/diff/210003/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/84713002/diff/210003/Source/core/dom/Element.cpp#newcode2768 Source/core/dom/Element.cpp:2768: double Element::getFloatingPointAttribute(const QualifiedName& attributeName, double fallbackValue) const This ...
7 years ago (2013-11-25 00:46:41 UTC) #9
Inactive
https://codereview.chromium.org/84713002/diff/210003/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/84713002/diff/210003/Source/core/dom/Element.cpp#newcode2768 Source/core/dom/Element.cpp:2768: double Element::getFloatingPointAttribute(const QualifiedName& attributeName, double fallbackValue) const On 2013/11/25 ...
7 years ago (2013-11-25 01:19:37 UTC) #10
Inactive
https://codereview.chromium.org/84713002/diff/210003/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/84713002/diff/210003/Source/core/dom/Element.cpp#newcode2768 Source/core/dom/Element.cpp:2768: double Element::getFloatingPointAttribute(const QualifiedName& attributeName, double fallbackValue) const On 2013/11/25 ...
7 years ago (2013-11-25 01:28:12 UTC) #11
eseidel
lgtm Thanks. This is now very explicit to the callers of this function what will ...
7 years ago (2013-11-25 01:47:46 UTC) #12
eseidel
You really went above and beyond the call of duty with this change. Thank you ...
7 years ago (2013-11-25 01:48:27 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/84713002/70002
7 years ago (2013-11-25 01:52:28 UTC) #14
commit-bot: I haz the power
7 years ago (2013-11-25 03:04:59 UTC) #15
Message was sent while issue was closed.
Change committed as 162593

Powered by Google App Engine
This is Rietveld 408576698