Fix chrome_watcher logging size regression

Desktop / Chromium - Bruce Dawson [chromium.org] - 13 July 2017 16:54 EDT

When crrev.com/2850863002 added a call to InitChromeLogging() it had to pull in //chrome/common:common, and that necessarily pulls in several MB of code that is not wanted. The tendrils of dependencies are many and
varied and since a sword was disallowed there was no practical way to cut this Gordian knot. See the investigation in bug 717103 for details.

So, InitChromeLogging() was copied, named as InitChromeWatcherLogging(), and made to work. This gets the size-cost of the logging code down to ~25 KB.

A non_code_constants target was added to //chrome/common because the existing constants target was actually the main cause of excess code being pulled in.

While testing this change it was discovered that the command-line logging flags were not passed to the chrome_watcher process, so that logging was not actually being enabled. This was also fixed.

It may be possible to delete more of the copied code, depending on what logging features are actually needed. Thoughts?

Bug: 717103, 715060 Change-Id: I536b0813fff32e513dfd3e0bbb8fc3cb715546c1 Reviewed-on: https://chromium-review.googlesource.com/567030

5c9466e Fix chrome_watcher logging size regression
chrome/app/chrome_watcher_command_line_win.cc | 11 +-
chrome/chrome_watcher/BUILD.gn | 3 +-
chrome/chrome_watcher/chrome_watcher_main.cc | 202 +++++++++++++++++++++++++-
chrome/common/BUILD.gn | 21 ++-
4 files changed, 228 insertions(+), 9 deletions(-)

Upstream: git.chromium.org


  • Share