Skip to content

Commit

Permalink
Revert of [Courgette] Adding CourgetteConfig singleton and --experime…
Browse files Browse the repository at this point in the history
…ntal flag. (patchset Pissandshittium#5 id:80001 of https://chromiumcodereview.appspot.com/1306193004/ )

Reason for revert:
The original CL assumes Courgette had to deal with forward/backward compatibility issues.
Turns out that (as seen in http://crbug.com/459505):
- Courgette executable is shipped with new releases.
- This allows Courgette workflow to proceed without being tied down to legacy.

These new (to huangs@) facts render the original CL redundant.

Original issue's description:
> [Courgette] Adding CourgetteConfig singleton and --experimental flag.
>
> This prepare for upcoming experiments to reduce patch size. We want to
> avoid disrupting existing functionality.
>
> Committed: https://crrev.com/fc0511d9067759336f42d04e918e8a3ce0b84376
> Cr-Commit-Position: refs/heads/master@{#346746}

TBR=wfh@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1323263007

Cr-Commit-Position: refs/heads/master@{#347746}
  • Loading branch information
samuelhuang authored and Commit bot committed Sep 8, 2015
1 parent 6cc5dbb commit 558063b
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 93 deletions.
2 changes: 0 additions & 2 deletions courgette/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ static_library("courgette_lib") {
"assembly_program.cc",
"assembly_program.h",
"courgette.h",
"courgette_config.cc",
"courgette_config.h",
"crc.cc",
"crc.h",
"difference_estimator.cc",
Expand Down
2 changes: 0 additions & 2 deletions courgette/courgette.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
'assembly_program.cc',
'assembly_program.h',
'courgette.h',
'courgette_config.cc',
'courgette_config.h',
'crc.cc',
'crc.h',
'difference_estimator.cc',
Expand Down
34 changes: 0 additions & 34 deletions courgette/courgette_config.cc

This file was deleted.

39 changes: 0 additions & 39 deletions courgette/courgette_config.h

This file was deleted.

6 changes: 0 additions & 6 deletions courgette/courgette_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "courgette/courgette.h"
#include "courgette/courgette_config.h"
#include "courgette/streams.h"
#include "courgette/third_party/bsdiff.h"

Expand Down Expand Up @@ -430,7 +429,6 @@ int main(int argc, const char* argv[]) {
base::CommandLine::Init(argc, argv);
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
courgette::CourgetteConfig::GetInstance()->Initialize(command_line);

logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_ALL;
Expand Down Expand Up @@ -472,10 +470,6 @@ int main(int argc, const char* argv[]) {
" -supported -asm, -dis, -disadj, -gen or -apply, -genbsdiff"
" or -applybsdiff.");

if (courgette::CourgetteConfig::GetInstance()->is_experimental()) {
fprintf(stderr, "Experimental flag enabled. Do not use in production.\n");
}

while (repeat_count-- > 0) {
if (cmd_sup) {
if (values.size() != 1)
Expand Down
7 changes: 2 additions & 5 deletions courgette/ensemble_apply.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/files/file_util.h"
#include "base/files/memory_mapped_file.h"
#include "base/logging.h"
#include "courgette/courgette_config.h"
#include "courgette/crc.h"
#include "courgette/patcher_x86_32.h"
#include "courgette/region.h"
Expand Down Expand Up @@ -97,9 +96,7 @@ Status EnsemblePatchApplication::ReadHeader(SourceStream* header_stream) {
if (!header_stream->ReadVarint32(&version))
return C_BAD_ENSEMBLE_VERSION;

uint32 expected_ensemble_version =
CourgetteConfig::GetInstance()->ensemble_version();
if (version != expected_ensemble_version)
if (version != CourgettePatchFile::kVersion)
return C_BAD_ENSEMBLE_VERSION;

if (!header_stream->ReadVarint32(&source_checksum_))
Expand Down Expand Up @@ -429,4 +426,4 @@ Status ApplyEnsemblePatch(const base::FilePath::CharType* old_file_name,
return C_OK;
}

} // namespace courgette
} // namespace
7 changes: 2 additions & 5 deletions courgette/ensemble_create.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "base/logging.h"
#include "base/time/time.h"

#include "courgette/courgette_config.h"
#include "courgette/crc.h"
#include "courgette/difference_estimator.h"
#include "courgette/region.h"
Expand Down Expand Up @@ -436,10 +435,8 @@ Status GenerateEnsemblePatch(SourceStream* base,
//
// Final output stream has a header followed by a StreamSet.
//
uint32 ensemble_version =
CourgetteConfig::GetInstance()->ensemble_version();
if (!final_patch->WriteVarint32(CourgettePatchFile::kMagic) ||
!final_patch->WriteVarint32(ensemble_version) ||
!final_patch->WriteVarint32(CourgettePatchFile::kVersion) ||
!final_patch->WriteVarint32(CalculateCrc(old_region.start(),
old_region.length())) ||
!final_patch->WriteVarint32(CalculateCrc(new_region.start(),
Expand All @@ -455,4 +452,4 @@ Status GenerateEnsemblePatch(SourceStream* base,
return C_OK;
}

} // namespace courgette
} // namespace

0 comments on commit 558063b

Please sign in to comment.