diff options
author | brettw <brettw@chromium.org> | 2015-08-14 12:53:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-14 19:54:24 +0000 |
commit | c75a83086d18e65c09baad46c35c732b00c72999 (patch) | |
tree | 5fd58c52000396a4d5e6659ac18208abc417f9e0 /chrome/installer/setup | |
parent | 2a64040131d38a5455f62df534dedddbcff1cae1 (diff) | |
download | chromium_src-c75a83086d18e65c09baad46c35c732b00c72999.zip chromium_src-c75a83086d18e65c09baad46c35c732b00c72999.tar.gz chromium_src-c75a83086d18e65c09baad46c35c732b00c72999.tar.bz2 |
Add GN targets for "setup" and "mini_installer".
These compile but need more verification before we can call them 100% complete (this is bug 520289).
This fixes the size_t conversion warnings in these targets and removes the warning suppression from the GYP build.
Review URL: https://codereview.chromium.org/1288223002
Cr-Commit-Position: refs/heads/master@{#343464}
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r-- | chrome/installer/setup/BUILD.gn | 87 | ||||
-rw-r--r-- | chrome/installer/setup/setup_util.cc | 3 | ||||
-rw-r--r-- | chrome/installer/setup/setup_util_unittest.cc | 2 |
3 files changed, 55 insertions, 37 deletions
diff --git a/chrome/installer/setup/BUILD.gn b/chrome/installer/setup/BUILD.gn index 08f5e4c..bff865f 100644 --- a/chrome/installer/setup/BUILD.gn +++ b/chrome/installer/setup/BUILD.gn @@ -5,60 +5,77 @@ import("//testing/test.gni") if (is_win) { + executable("setup") { + sources = [ + "setup.ico", + "setup.rc", + "setup_exe_version.rc.version", + "setup_main.cc", + "setup_main.h", + "setup_resource.h", + "uninstall.cc", + "uninstall.h", + ] + + configs -= [ "//build/config/win:console" ] + configs += [ "//build/config/win:windowed" ] + + deps = [ + ":lib", + ] + } + + source_set("lib") { + sources = [ + "app_launcher_installer.cc", + "app_launcher_installer.h", + "archive_patch_helper.cc", + "archive_patch_helper.h", + "install.cc", + "install.h", + "install_worker.cc", + "install_worker.h", + "setup_constants.cc", + "setup_constants.h", + "setup_util.cc", + "setup_util.h", + "update_active_setup_version_work_item.cc", + "update_active_setup_version_work_item.h", + ] + + public_deps = [ + "//base", + "//breakpad:breakpad_handler", + "//chrome/common:constants", + "//chrome/installer/util", + "//chrome_elf:constants", + "//rlz:rlz_lib", + "//third_party/zlib", + ] + } + + # This test covers the mini installer and setup tests. test("setup_unittests") { - # TODO(robertshield): Move the items marked with "Move to lib" - # below into a separate lib and then link both setup.exe and - # setup_unittests.exe against that. sources = [ - "../mini_installer/appid.h", - "../mini_installer/chrome.release", # Move to lib - "../mini_installer/chrome_appid.cc", - "../mini_installer/configuration.cc", - "../mini_installer/configuration.h", - "../mini_installer/configuration_test.cc", - "../mini_installer/decompress.cc", - "../mini_installer/decompress.h", - "../mini_installer/decompress_test.cc", - "../mini_installer/mini_installer_constants.cc", - "../mini_installer/mini_installer_constants.h", - "../mini_installer/mini_string.cc", - "../mini_installer/mini_string.h", - "../mini_installer/mini_string_test.cc", - "../mini_installer/regkey.cc", - "../mini_installer/regkey.h", - "app_launcher_installer.cc", # Move to lib - "app_launcher_installer.h", # Move to lib - "archive_patch_helper.cc", # Move to lib - "archive_patch_helper.h", # Move to lib "archive_patch_helper_unittest.cc", - "install.cc", # Move to lib - "install.h", # Move to lib "install_unittest.cc", - "install_worker.cc", # Move to lib - "install_worker.h", # Move to lib "install_worker_unittest.cc", "run_all_unittests.cc", - "setup_constants.cc", # Move to lib - "setup_constants.h", # Move to lib - "setup_util.cc", "setup_util_unittest.cc", "setup_util_unittest.h", - "update_active_setup_version_work_item.cc", # Move to lib - "update_active_setup_version_work_item.h", # Move to lib "update_active_setup_version_work_item_unittest.cc", ] deps = [ + ":lib", "//base", "//base:i18n", "//base/test:test_support", + "//chrome/installer/mini_installer:unit_tests", "//chrome/installer/util:strings", "//chrome/installer/util:util", "//testing/gmock", "//testing/gtest", ] - - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] } } diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc index 7f0af71..0565488 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc @@ -223,7 +223,8 @@ bool DeleteFileFromTempProcess(const base::FilePath& path, // This runs before the main routine of the process runs, so it doesn't // matter much which executable we choose except that we don't want to // use e.g. a console app that causes a window to be created. - size = (path.value().length() + 1) * sizeof(path.value()[0]); + size = static_cast<DWORD>( + (path.value().length() + 1) * sizeof(path.value()[0])); void* mem = ::VirtualAllocEx(pi.hProcess, NULL, size, MEM_COMMIT, PAGE_READWRITE); if (mem) { diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc index 82b849f..91ab754 100644 --- a/chrome/installer/setup/setup_util_unittest.cc +++ b/chrome/installer/setup/setup_util_unittest.cc @@ -70,7 +70,7 @@ bool CurrentProcessHasPrivilege(const wchar_t* privilege_name) { // There is no point getting a buffer to store more than |privilege_name|\0 as // anything longer will obviously not be equal to |privilege_name|. - const DWORD desired_size = wcslen(privilege_name); + const DWORD desired_size = static_cast<DWORD>(wcslen(privilege_name)); const DWORD buffer_size = desired_size + 1; scoped_ptr<wchar_t[]> name_buffer(new wchar_t[buffer_size]); for (int i = privileges->PrivilegeCount - 1; i >= 0 ; --i) { |