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

Issue 2391073005: WebUIDataSource::AddInteger (like AddBoolean/AddString) (Closed)

Created:
4 years, 2 months ago by michaelpg
Modified:
4 years, 2 months ago
CC:
chromium-reviews, jam, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

WebUIDataSource::AddInteger (like AddBoolean/AddString) Convenience function to add integers to a WebUIDataSource without using AddLocalizedStrings with a base::DictionaryValue. Limits width to 32 bits to prevent integers larger than can be represented in ES6 (2^53 - 1). (As before, larger numbers could still be set via AddLocalizedStrings.) BUG=none R=tommycli@chromium.org,creis@chromium.org TEST=content_unittests:WebUIDataSourceTest Committed: https://crrev.com/408b01b6f8b766facfc02fcbcb2226d2e3b98be0 Cr-Commit-Position: refs/heads/master@{#423816}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Limit to 32-bit width #

Patch Set 3 : . #

Total comments: 4

Patch Set 4 : DateTimeHandler usage of SetInteger #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -6 lines) Patch
M chrome/browser/ui/webui/settings/chromeos/date_time_handler.cc View 1 2 3 1 chunk +1 line, -3 lines 0 comments Download
M content/browser/webui/web_ui_data_source_impl.h View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/webui/web_ui_data_source_impl.cc View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M content/browser/webui/web_ui_data_source_unittest.cc View 1 2 1 chunk +9 lines, -3 lines 0 comments Download
M content/public/browser/web_ui_data_source.h View 1 2 2 chunks +7 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 26 (14 generated)
michaelpg
PTAL. The motivation is to pass "enum" values to loadTimeData.
4 years, 2 months ago (2016-10-06 03:37:07 UTC) #4
michaelpg
Tommy, could you take over for Dan? (I think dschuyler also has some context judging ...
4 years, 2 months ago (2016-10-06 18:24:45 UTC) #7
tommycli
lgtm this seems harmless to me. https://codereview.chromium.org/2391073005/diff/1/content/browser/webui/web_ui_data_source_unittest.cc File content/browser/webui/web_ui_data_source_unittest.cc (right): https://codereview.chromium.org/2391073005/diff/1/content/browser/webui/web_ui_data_source_unittest.cc#newcode117 content/browser/webui/web_ui_data_source_unittest.cc:117: source()->AddInteger("counter", 10); maybe ...
4 years, 2 months ago (2016-10-06 18:29:56 UTC) #8
michaelpg
https://codereview.chromium.org/2391073005/diff/1/content/browser/webui/web_ui_data_source_unittest.cc File content/browser/webui/web_ui_data_source_unittest.cc (right): https://codereview.chromium.org/2391073005/diff/1/content/browser/webui/web_ui_data_source_unittest.cc#newcode117 content/browser/webui/web_ui_data_source_unittest.cc:117: source()->AddInteger("counter", 10); On 2016/10/06 18:29:56, tommycli (OOO til Oct ...
4 years, 2 months ago (2016-10-06 18:58:34 UTC) #10
Charlie Reis
Basically looks good, with one content/public restriction below. https://codereview.chromium.org/2391073005/diff/40001/content/public/browser/web_ui_data_source.h File content/public/browser/web_ui_data_source.h (right): https://codereview.chromium.org/2391073005/diff/40001/content/public/browser/web_ui_data_source.h#newcode55 content/public/browser/web_ui_data_source.h:55: virtual ...
4 years, 2 months ago (2016-10-06 20:47:07 UTC) #11
michaelpg
https://codereview.chromium.org/2391073005/diff/40001/content/public/browser/web_ui_data_source.h File content/public/browser/web_ui_data_source.h (right): https://codereview.chromium.org/2391073005/diff/40001/content/public/browser/web_ui_data_source.h#newcode55 content/public/browser/web_ui_data_source.h:55: virtual void AddInteger(const std::string& name, int32_t value) = 0; ...
4 years, 2 months ago (2016-10-06 21:32:04 UTC) #12
Charlie Reis
https://codereview.chromium.org/2391073005/diff/40001/content/public/browser/web_ui_data_source.h File content/public/browser/web_ui_data_source.h (right): https://codereview.chromium.org/2391073005/diff/40001/content/public/browser/web_ui_data_source.h#newcode55 content/public/browser/web_ui_data_source.h:55: virtual void AddInteger(const std::string& name, int32_t value) = 0; ...
4 years, 2 months ago (2016-10-06 21:36:12 UTC) #13
michaelpg
Usage added. https://codereview.chromium.org/2391073005/diff/40001/content/public/browser/web_ui_data_source.h File content/public/browser/web_ui_data_source.h (right): https://codereview.chromium.org/2391073005/diff/40001/content/public/browser/web_ui_data_source.h#newcode55 content/public/browser/web_ui_data_source.h:55: virtual void AddInteger(const std::string& name, int32_t value) ...
4 years, 2 months ago (2016-10-06 23:58:37 UTC) #14
Charlie Reis
Thanks! LGTM.
4 years, 2 months ago (2016-10-07 05:17:22 UTC) #15
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/2391073005/60001
4 years, 2 months ago (2016-10-07 07:54:19 UTC) #22
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 2 months ago (2016-10-07 07:58:48 UTC) #24
commit-bot: I haz the power
4 years, 2 months ago (2016-10-07 08:00:41 UTC) #26
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/408b01b6f8b766facfc02fcbcb2226d2e3b98be0
Cr-Commit-Position: refs/heads/master@{#423816}

Powered by Google App Engine
This is Rietveld 408576698