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

Issue 1560027: Refactor FileVersionInfo into an interface with platform implementations. (Closed)

Created:
10 years, 8 months ago by tony
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Refactor FileVersionInfo into an interface with platform implementations. This allows us to move the chrome specific version informaton used by Linux into src/chrome. Add a GetChromeVersionInfo() for Linux in src/chrome/app/ and make sure to use this in src/chrome. In src/webkit/glue, add a new glue method for getting the product version. When compiling chrome, use an implementation in src/chrome/renderer (which uses GetChromeVersionInfo()) and a stub implementation for test_shell. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=44435

Patch Set 1 #

Patch Set 2 : win compile fix #

Patch Set 3 : passing #

Total comments: 20

Patch Set 4 : comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+434 lines, -317 lines) Patch
M base/base.gyp View 1 chunk +0 lines, -59 lines 0 comments Download
M base/base.gypi View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M base/file_version_info.h View 1 2 3 2 chunks +20 lines, -63 lines 0 comments Download
M base/file_version_info_linux.cc View 1 2 3 1 chunk +0 lines, -86 lines 0 comments Download
A base/file_version_info_mac.h View 1 chunk +63 lines, -0 lines 0 comments Download
M base/file_version_info_mac.mm View 1 2 3 6 chunks +25 lines, -24 lines 0 comments Download
M base/file_version_info_unittest.cc View 1 5 chunks +18 lines, -12 lines 0 comments Download
A base/file_version_info_win.h View 1 chunk +67 lines, -0 lines 0 comments Download
A + base/file_version_info_win.cc View 5 chunks +26 lines, -24 lines 0 comments Download
A chrome/app/chrome_version_info.h View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
A chrome/app/chrome_version_info.cc View 1 2 3 1 chunk +52 lines, -0 lines 0 comments Download
A + chrome/app/chrome_version_info_posix.h.version View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/automation/automation_provider.cc View 1 2 3 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/browser_about_handler.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/bug_report_util.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/diagnostics/recon_diagnostics.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_updater.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/gtk/about_chrome_dialog.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/memory_details_mac.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/memory_details_win.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/metrics/metrics_log.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/protocol_manager.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/views/about_chrome_view.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/views/bug_report_view.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/chrome.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 2 chunks +1 line, -1 line 0 comments Download
M chrome/chrome_exe.gypi View 2 chunks +63 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/renderer/renderer_glue.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/test/automation/automation_proxy.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/test/reliability/page_load_test.cc View 1 2 3 2 chunks +5 lines, -3 lines 0 comments Download
M chrome_frame/chrome_frame.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M chrome_frame/test/util_unittests.cc View 2 chunks +4 lines, -1 line 0 comments Download
M webkit/glue/plugins/plugin_lib_win.cc View 2 chunks +6 lines, -3 lines 0 comments Download
M webkit/glue/webkit_glue.h View 1 chunk +3 lines, -0 lines 0 comments Download
M webkit/glue/webkit_glue.cc View 1 2 2 chunks +3 lines, -15 lines 0 comments Download
M webkit/glue/webkit_glue.gypi View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M webkit/tools/test_shell/test_shell.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
tony
10 years, 8 months ago (2010-04-13 02:39:20 UTC) #1
Evan Martin
LGTM http://codereview.chromium.org/1560027/diff/7001/8002 File base/base.gypi (right): http://codereview.chromium.org/1560027/diff/7001/8002#newcode305 base/base.gypi:305: }, { # flesh out comment? http://codereview.chromium.org/1560027/diff/7001/8003 File ...
10 years, 8 months ago (2010-04-13 03:59:20 UTC) #2
tony
10 years, 8 months ago (2010-04-13 05:28:03 UTC) #3
http://codereview.chromium.org/1560027/diff/7001/8002
File base/base.gypi (right):

http://codereview.chromium.org/1560027/diff/7001/8002#newcode305
base/base.gypi:305: }, { #
On 2010/04/13 03:59:20, Evan Martin wrote:
> flesh out comment?

Meh, just removed the file.

http://codereview.chromium.org/1560027/diff/7001/8003
File base/file_version_info.h (right):

http://codereview.chromium.org/1560027/diff/7001/8003#newcode14
base/file_version_info.h:14: // Provides an interface for to accessing the
version information for a file.
On 2010/04/13 03:59:20, Evan Martin wrote:
> typo: "for to"

Done.

http://codereview.chromium.org/1560027/diff/7001/8004
File base/file_version_info_linux.cc (right):

http://codereview.chromium.org/1560027/diff/7001/8004#newcode11
base/file_version_info_linux.cc:11: class FileVersionInfoLinux : public
FileVersionInfo {
On 2010/04/13 03:59:20, Evan Martin wrote:
> You ifdef FileVersionInfo for Linux in the header; why do you need this?

You're right!  Deleted this file.

http://codereview.chromium.org/1560027/diff/7001/8006
File base/file_version_info_mac.mm (right):

http://codereview.chromium.org/1560027/diff/7001/8006#newcode114
base/file_version_info_mac.mm:114: bool FileVersionInfoMac::GetValue(const
wchar_t* name, std::wstring* value_str) {
On 2010/04/13 03:59:20, Evan Martin wrote:
> 80

Done.

http://codereview.chromium.org/1560027/diff/7001/8010
File chrome/app/chrome_version_info.cc (right):

http://codereview.chromium.org/1560027/diff/7001/8010#newcode14
chrome/app/chrome_version_info.cc:14: class ChromeVersionInfoPosix : public
FileVersionInfo {
On 2010/04/13 03:59:20, Evan Martin wrote:
> doc this (e.g. "all our info comes from the above header"

Done.

http://codereview.chromium.org/1560027/diff/7001/8011
File chrome/app/chrome_version_info.h (right):

http://codereview.chromium.org/1560027/diff/7001/8011#newcode12
chrome/app/chrome_version_info.h:12: // Creates a FileVersionInfo for Chrome.
Returns NULL in case of error. The
On 2010/04/13 03:59:20, Evan Martin wrote:
> s/Chrome/something like "Chrome, as in the binary we're trying to build here"
or
> something/

Re-worded a bit.

http://codereview.chromium.org/1560027/diff/7001/8013
File chrome/browser/automation/automation_provider.cc (right):

http://codereview.chromium.org/1560027/diff/7001/8013#newcode191
chrome/browser/automation/automation_provider.cc:191:
scoped_ptr<FileVersionInfo> file_version_info(
On 2010/04/13 03:59:20, Evan Martin wrote:
> s/file_version_info/version_info/  ?

Done.

http://codereview.chromium.org/1560027/diff/7001/8032
File chrome/test/reliability/page_load_test.cc (right):

http://codereview.chromium.org/1560027/diff/7001/8032#newcode166
chrome/test/reliability/page_load_test.cc:166:
file_info.reset(chrome_app::GetChromeVersionInfo());
On 2010/04/13 03:59:20, Evan Martin wrote:
> Is the comment above this still correct?  I guess so, huh.
> I wonder if they ever filed a bug.

I updated the comment so it only refers to mac.

http://codereview.chromium.org/1560027/diff/7001/8034
File chrome_frame/test/util_unittests.cc (right):

http://codereview.chromium.org/1560027/diff/7001/8034#newcode32
chrome_frame/test/util_unittests.cc:32:
static_cast<FileVersionInfoWin*>(base_info.get());
On 2010/04/13 03:59:20, Evan Martin wrote:
> I wonder if you'd have been better off with just concrete definitions of
> FileVersionInfo rather than this subclassing business.

That's how it was before, but there were lots of extra #ifs in the header file
(and lots of stuff just not implemented on linux).  This at least makes it
obvious what features are OS specific.

http://codereview.chromium.org/1560027/diff/7001/8039
File webkit/tools/test_shell/test_shell.cc (right):

http://codereview.chromium.org/1560027/diff/7001/8039#newcode805
webkit/tools/test_shell/test_shell.cc:805: return std::string("Chrome/0.0.0.0");
On 2010/04/13 03:59:20, Evan Martin wrote:
> Maybe better to use an identifiable string like "TestShell/1.2.3.4" in case it
> ever shows up in test output (?).

I considered changing it to TestShell, but I'm worried about regressions in
layout tests :(

Powered by Google App Engine
This is Rietveld 408576698