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

Issue 2709103004: [Content] Allow V8ValueConverter to convert -0 to an integer (Closed)

Created:
3 years, 10 months ago by Devlin
Modified:
3 years, 9 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, extensions-reviews_chromium.org, jam, jbroman
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Content] Allow V8ValueConverter to convert -0 to an integer V8ValueConverter currently converts -0 to a double, because it is not considered an int32 (or a uint32), even though it is === 0 (which is considered an int). This causes nastiness in extensions because we evaluate it as an integer, but the V8ValueConverter converts it to a bool, and breaks our expectations. Add a configuration method, SetConvertNegativeZeroToInt(), to V8ValueConverter to specify that -0 should be converted to an int. Add tests for both scenarios (with and without the configuration). BUG=694248 Review-Url: https://codereview.chromium.org/2709103004 Cr-Commit-Position: refs/heads/master@{#452854} Committed: https://chromium.googlesource.com/chromium/src/+/f88f9bc261af492194bc6d3b2e3536adc2a34904

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -3 lines) Patch
M chrome/test/data/extensions/platform_apps/window_api/test.js View 1 chunk +19 lines, -0 lines 0 comments Download
M content/child/v8_value_converter_impl.h View 2 chunks +4 lines, -0 lines 0 comments Download
M content/child/v8_value_converter_impl.cc View 3 chunks +10 lines, -0 lines 0 comments Download
M content/child/v8_value_converter_impl_unittest.cc View 1 chunk +31 lines, -0 lines 0 comments Download
M content/public/child/v8_value_converter.h View 1 chunk +3 lines, -0 lines 0 comments Download
M extensions/renderer/resources/schema_utils.js View 1 chunk +0 lines, -3 lines 0 comments Download
M extensions/renderer/send_request_natives.cc View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (9 generated)
Devlin
jochen@, mind taking a look? Technically, we could do this with the V8ValueConverter::Strategy::FromV8Number() method instead, ...
3 years, 10 months ago (2017-02-22 21:52:16 UTC) #5
jochen (gone - plz use gerrit)
lgtm
3 years, 9 months ago (2017-02-24 15:57:02 UTC) #8
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/2709103004/1
3 years, 9 months ago (2017-02-24 16:02:53 UTC) #10
commit-bot: I haz the power
3 years, 9 months ago (2017-02-24 17:10:10 UTC) #13
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/f88f9bc261af492194bc6d3b2e35...

Powered by Google App Engine
This is Rietveld 408576698