Skip to content

Commit

Permalink
[Zucchini] Move Zucchini from /chrome/installer/ to /components/.
Browse files Browse the repository at this point in the history
(Use "git log --follow" to see older revisions of files).

/components/ is the most logical place to put Zucchini, which only
depends on /base and /testing/gtest. This move also enables Zucchini to
be used by the Component Updater. Details:
- Move all files; run the following to change deps and guards:
  sed 's/chrome\/installer/components/' *.cc *.h -i
  sed 's/CHROME_INSTALLER/COMPONENTS/' *.cc *.h -i
  - Sorting works out pretty well!
- Change all 'chrome/installer/zucchini' to 'components/zucchini'
  throughout other parts of the repo; sort if necessary.
- Fix 6 'git cl lint' errors.
- Change 1 Bind() usage to BindRepeated().
- Update OWNER.

Bug: 729154
Change-Id: I50c5a7d411ea85f707b5994ab319dfb2a1acccf7
Reviewed-on: https://chromium-review.googlesource.com/954923
Reviewed-by: Greg Thompson <grt@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Samuel Huang <huangs@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542857}
  • Loading branch information
samuelhuang authored and Commit Bot committed Mar 13, 2018
1 parent 7b33f6f commit 577ef6c
Show file tree
Hide file tree
Showing 130 changed files with 410 additions and 398 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ vs-chromium-project.txt
/chrome/installer/mini_installer/support
/chrome/installer/mini_installer_syzygy.xml
/chrome/installer/mini_installer_tests_run.xml
/chrome/installer/zucchini/testdata/*.exe
/chrome/installer_util_strings.xml
/chrome/interactive_ui_tests_run.xml
/chrome/setup.xml
Expand Down Expand Up @@ -170,6 +169,7 @@ vs-chromium-project.txt
/components/search_engines/prepopulated_engines.xml
/components/suggestions.xml
/components/variations.xml
/components/zucchini/testdata/*.exe
/content/browser/service_worker/proto.xml
/content/content_browsertests_run.xml
/content/content_common_mojo_bindings.xml
Expand Down
8 changes: 4 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ group("gn_all") {
deps += [
"//chrome",
"//chrome/browser/resources/media_router/extension:all",
"//chrome/installer/zucchini:zucchini",
"//chrome/installer/zucchini:zucchini_unittests",
"//chrome/test:browser_tests",
"//chrome/test:interactive_ui_tests",
"//chrome/test:sync_integration_tests",
"//chrome/test/chromedriver:chromedriver_unittests",
"//components/sync/tools:sync_client",
"//components/sync/tools:sync_listen_notifications",
"//components/zucchini:zucchini",
"//components/zucchini:zucchini_unittests",
"//gpu/gles2_conform_support:gles2_conform_test",
"//gpu/khronos_glcts_support:khronos_glcts_test",
"//jingle:jingle_unittests",
Expand Down Expand Up @@ -563,13 +563,13 @@ group("gn_all") {
"//chrome/install_static:install_static_unittests",
"//chrome/installer/gcapi",
"//chrome/installer/setup:setup_unittests",
"//chrome/installer/zucchini",
"//chrome/tools/build/win/syzygy:chrome_dll_syzygy",
"//chrome_elf:chrome_elf_import_unittests",
"//chrome_elf:chrome_elf_unittests",
"//chrome_elf:dll_hash_main",
"//cloud_print:cloud_print_unittests",
"//components/wifi:wifi_test",
"//components/zucchini",
"//net:quic_client",
"//net:quic_server",
"//notification_helper:notification_helper_unittests",
Expand Down Expand Up @@ -762,10 +762,10 @@ if (is_win) {
"//chrome/common/win:eventlog_provider",
"//chrome/installer/gcapi",
"//chrome/installer/mini_installer",
"//chrome/installer/zucchini",
"//cloud_print",
"//cloud_print/virtual_driver/win/port_monitor:copy_gcp_portmon_binaries",
"//components/policy:pack_policy_templates",
"//components/zucchini",
"//courgette",
"//courgette:copy_courgette_binaries",
"//remoting/webapp",
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ hooks = [
'--no_auth',
'--num_threads=4',
'--bucket', 'chromium-binary-patching',
'-d', 'src/chrome/installer/zucchini/testdata',
'-d', 'src/components/zucchini/testdata',
],
},

Expand Down
2 changes: 1 addition & 1 deletion PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,6 @@ def _CheckSpamLogging(input_api, output_api):
r"^chrome[\\\/]browser[\\\/]ui[\\\/]startup[\\\/]"
r"startup_browser_creator\.cc$",
r"^chrome[\\\/]installer[\\\/]setup[\\\/].*",
r"^chrome[\\\/]installer[\\\/]zucchini[\\\/].*",
r"chrome[\\\/]browser[\\\/]diagnostics[\\\/]" +
r"diagnostics_writer\.cc$",
r"^chrome_elf[\\\/]dll_hash[\\\/]dll_hash_main\.cc$",
Expand All @@ -1334,6 +1333,7 @@ def _CheckSpamLogging(input_api, output_api):
r"dump_stability_report_main_win.cc$",
r"^components[\\\/]html_viewer[\\\/]"
r"web_test_delegate_impl\.cc$",
r"^components[\\\/]zucchini[\\\/].*",
# TODO(peter): Remove this exception. https://crbug.com/534537
r"^content[\\\/]browser[\\\/]notifications[\\\/]"
r"notification_event_dispatcher_impl\.cc$",
Expand Down
3 changes: 2 additions & 1 deletion WATCHLISTS
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,8 @@
},
'installer_win': {
'filepath': 'chrome/install_static/'\
'|chrome/installer/(?!gcapi_mac/|linux/|mac/)',
'|chrome/installer/(?!gcapi_mac/|linux/|mac/)'\
'|components/zucchini/',
},
'instant': {
'filepath': 'instant|searchbox|'\
Expand Down
4 changes: 2 additions & 2 deletions chrome/installer/setup/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ if (is_win) {
"//chrome/common:version_header",
"//chrome/install_static:install_static_util",
"//chrome/installer/util:with_rc_strings",
"//chrome/installer/zucchini:zucchini_io",
"//chrome/installer/zucchini:zucchini_lib",
"//chrome_elf:constants",
"//components/base32",
"//components/crash/content/app",
"//components/crash/core/common",
"//components/zucchini:zucchini_io",
"//components/zucchini:zucchini_lib",
"//content/public/common:static_switches",
"//courgette:courgette_lib",
"//rlz:rlz_lib",
Expand Down
2 changes: 1 addition & 1 deletion chrome/installer/setup/DEPS
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include_rules = [
"+chrome_elf/chrome_elf_constants.h",
"+chrome/installer/zucchini",
"+chrome/install_static",
"+components/base32",
"+components/zucchini",
"+courgette",
]

Expand Down
4 changes: 2 additions & 2 deletions chrome/installer/setup/archive_patch_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "base/logging.h"
#include "chrome/installer/setup/buildflags.h"
#include "chrome/installer/util/lzma_util.h"
#include "chrome/installer/zucchini/zucchini.h"
#include "chrome/installer/zucchini/zucchini_integration.h"
#include "components/zucchini/zucchini.h"
#include "components/zucchini/zucchini_integration.h"
#include "courgette/courgette.h"
#include "third_party/bspatch/mbspatch.h"

Expand Down
2 changes: 1 addition & 1 deletion chrome/installer/setup/buildflags.gni
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

declare_args() {
# Specify if the Zucchini patcher features should be included in setup.exe.
# See //chrome/installer/zucchini for more information.
# See //components/zucchini for more information.
use_zucchini = false
}
4 changes: 2 additions & 2 deletions chrome/installer/setup/setup_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
#include "chrome/installer/util/non_updating_app_registration_data.h"
#include "chrome/installer/util/updating_app_registration_data.h"
#include "chrome/installer/util/util_constants.h"
#include "chrome/installer/zucchini/zucchini.h"
#include "chrome/installer/zucchini/zucchini_integration.h"
#include "components/zucchini/zucchini.h"
#include "components/zucchini/zucchini_integration.h"
#include "courgette/courgette.h"
#include "courgette/third_party/bsdiff/bsdiff.h"

Expand Down
2 changes: 1 addition & 1 deletion chrome/installer/setup/setup_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int BsdiffPatchFiles(const base::FilePath& src,

// Applies a patch file to source file using Zucchini. Returns 0 in case of
// success. In case of errors, it returns kZucchiniErrorOffset + a Zucchini
// status code, as defined in chrome/installer/zucchini/zucchini.h
// status code, as defined in components/zucchini/zucchini.h
int ZucchiniPatchFiles(const base::FilePath& src,
const base::FilePath& patch,
const base::FilePath& dest);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
huangs@chromium.org
grt@chromium.org
wfh@chromium.org

# COMPONENT: Internals>Installer>Diff
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/abs32_utils.h"
#include "components/zucchini/abs32_utils.h"

#include <algorithm>
#include <type_traits>
#include <utility>

#include "base/logging.h"
#include "chrome/installer/zucchini/io_utils.h"
#include "components/zucchini/io_utils.h"

namespace zucchini {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_INSTALLER_ZUCCHINI_ABS32_UTILS_H_
#define CHROME_INSTALLER_ZUCCHINI_ABS32_UTILS_H_
#ifndef COMPONENTS_ZUCCHINI_ABS32_UTILS_H_
#define COMPONENTS_ZUCCHINI_ABS32_UTILS_H_

#include <stddef.h>
#include <stdint.h>
Expand All @@ -12,9 +12,9 @@

#include "base/macros.h"
#include "base/optional.h"
#include "chrome/installer/zucchini/address_translator.h"
#include "chrome/installer/zucchini/buffer_view.h"
#include "chrome/installer/zucchini/image_utils.h"
#include "components/zucchini/address_translator.h"
#include "components/zucchini/buffer_view.h"
#include "components/zucchini/image_utils.h"

namespace zucchini {

Expand Down Expand Up @@ -134,4 +134,4 @@ size_t RemoveOverlappingAbs32Locations(Bitness bitness,

} // namespace zucchini

#endif // CHROME_INSTALLER_ZUCCHINI_ABS32_UTILS_H_
#endif // COMPONENTS_ZUCCHINI_ABS32_UTILS_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/abs32_utils.h"
#include "components/zucchini/abs32_utils.h"

#include <stdint.h>

Expand All @@ -11,8 +11,8 @@
#include <utility>

#include "base/numerics/safe_conversions.h"
#include "chrome/installer/zucchini/image_utils.h"
#include "chrome/installer/zucchini/test_utils.h"
#include "components/zucchini/image_utils.h"
#include "components/zucchini/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace zucchini {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/address_translator.h"
#include "components/zucchini/address_translator.h"

#include <algorithm>
#include <utility>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_INSTALLER_ZUCCHINI_ADDRESS_TRANSLATOR_H_
#define CHROME_INSTALLER_ZUCCHINI_ADDRESS_TRANSLATOR_H_
#ifndef COMPONENTS_ZUCCHINI_ADDRESS_TRANSLATOR_H_
#define COMPONENTS_ZUCCHINI_ADDRESS_TRANSLATOR_H_

#include <stdint.h>

#include <tuple>
#include <vector>

#include "base/macros.h"
#include "chrome/installer/zucchini/algorithm.h"
#include "chrome/installer/zucchini/image_utils.h"
#include "components/zucchini/algorithm.h"
#include "components/zucchini/image_utils.h"

namespace zucchini {

Expand Down Expand Up @@ -195,4 +195,4 @@ class AddressTranslator {

} // namespace zucchini

#endif // CHROME_INSTALLER_ZUCCHINI_ADDRESS_TRANSLATOR_H_
#endif // COMPONENTS_ZUCCHINI_ADDRESS_TRANSLATOR_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/address_translator.h"
#include "components/zucchini/address_translator.h"

#include <algorithm>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_INSTALLER_ZUCCHINI_ALGORITHM_H_
#define CHROME_INSTALLER_ZUCCHINI_ALGORITHM_H_
#ifndef COMPONENTS_ZUCCHINI_ALGORITHM_H_
#define COMPONENTS_ZUCCHINI_ALGORITHM_H_

#include <stddef.h>

Expand Down Expand Up @@ -81,4 +81,4 @@ constexpr T SignExtend(T v) {

} // namespace zucchini

#endif // CHROME_INSTALLER_ZUCCHINI_ALGORITHM_H_
#endif // COMPONENTS_ZUCCHINI_ALGORITHM_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/algorithm.h"
#include "components/zucchini/algorithm.h"

#include <stddef.h>
#include <stdint.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/binary_data_histogram.h"
#include "components/zucchini/binary_data_histogram.h"

#include <algorithm>
#include <cmath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_INSTALLER_ZUCCHINI_BINARY_DATA_HISTOGRAM_H_
#define CHROME_INSTALLER_ZUCCHINI_BINARY_DATA_HISTOGRAM_H_
#ifndef COMPONENTS_ZUCCHINI_BINARY_DATA_HISTOGRAM_H_
#define COMPONENTS_ZUCCHINI_BINARY_DATA_HISTOGRAM_H_

#include <stddef.h>
#include <stdint.h>
Expand All @@ -12,7 +12,7 @@
#include <string>

#include "base/macros.h"
#include "chrome/installer/zucchini/buffer_view.h"
#include "components/zucchini/buffer_view.h"

namespace zucchini {

Expand Down Expand Up @@ -88,4 +88,4 @@ class BinaryDataHistogram {

} // namespace zucchini

#endif // CHROME_INSTALLER_ZUCCHINI_BINARY_DATA_HISTOGRAM_H_
#endif // COMPONENTS_ZUCCHINI_BINARY_DATA_HISTOGRAM_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/binary_data_histogram.h"
#include "components/zucchini/binary_data_histogram.h"

#include <stddef.h>

#include <memory>
#include <vector>

#include "chrome/installer/zucchini/buffer_view.h"
#include "components/zucchini/buffer_view.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace zucchini {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/buffer_sink.h"
#include "components/zucchini/buffer_sink.h"

namespace zucchini {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_INSTALLER_ZUCCHINI_BUFFER_SINK_H_
#define CHROME_INSTALLER_ZUCCHINI_BUFFER_SINK_H_
#ifndef COMPONENTS_ZUCCHINI_BUFFER_SINK_H_
#define COMPONENTS_ZUCCHINI_BUFFER_SINK_H_

#include <stdint.h>

#include <algorithm>
#include <iterator>

#include "base/logging.h"
#include "chrome/installer/zucchini/buffer_view.h"
#include "components/zucchini/buffer_view.h"

namespace zucchini {

Expand Down Expand Up @@ -65,4 +65,4 @@ class BufferSink : public MutableBufferView {

} // namespace zucchini

#endif // CHROME_INSTALLER_ZUCCHINI_BUFFER_SINK_H_
#endif // COMPONENTS_ZUCCHINI_BUFFER_SINK_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/installer/zucchini/buffer_sink.h"
#include "components/zucchini/buffer_sink.h"

#include <stddef.h>
#include <stdint.h>
Expand Down
Loading

0 comments on commit 577ef6c

Please sign in to comment.