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

Issue 2662803002: Chromium doesn't compile with -Wglobal-constructors (Closed)

Created:
3 years, 10 months ago by ckulakowski
Modified:
3 years, 10 months ago
CC:
chromium-reviews, csharrison+watch_chromium.org, loading-reviews+metrics_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Chromium doesn't compile with -Wglobal-constructors We compile chromium with clang flag -Wglobal-constructors in our project. We have following compilation error during compilation of user_input_tracker.cc: ../../chrome/browser/page_load_metrics/user_input_tracker.cc:27:11: error: declaration requires a global constructor [-Werror,-Wglobal-constructors] const int kRateLimitClampMillis = (kOldestAllowedEventAgeSeconds * 1000) / In order to get rid of this global constructor I recommend to declare static class variable UserInputTracker::kMaxTrackedEvents and global variable kRateLimitClampMillis as constexpr which will be expanded to numerical value during compilation. BUG=686669 Review-Url: https://codereview.chromium.org/2662803002 Cr-Commit-Position: refs/heads/master@{#447000} Committed: https://chromium.googlesource.com/chromium/src/+/656950c2f6ebeae22139d9753eca81f213c74b53

Patch Set 1 #

Total comments: 2

Patch Set 2 : Change for request from review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -5 lines) Patch
M chrome/browser/page_load_metrics/user_input_tracker.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/page_load_metrics/user_input_tracker.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 12 (7 generated)
ckulakowski
3 years, 10 months ago (2017-01-30 11:08:52 UTC) #3
Charlie Harrison
drive-by lgtm https://codereview.chromium.org/2662803002/diff/1/chrome/browser/page_load_metrics/user_input_tracker.cc File chrome/browser/page_load_metrics/user_input_tracker.cc (right): https://codereview.chromium.org/2662803002/diff/1/chrome/browser/page_load_metrics/user_input_tracker.cc#newcode66 chrome/browser/page_load_metrics/user_input_tracker.cc:66: constexpr size_t UserInputTracker::kMaxTrackedEvents; Can you move this ...
3 years, 10 months ago (2017-01-30 14:17:51 UTC) #5
ckulakowski
https://codereview.chromium.org/2662803002/diff/1/chrome/browser/page_load_metrics/user_input_tracker.cc File chrome/browser/page_load_metrics/user_input_tracker.cc (right): https://codereview.chromium.org/2662803002/diff/1/chrome/browser/page_load_metrics/user_input_tracker.cc#newcode66 chrome/browser/page_load_metrics/user_input_tracker.cc:66: constexpr size_t UserInputTracker::kMaxTrackedEvents; On 2017/01/30 14:17:51, Charlie Harrison wrote: ...
3 years, 10 months ago (2017-01-30 15:46:56 UTC) #6
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/2662803002/20001
3 years, 10 months ago (2017-01-30 15:48:56 UTC) #9
commit-bot: I haz the power
3 years, 10 months ago (2017-01-30 16:43:30 UTC) #12
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/656950c2f6ebeae22139d9753eca...

Powered by Google App Engine
This is Rietveld 408576698