chromium/src/courgette.git
6 days agoCleanup: Remove unneeded base/file_util.h includes in chrome_frame, courgette, ipc... master
thestig@chromium.org [Thu, 16 May 2013 02:37:50 +0000 (02:37 +0000)]
Cleanup: Remove unneeded base/file_util.h includes in chrome_frame, courgette, ipc, media, and net.

Review URL: https://chromiumcodereview.appspot.com/14820034

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@200419 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 days agoMake courgette_unittests depend on TCMalloc, like every other Linux binary at Chromium.
glider@chromium.org [Wed, 15 May 2013 08:37:39 +0000 (08:37 +0000)]
Make courgette_unittests depend on TCMalloc, like every other Linux binary at Chromium.

BUG=240314,112389
TBR=tommi@chromium.org

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

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@200193 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoFinish scoped_array<T> to scoped_ptr<T[]> conversion on Linux.
dcheng@chromium.org [Tue, 9 Apr 2013 17:35:42 +0000 (17:35 +0000)]
Finish scoped_array<T> to scoped_ptr<T[]> conversion on Linux.

There are only a few instances left in the Linux build, so lumping
them all into one patch.

BUG=171111

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

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@193134 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoRewrite std::string("") to std::string(), Linux edition.
dcheng@chromium.org [Tue, 9 Apr 2013 08:46:45 +0000 (08:46 +0000)]
Rewrite std::string("") to std::string(), Linux edition.

This patch was generated by running the empty_string clang tool
across the Chromium Linux compilation database. Implicitly or
explicitly constructing std::string() with a "" argument is
inefficient as the caller needs to emit extra instructions to
pass an argument, and the constructor needlessly copies a byte
into internal storage. Rewriting these instances to simply call
the default constructor appears to save ~14-18 kilobytes on an
optimized release build.

BUG=none

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193020

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

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@193040 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoRevert "Rewrite std::string("") to std::string(), Linux edition."
dcheng@chromium.org [Tue, 9 Apr 2013 06:41:12 +0000 (06:41 +0000)]
Revert "Rewrite std::string("") to std::string(), Linux edition."

This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6.

Revert "Fix build after r193020."

This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a.

Revert "Really fix build after r193020."

This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78.

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@193030 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoRewrite std::string("") to std::string(), Linux edition.
dcheng@chromium.org [Tue, 9 Apr 2013 05:45:17 +0000 (05:45 +0000)]
Rewrite std::string("") to std::string(), Linux edition.

This patch was generated by running the empty_string clang tool
across the Chromium Linux compilation database. Implicitly or
explicitly constructing std::string() with a "" argument is
inefficient as the caller needs to emit extra instructions to
pass an argument, and the constructor needlessly copies a byte
into internal storage. Rewriting these instances to simply call
the default constructor appears to save ~14-18 kilobytes on an
optimized release build.

BUG=none

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

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@193020 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

8 weeks agoifdef OS_NAME -> if defined(OS_NAME)
dbeam@chromium.org [Sat, 23 Mar 2013 19:10:54 +0000 (19:10 +0000)]
ifdef OS_NAME -> if defined(OS_NAME)
ifndef OS_NAME -> if !defined(OS_NAME)

BUG=none
TEST=no regressions

Review URL: https://chromiumcodereview.appspot.com/12545059

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@190069 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months ago[Cleanup] Remove StringPrintf from global namespace
groby@chromium.org [Mon, 18 Mar 2013 22:33:04 +0000 (22:33 +0000)]
[Cleanup] Remove StringPrintf from global namespace

use of StringPrintf now requires prefixing with base:: or a per-scope using directive

TBR'd:
abodenha: chrome/service
brettw: content, third_party, webkit
darin: base, chrome/browser, chrome/renderer
dgarret: courgette
enne: cc
fischmann: media
gbillock: sql
joi: google_apis,components
rsleevi: net, crypto
sky: chrome/test
thestig: printing, chrome/common,
tsepez: ipc
wez: remoting
yfriedman: testing/android

NOTRY=true
R=brettw@chromium.org
TBR=joi@chromium.org, rsleevi@chromium.org, enne@chromium.org, thestig@chromium.org, darin@chromium.org, abodenha@chromium.org, sky@chromium.org, dgarret@chromium.org, tsepez@chromium.org, fishman@chromium.org, wez@chromium.org, gbillock@chromium.org, yfriedman@chromium.org
BUG=

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

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@188857 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agobase: Move MemoryMappedFile out of file_util.h and into its own header file.
tfarina@chromium.org [Sun, 24 Feb 2013 21:55:45 +0000 (21:55 +0000)]
base: Move MemoryMappedFile out of file_util.h and into its own header file.

BUG=175002
TEST=base_unittests
R=brettw@chromium.org
TBR=erikwright@chromium.org,tommi@chromium.org,fischman@chromium.org,ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/12321062

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@184356 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoMove file_path.h to base/files.
brettw@chromium.org [Sun, 24 Feb 2013 05:40:52 +0000 (05:40 +0000)]
Move file_path.h to base/files.

TBR=sky

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@184344 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoDo a giant svn propset svn:eol-style LF on .cc and .h files that
jln@chromium.org [Thu, 14 Feb 2013 02:06:52 +0000 (02:06 +0000)]
Do a giant svn propset svn:eol-style LF on .cc and .h files that
lack this property.

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@182368 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoMore FilePath -> base::FilePath replacement.
brettw@chromium.org [Sun, 10 Feb 2013 19:20:14 +0000 (19:20 +0000)]
More FilePath -> base::FilePath replacement.

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

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@181655 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoMake courgette_unittests build on Win64
jschuh@chromium.org [Sun, 10 Feb 2013 00:12:55 +0000 (00:12 +0000)]
Make courgette_unittests build on Win64

Just c4267 build suppressions.

BUG=166496
BUG=167187

TBR=sra@chromium.org
R=sra@chromium.org
Review URL: https://codereview.chromium.org/12207096

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@181636 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoDisabling nacl_win64 targets when building in target_arch!=ia32 mode.
bradnelson@google.com [Mon, 21 Jan 2013 23:23:57 +0000 (23:23 +0000)]
Disabling nacl_win64 targets when building in target_arch!=ia32 mode.

When building on windows with target_arch=x64, we no longer need win32 targets
forced to be 64-bit. This gates out these targets when target_arch!=ia32.
(Prior CL dropped the minimal set to break the dependency between these targets
and the rest of the build. This eliminates them completely.)

BUG=None
TEST=None
R=jschuh@chromium.org,thestig@chromium.org
TBR=darin@chromium.org,abodenha@chromium.org,apatrick@chromium.org,sra@chromium.org,wtc@chromium.org

Review URL: https://chromiumcodereview.appspot.com/11929039

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@177959 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 months agoCoverity: Initialize member variables.
jhawkins@chromium.org [Thu, 26 Jul 2012 18:34:24 +0000 (18:34 +0000)]
Coverity: Initialize member variables.

CID_COUNT=7
CID=13432,14429,16922,101542,101734,102304,102305
BUG=none
TEST=none
R=tbreisacher
TBR=jam@chromium.org,tommi@chromium.org,ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10830021

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@148592 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

9 months agoAdd a clarifying comment to the memory layout navigation. (Inspired by Coverity CID...
gbillock@chromium.org [Wed, 25 Jul 2012 21:26:12 +0000 (21:26 +0000)]
Add a clarifying comment to the memory layout navigation. (Inspired by Coverity CID 100022)

R=tommi@chromium.org
BUG=None
TEST=None

Review URL: https://chromiumcodereview.appspot.com/10826014

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@148412 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

11 months ago[Leak fixlet] Fix leak in courgette_unittests
groby@chromium.org [Fri, 1 Jun 2012 19:24:53 +0000 (19:24 +0000)]
[Leak fixlet] Fix leak in courgette_unittests

BUG=46649
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10453106

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@140077 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

12 months agoSet svn:executable on windows executables.
maruel@chromium.org [Fri, 27 Apr 2012 19:11:54 +0000 (19:11 +0000)]
Set svn:executable on windows executables.

Remove third_party/tlslite/installers/

TBR=thestig@chromium.org
BUG=
TEST=
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/10178018

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@134316 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

14 months agoAdd owners to src/courgette so that we can lessen the need for a wildcard in src... git-svn
dpranke@chromium.org [Tue, 13 Mar 2012 01:11:27 +0000 (01:11 +0000)]
Add owners to src/courgette so that we can lessen the need for a wildcard in src/OWNERS.

R=dgarrett@chromium.org, tommi@chromium.org, sra@chromium.org
BUG=117608

Review URL: https://chromiumcodereview.appspot.com/9691008

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@126289 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

17 months agoUse a different define to decide which CRC library to use.
dgarrett@chromium.org [Thu, 1 Dec 2011 22:59:16 +0000 (22:59 +0000)]
Use a different define to decide which CRC library to use.

Change 8569018 used a #ifdef to conditionally decide which external
library to use for Crc calculation. It used OS_CHROMIUMOS to tell
if the build was targetted at Chromium OS.

However, it broke Chromium OS builds of the full Chromium tree in
some cases (heapcheck bots), and was reverted.

Since I really only want to change the library when building from
inside a custom ebuild in the Chromium OS build, it makes sense
to use a #define custom to that ebuild.

So, this change is the same as 8569018, except that is uses
COURGETTE_USE_CRC_LIB instead of OS_CHROMIUMOS.

BUG=8569018

Review URL: http://codereview.chromium.org/8763014

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@112565 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

17 months agoRevert 112083 - Try a different library for Crc32.
cbentzel@chromium.org [Wed, 30 Nov 2011 02:16:29 +0000 (02:16 +0000)]
Revert 112083 - Try a different library for Crc32.

BUG=
TEST=

Review URL: http://codereview.chromium.org/8569018

TBR=dgarrett@chromium.org
Review URL: http://codereview.chromium.org/8742002

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@112104 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

17 months agoTry a different library for Crc32.
dgarrett@chromium.org [Wed, 30 Nov 2011 00:45:26 +0000 (00:45 +0000)]
Try a different library for Crc32.

BUG=
TEST=

Review URL: http://codereview.chromium.org/8569018

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@112083 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoAdd -supported command line option to describe if a given file is supported
dgarrett@chromium.org [Mon, 21 Nov 2011 20:26:56 +0000 (20:26 +0000)]
Add -supported command line option to describe if a given file is supported
and what type of executable it is, if it is.

BUG=None
TEST=None

Review URL: http://codereview.chromium.org/8558009

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@110993 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoSwitching all wstrings in courgette_tool to FilePaths.
dgarrett@chromium.org [Fri, 18 Nov 2011 00:21:32 +0000 (00:21 +0000)]
Switching all wstrings in courgette_tool to FilePaths.

Presubmit checks now consider the presence of wstring to be an error, so
switching all wstrings in courgette_tool to FilePath's as evanm had
already called out in a TODO.

BUG=chromiumos:22693

Review URL: http://codereview.chromium.org/8498032

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@110611 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoFix two pointer arithmetic errors.
dgarrett@chromium.org [Wed, 9 Nov 2011 02:15:48 +0000 (02:15 +0000)]
Fix two pointer arithmetic errors.

In the heuristic for detecting relative references, we had two non-fatal, but
sub-optimal mistakes with pointer arithmetic. This fixes them for both
ELF 32 and Win 32.

BUG=chromiumos:22677

Review URL: http://codereview.chromium.org/8501023

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@109172 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoReplace "bool ok" style with early returns.
dgarrett@chromium.org [Wed, 9 Nov 2011 00:09:27 +0000 (00:09 +0000)]
Replace "bool ok" style with early returns.

Stephen pointed out that he doesn't like the "bool ok" style and prefers
the early return style during an earlier code review. I agree, but was
using this style to match existing code.

This CL switches a number of methods over to the early return style.

BUG=None

Review URL: http://codereview.chromium.org/8499034

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@109137 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoAdd Elf 32 Support to Courgette.
dgarrett@chromium.org [Tue, 8 Nov 2011 20:32:26 +0000 (20:32 +0000)]
Add Elf 32 Support to Courgette.

This change takes advantage of recent refactoring and adds support for
Elf X86 32 executables to courgette. It should have no effect on handling
of Windows PE executables.

We have planned ahead to be able to restrict the code size of the courgette
library in different cases to reduce patcher sizes, but this change does
not yet take advantage of that (all platforms are supported everywhere).

Also, the patcher class currently contains a very small amount of Elf/PE
specific code for recreating relocation tables that cannot (currently) be
compiled out.

BUG=chromium-os:22149
TEST=Please verify that Chrome/Chromium patches can still be generated and
work.
Also, please see how much the updater executable which is downloaded to
users has changed in size since R16.

Review URL: http://codereview.chromium.org/8477045

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@109089 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoRevert 108929 - Add Elf 32 Support to Courgette.
csilv@chromium.org [Mon, 7 Nov 2011 23:26:37 +0000 (23:26 +0000)]
Revert 108929 - Add Elf 32 Support to Courgette.

This change takes advantage of recent refactoring and adds support for
Elf X86 32 executables to courgette. It should have no effect on handling
of Windows PE executables.

We have planned ahead to be able to restrict the code size of the courgette
library in different cases to reduce patcher sizes, but this change does
not yet take advantage of that (all platforms are supported everywhere).

Also, the patcher class currently contains a very small amount of Elf/PE
specific code for recreating relocation tables that cannot (currently) be
compiled out.

BUG=chromium-os:22149
TEST=Please verify that Chrome/Chromium patches can still be generated and
     work.
     Also, please see how much the updater executable which is downloaded to
     users has changed in size since R16.

Review URL: http://codereview.chromium.org/8428009

TBR=dgarrett@chromium.org
Review URL: http://codereview.chromium.org/8490023

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@108934 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoAdd Elf 32 Support to Courgette.
dgarrett@chromium.org [Mon, 7 Nov 2011 22:49:15 +0000 (22:49 +0000)]
Add Elf 32 Support to Courgette.

This change takes advantage of recent refactoring and adds support for
Elf X86 32 executables to courgette. It should have no effect on handling
of Windows PE executables.

We have planned ahead to be able to restrict the code size of the courgette
library in different cases to reduce patcher sizes, but this change does
not yet take advantage of that (all platforms are supported everywhere).

Also, the patcher class currently contains a very small amount of Elf/PE
specific code for recreating relocation tables that cannot (currently) be
compiled out.

BUG=chromium-os:22149
TEST=Please verify that Chrome/Chromium patches can still be generated and
     work.
     Also, please see how much the updater executable which is downloaded to
     users has changed in size since R16.

Review URL: http://codereview.chromium.org/8428009

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@108929 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoLast small bit of refactoring.
dgarrett@chromium.org [Mon, 31 Oct 2011 22:09:40 +0000 (22:09 +0000)]
Last small bit of refactoring.

Move the Win32X86Generator and Patcher classes to non-windows specific  names since they can be reused untouched for Elf. Move them from one file to files with matching names while at it.

Store the transformation kind on the generator class so that it can be know if it's PE or Elf.

Unified the TransformationId and ExecutableType enums into a single enum used everywhere (defined in courgette.h since it's now part of the external API).

BUG=chromium-os:22149
TEST=Unittests

Review URL: http://codereview.chromium.org/8417045

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@108019 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoDisable the Courgette ensemble unittest.
dgarrett@chromium.org [Wed, 26 Oct 2011 02:35:08 +0000 (02:35 +0000)]
Disable the Courgette ensemble unittest.

This test is taking about 7 minutes to run on windows trybots and buildbots,
so disabling (but not removing it) for the time being.

BUG=None
TEST=Ran Unitests

Review URL: http://codereview.chromium.org/8393032

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@107288 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

18 months agoFurther refactoring, move ImageInfo into Disassembler/DisassemblerWin32X86.
dgarrett@chromium.org [Wed, 26 Oct 2011 00:50:20 +0000 (00:50 +0000)]
Further refactoring, move ImageInfo into Disassembler/DisassemblerWin32X86.

This means that all PE specific knowledge is now contained in a single class
which leaves us in pretty good shape for supporting ELF 32.

There are still widespread assumptions about being 32 bit, but those can be
addressed at a much later date.

BUG=None
TEST=Unittests

Review URL: http://codereview.chromium.org/8166013

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@107260 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoStart refactoring to reduce executable type knowledge.
dgarrett@chromium.org [Fri, 21 Oct 2011 22:24:19 +0000 (22:24 +0000)]
Start refactoring to reduce executable type knowledge.

This creates executable detection functions, a globally shared enum for
describing an executable type, and reduces the number of classes and
locations with executable specific knowledge.

These changes, along with moving architecture specific classes into their
own files should make it easier to produce special purpose clients that
only contain the code required to apply their own form of patch.

DisassemblerWin32EXE, ImagePE, CourgetteWin32X86PatchGenerator, and
CourgetteWin32X86Patcher, and ensemble handling are all heavily affected here.

This should have no effect on the behavior of the system yet, and is instead
all prep-work.

This is the same as an earlier CL, except that ParseHeader will now return
an error for 64 bit PE executables, and resource only DLLs. This is because
the detection factories depend on ParseHeader to decide if a given file
is supported.

BUG=None
TEST=Unittests

Review URL: http://codereview.chromium.org/7920004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103879 0039d316-1c4b-4281-b951-d872f2087c98

Review URL: http://codereview.chromium.org/8344037

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@106793 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoAdd a unittest for ensemble diffing.
dgarrett@chromium.org [Wed, 19 Oct 2011 05:31:59 +0000 (05:31 +0000)]
Add a unittest for ensemble diffing.

The courgette refactoring broke the ability to handle ensembles with 64 bit
PE files, or resource only DLLs. This unittest handles patching ensembles
that contain these file types to confirm my fix, and ensure I don't introduce
this regression again.

BUG=None
TEST=New Unittest

Review URL: http://codereview.chromium.org/8330006

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@106223 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoAdd a basic backwards compatibility unittest.
dgarrett@chromium.org [Tue, 18 Oct 2011 01:08:35 +0000 (01:08 +0000)]
Add a basic backwards compatibility unittest.

This verifies we can still apply old patches, but does not
verify that old clients can apply new patches. That seems
important, but I'm not sure how to do it without storing
old client binaries in version control.

Also refactors a number of unit tests to allow code sharing for
reading files into memory. This is done via a new base class.

Uses test binaries submitted seperatly because of build tools problems.

BUG=None
TEST=New Unittest

Review URL: http://codereview.chromium.org/8252011

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@105982 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoAdd another binary file needed by tests that will be submitted later.
dgarrett@chromium.org [Thu, 13 Oct 2011 20:43:06 +0000 (20:43 +0000)]
Add another binary file needed by tests that will be submitted later.

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@105364 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoRevert 103879 - Start refactoring to reduce executable type knowledge.
laforge@chromium.org [Tue, 11 Oct 2011 18:35:37 +0000 (18:35 +0000)]
Revert 103879 - Start refactoring to reduce executable type knowledge.

This creates executable detection functions, a globally shared enum for
describing an executable type, and reduces the number of classes and
locations with executable specific knowledge.

These changes, along with moving architecture specific classes into their
own files should make it easier to produce special purpose clients that
only contain the code required to apply their own form of patch.

DisassemblerWin32EXE, ImagePE, CourgetteWin32X86PatchGenerator, and
CourgetteWin32X86Patcher, and ensemble handling are all heavily affected here.

This should have no effect on the behavior of the system yet, and is instead
all prep-work.

BUG=None
TEST=Unittests

Review URL: http://codereview.chromium.org/7920004

TBR=dgarrett@chromium.org
Review URL: http://codereview.chromium.org/8234012

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@104926 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoStart refactoring to reduce executable type knowledge.
dgarrett@chromium.org [Tue, 4 Oct 2011 13:43:25 +0000 (13:43 +0000)]
Start refactoring to reduce executable type knowledge.

This creates executable detection functions, a globally shared enum for
describing an executable type, and reduces the number of classes and
locations with executable specific knowledge.

These changes, along with moving architecture specific classes into their
own files should make it easier to produce special purpose clients that
only contain the code required to apply their own form of patch.

DisassemblerWin32EXE, ImagePE, CourgetteWin32X86PatchGenerator, and
CourgetteWin32X86Patcher, and ensemble handling are all heavily affected here.

This should have no effect on the behavior of the system yet, and is instead
all prep-work.

BUG=None
TEST=Unittests

Review URL: http://codereview.chromium.org/7920004

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@103879 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agofix executable flag
gman@chromium.org [Tue, 27 Sep 2011 21:40:57 +0000 (21:40 +0000)]
fix executable flag

TEST=none
BUG=none
TBR=dgarrett@chromium.org
Review URL: http://codereview.chromium.org/8059033

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@103015 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoAdd binary files needed by unittests to come later.
dgarrett@chromium.org [Tue, 27 Sep 2011 21:01:40 +0000 (21:01 +0000)]
Add binary files needed by unittests to come later.

It seems that binary files are sometimes marked as text through the
git-svn gateway (which I'm using). To avoid those problems, I'm
pre-submitting the binary files via svn, then adding the unittests
later.
Review URL: http://codereview.chromium.org/8060001

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@103011 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoRevert 102428 - Add a backwards compatibility unittest.
dgarrett@chromium.org [Fri, 23 Sep 2011 03:24:15 +0000 (03:24 +0000)]
Revert 102428 - Add a backwards compatibility unittest.

This is a resubmit of CL 7915007.

BUG=None
TEST=New Unittest

Review URL: http://codereview.chromium.org/7976035

TBR=dgarrett@chromium.org
Review URL: http://codereview.chromium.org/7972027

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@102434 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

19 months agoAdd a backwards compatibility unittest.
dgarrett@chromium.org [Fri, 23 Sep 2011 02:33:44 +0000 (02:33 +0000)]
Add a backwards compatibility unittest.

This is a resubmit of CL 7915007.

BUG=None
TEST=New Unittest

Review URL: http://codereview.chromium.org/7976035

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@102428 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

20 months agoRevert 101606 - Add a basic backwards compatibility unittest.
rlp@chromium.org [Sat, 17 Sep 2011 01:21:44 +0000 (01:21 +0000)]
Revert 101606 - Add a basic backwards compatibility unittest.

This verifies we can still apply old patches, but does not
verify that old clients can apply new patches. That seems
important, but I'm not sure how to do it without storing
old client binaries in version control.

BUG=None
TEST=New Unittest

Review URL: http://codereview.chromium.org/7915007

TBR=dgarrett@chromium.org
Review URL: http://codereview.chromium.org/7930003

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@101617 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

20 months agoAdd a basic backwards compatibility unittest.
dgarrett@chromium.org [Sat, 17 Sep 2011 00:33:37 +0000 (00:33 +0000)]
Add a basic backwards compatibility unittest.

This verifies we can still apply old patches, but does not
verify that old clients can apply new patches. That seems
important, but I'm not sure how to do it without storing
old client binaries in version control.

BUG=None
TEST=New Unittest

Review URL: http://codereview.chromium.org/7915007

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@101606 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

22 months agoRename CommandLine::GetArgs(), update callers.
msw@chromium.org [Wed, 13 Jul 2011 23:41:22 +0000 (23:41 +0000)]
Rename CommandLine::GetArgs(), update callers.

BUG=73195
TEST=none

Review URL: http://codereview.chromium.org/7352006

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@92448 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

22 months agoRemove the comments setting emands and vim tab width and expansion variables.
tony@chromium.org [Mon, 11 Jul 2011 20:22:46 +0000 (20:22 +0000)]
Remove the comments setting emands and vim tab width and expansion variables.

These were added in r28089 (http://codereview.chromium.org/256059) but
are unnecessary bloat for everyone to carry around, even those that don't
use emacs or vim.

In an earlier change, I added editor config files in src/tools/emacs/
and src/tools/vim/ so users of the appropriate editor can source those
instead.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/7310019

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@92046 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

23 months agoRemove msvs_guid from chrome_frame/, cloud_print/, content/
tony@chromium.org [Wed, 22 Jun 2011 22:14:44 +0000 (22:14 +0000)]
Remove msvs_guid from chrome_frame/, cloud_print/, content/
courgette/, and google_update/.

BUG=28727

Review URL: http://codereview.chromium.org/7191021

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@90119 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoFinal gyp patch to make use of the new cross-platform POSIX defines toolkit_uses_gtk...
tony@chromium.org [Mon, 23 May 2011 22:06:54 +0000 (22:06 +0000)]
Final gyp patch to make use of the new cross-platform POSIX defines toolkit_uses_gtk, os_posix, and use_x11. For lists of source files that use a mix of POSIX and Gtk APIs, toolkit_uses_gtk was given precedence.  Solaris was made to use ALSA also, as libasound has been ported to FreeBSD and Solaris as a wrapper around the native OSS.

Review URL: http://codereview.chromium.org/7055003

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@86352 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoGlobally replace <(library) with static_library
evan@chromium.org [Thu, 19 May 2011 23:18:53 +0000 (23:18 +0000)]
Globally replace <(library) with static_library

We provided <(library) as a variable to support a peculiar
build configuration on Linux.  We no longer support that build
configuration, so we can simplify this code to no longer use
a variable.

Review URL: http://codereview.chromium.org/7051014

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@86004 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoiwyu: Include stringprintf.h where appropriate, part 3.
jhawkins@chromium.org [Thu, 12 May 2011 01:55:40 +0000 (01:55 +0000)]
iwyu: Include stringprintf.h where appropriate, part 3.

BUG=82098
TEST=none

R=csilv@chromium.org

Review URL: http://codereview.chromium.org/7016011

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@85088 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoMake courgette compiler on clang and linux x64 builders
grt@chromium.org [Wed, 6 Apr 2011 18:37:02 +0000 (18:37 +0000)]
Make courgette compiler on clang and linux x64 builders

BUG=none
TEST=none
TBR=tommi
Review URL: http://codereview.chromium.org/6802013

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@80667 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agofix build error.
tommi@chromium.org [Wed, 6 Apr 2011 17:56:32 +0000 (17:56 +0000)]
fix build error.

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@80654 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoSwitch out use of std::string and std::vector for large allocations for a buffer...
tommi@chromium.org [Wed, 6 Apr 2011 17:42:45 +0000 (17:42 +0000)]
Switch out use of std::string and std::vector for large allocations for a buffer class that doesn't throw exceptions.
The new buffer class is pretty simple and relies on the MemoryAllocator class that I previously to back large
allocations with mapped files when memory is scarce.  That reduced the number of crashes quite a bit but we
still crash on machines that are simply out of diskspace as well.  So, the right thing to do is to expect and
handle failures which is what this cl is all about.  What we should see once this has landed is that crash
dumps due to courgette running out of disk space should disappear from crash/ and instead we should see the
number of users that run into this particular problem in dashboards.

TEST=Courgette out-of-memory/out-of-diskspace errors should disappear from crash/
BUG=74777
Review URL: http://codereview.chromium.org/6677141

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@80648 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoPulling in new icu with msvs2010 fix.
bradnelson@google.com [Tue, 29 Mar 2011 01:21:23 +0000 (01:21 +0000)]
Pulling in new icu with msvs2010 fix.
Cloned http://codereview.chromium.org/6767003/ to land in the same CL.

BUG=None
TEST=None
R=jeanluc@chromium.org
Review URL: http://codereview.chromium.org/6698070

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@79646 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoMove some files from base to base/memory.
levin@chromium.org [Mon, 28 Mar 2011 01:54:15 +0000 (01:54 +0000)]
Move some files from base to base/memory.

raw_scoped_refptr_mismatch_checker.h
ref_counted.cc
ref_counted.h
ref_counted_memory.cc
ref_counted_memory.h
ref_counted_unittest.cc
scoped_callback_factory.h
scoped_comptr_win.h
scoped_handle.h
scoped_native_library.cc
scoped_native_library.h
scoped_native_library_unittest.cc
scoped_nsobject.h
scoped_open_process.h
scoped_ptr.h
scoped_ptr_unittest.cc
scoped_temp_dir.cc
scoped_temp_dir.h
scoped_temp_dir_unittest.cc
scoped_vector.h
singleton.h
singleton_objc.h
singleton_unittest.cc
linked_ptr.h
linked_ptr_unittest.cc
weak_ptr.cc
weak_ptr.h
weak_ptr_unittest.cc

BUG=None
TEST=Compile

Review URL: http://codereview.chromium.org/6714032

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@79524 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoQuick fix for clang and linux views builders.
tommi@chromium.org [Tue, 22 Mar 2011 20:47:41 +0000 (20:47 +0000)]
Quick fix for clang and linux views builders.

TBR=robertshield
BUG=none
Review URL: http://codereview.chromium.org/6721007

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@79032 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoIdentifying call sites that need to handle out of memory situations in Courgette.
tommi@chromium.org [Tue, 22 Mar 2011 20:19:49 +0000 (20:19 +0000)]
Identifying call sites that need to handle out of memory situations in Courgette.

There's no functional change here, only interface changes:
* Change methods that are known to fail out in the field to return bool instead of void.
* Where those methods are called, check the return value and report errors
* In debug builds use a specialized template class that forces callers to check return values (this is possible at compile time in gcc, but unfortunately not in VS).

The next step will be to change the implementation to not use STL containers.

TEST=Run courgette tests.
BUG=74777
Review URL: http://codereview.chromium.org/6716006

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@79030 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoChange other usages of .size() to .empty() when applicable.
erg@google.com [Fri, 4 Mar 2011 21:03:47 +0000 (21:03 +0000)]
Change other usages of .size() to .empty() when applicable.

BUG=carnitas
TEST=compiles

Review URL: http://codereview.chromium.org/6609008

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@76962 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoInstrument the allocator code so that we can track down the cause of recent crashes.
tommi@chromium.org [Thu, 3 Mar 2011 23:39:32 +0000 (23:39 +0000)]
Instrument the allocator code so that we can track down the cause of recent crashes.

BUG=74777
TEST=This should give us a clearer picture of what's going wrong in the recent courgette crashes.

Review URL: http://codereview.chromium.org/6611027

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@76834 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoPure pedantry: Replace all ".size() == 0" with ".empty()".
erg@google.com [Wed, 2 Mar 2011 00:03:18 +0000 (00:03 +0000)]
Pure pedantry: Replace all ".size() == 0" with ".empty()".

BUG=carnitas
TEST=compiles; existing unit tests.

Review URL: http://codereview.chromium.org/6602049

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@76467 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoImplementation of an STL compatible allocator for Courgette on Windows.
tommi@chromium.org [Tue, 1 Mar 2011 00:19:02 +0000 (00:19 +0000)]
Implementation of an STL compatible allocator for Courgette on Windows.
This is to better handle low memory situations when applying a differential
patch to a large Chrome setup.

For reading input files, I'm also switching to using memory mapped files
instead of ReadFileToString to reduce the load on the heap.

TEST=courgette.exe should succeed in applying a patch between two
  chrome 10.x archives on an XP machine with 180MB of physical memory and
  no page file.
BUG=72459,73209

Review URL: http://codereview.chromium.org/6597038

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@76320 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoImproved memory usage while applying patch.
sra@chromium.org [Wed, 23 Feb 2011 21:18:48 +0000 (21:18 +0000)]
Improved memory usage while applying patch.

Reduced total size of allocations from 520MB to 318MB.
The general technique is to allocate the correct size rather than grow into
the correct size and overshoot.

1. Find file sizes and allocate buffers of that size for the input files.

2. Pre-allocate a buffer for the collected inputs for the final diff.

3. Calculate the size for (2) during compression and include it in the patch
   header.

The courgette.exe command line tool now calls the same ApplyEnsemblePatch
entry point that is called by the installer.  This ensures measurements of
courgette.exe are a better reflection of the installer.

BUG=72459

Review URL: http://codereview.chromium.org/6546008

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@75787 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoMake the 32bit courgette.exe tool large-adddress-aware so that it can create patches.
tommi@chromium.org [Wed, 23 Feb 2011 18:09:12 +0000 (18:09 +0000)]
Make the 32bit courgette.exe tool large-adddress-aware so that it can create patches.
(The courgette64 tool doesn't build in all configurations)

Review URL: http://codereview.chromium.org/6565008

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@75763 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoClang: enable -Wbool-conversions and -Wunused-variables on Linux.
hans@chromium.org [Fri, 14 Jan 2011 10:36:28 +0000 (10:36 +0000)]
Clang: enable -Wbool-conversions and -Wunused-variables on Linux.

-Wbool-conversion warns about EXPECT_EQ(false, blah), so replace
that with EXPECT_FALSE(blah). Do the same with EXPECT_EQ(true, blah)
for good measure (even though that doesn't generate warnings).

Also remove the one instance of an unused variable.

BUG=69421
TEST=buildbots all compile and all tests pass

Review URL: http://codereview.chromium.org/6300001

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@71431 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoLinux: fix a bunch of NULL vs. 0 issues spotted by gcc 4.5.
craig.schlenter@chromium.org [Thu, 13 Jan 2011 16:27:18 +0000 (16:27 +0000)]
Linux: fix a bunch of NULL vs. 0 issues spotted by gcc 4.5.

There are more gcc 4.5 issues to be solved so GYP_DEFINES=='werror='
is still required to build with 4.5 even with these changes.

BUG=66652
TEST=compiles with gcc 4.5 and trybots

Review URL: http://codereview.chromium.org/6186008

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@71325 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoUpdate some directories' svn:ignore props.
pkasting@chromium.org [Tue, 11 Jan 2011 23:23:57 +0000 (23:23 +0000)]
Update some directories' svn:ignore props.

BUG=none
TEST=none
TBR=maruel

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@71103 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoMade logging not look up --enable-dcheck from command line
akalin@chromium.org [Tue, 11 Jan 2011 01:03:36 +0000 (01:03 +0000)]
Made logging not look up --enable-dcheck from command line

Made --enable-dcheck a parameter to InitLogging() and fixed up all
callsites.

BUG=62736
TEST=Manual

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70782

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70920

Review URL: http://codereview.chromium.org/6070006

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@70977 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoRevert 70920 - Made logging not look up --enable-dcheck from command line
akalin@chromium.org [Mon, 10 Jan 2011 19:59:52 +0000 (19:59 +0000)]
Revert 70920 - Made logging not look up --enable-dcheck from command line

Made --enable-dcheck a parameter to InitLogging() and fixed up all
callsites.

BUG=62736
TEST=Manual

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70782

Review URL: http://codereview.chromium.org/6070006

TBR=akalin@chromium.org
Review URL: http://codereview.chromium.org/6099012

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@70923 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoMade logging not look up --enable-dcheck from command line
akalin@chromium.org [Mon, 10 Jan 2011 19:30:16 +0000 (19:30 +0000)]
Made logging not look up --enable-dcheck from command line

Made --enable-dcheck a parameter to InitLogging() and fixed up all
callsites.

BUG=62736
TEST=Manual

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70782

Review URL: http://codereview.chromium.org/6070006

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@70920 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoRevert 70782 - Made logging not look up --enable-dcheck from command line
akalin@chromium.org [Fri, 7 Jan 2011 21:53:05 +0000 (21:53 +0000)]
Revert 70782 - Made logging not look up --enable-dcheck from command line

Made --enable-dcheck a parameter to InitLogging() and fixed up all
callsites.

BUG=62736
TEST=Manual

Review URL: http://codereview.chromium.org/6070006

TBR=akalin@chromium.org
Review URL: http://codereview.chromium.org/6100007

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@70783 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoMade logging not look up --enable-dcheck from command line
akalin@chromium.org [Fri, 7 Jan 2011 21:44:54 +0000 (21:44 +0000)]
Made logging not look up --enable-dcheck from command line

Made --enable-dcheck a parameter to InitLogging() and fixed up all
callsites.

BUG=62736
TEST=Manual

Review URL: http://codereview.chromium.org/6070006

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@70782 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoAlso build a 64-bit exe version of the 32-bit courgette
bradnelson@google.com [Tue, 21 Dec 2010 01:03:43 +0000 (01:03 +0000)]
Also build a 64-bit exe version of the 32-bit courgette
utility + library to support larger input sizes.

BUG=63793
TEST=None

Review URL: http://codereview.chromium.org/5096007

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@69779 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoCall InitLogging() for courgette.
akalin@chromium.org [Tue, 16 Nov 2010 06:11:30 +0000 (06:11 +0000)]
Call InitLogging() for courgette.

BUG=None
TEST=Manually

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=66208

Review URL: http://codereview.chromium.org/5038002

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@66236 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoRevert 66208 - Call InitLogging() for courgette.
akalin@chromium.org [Tue, 16 Nov 2010 02:10:32 +0000 (02:10 +0000)]
Revert 66208 - Call InitLogging() for courgette.

BUG=None
TEST=Manually

Review URL: http://codereview.chromium.org/5038002

TBR=akalin@chromium.org
Review URL: http://codereview.chromium.org/5066001

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@66218 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoCall InitLogging() for courgette.
akalin@chromium.org [Tue, 16 Nov 2010 01:19:59 +0000 (01:19 +0000)]
Call InitLogging() for courgette.

BUG=None
TEST=Manually

Review URL: http://codereview.chromium.org/5038002

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@66208 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agobase: Get rid of 'using' declaration of StringAppendF.
tfarina@chromium.org [Mon, 15 Nov 2010 12:11:11 +0000 (12:11 +0000)]
base: Get rid of 'using' declaration of StringAppendF.

Update the callers to append base:: in the calls to StringAppendF.

BUG=None
TEST=trybots

Review URL: http://codereview.chromium.org/4974001

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@66116 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoFix compile failure.
pkasting@chromium.org [Thu, 21 Oct 2010 21:16:47 +0000 (21:16 +0000)]
Fix compile failure.

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@63424 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoConvert LOG(INFO) to VLOG(1) - courgette/.
pkasting@chromium.org [Thu, 21 Oct 2010 20:40:58 +0000 (20:40 +0000)]
Convert LOG(INFO) to VLOG(1) - courgette/.

This eliminates the custom logging code as VLOG is per-module configurable.  I did preserve the distinct log level numbers in the VLOG statements.

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3904002

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@63407 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoPrevent Courgette from choosing a really large executable as the basis of comparison...
mal@chromium.org [Sun, 26 Sep 2010 02:21:47 +0000 (02:21 +0000)]
Prevent Courgette from choosing a really large executable as the basis of comparison for a small executable.

Patch by sra@chromium.org.

BUG= none
TEST= diff installer creation succeeds.
Review URL: http://codereview.chromium.org/3431029

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@60591 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoFBTF: Remove unneeded headers from base/ (part 7)
thestig@chromium.org [Fri, 27 Aug 2010 21:39:48 +0000 (21:39 +0000)]
FBTF: Remove unneeded headers from base/ (part 7)

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3176026

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@57737 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoRe-land part of r55416, minus actually moving the test_suite.h contents to a .cc...
brettw@chromium.org [Tue, 17 Aug 2010 19:40:11 +0000 (19:40 +0000)]
Re-land part of r55416, minus actually moving the test_suite.h contents to a .cc file.

Cleanup in base. This moves the implementation (and a bunch of header file
dependencies) from the multiprocess test and the test_suite headers to .cc
files. Moves multiprocess_test to the test directory, and all of this stuff to
the existing base_test_support project. I also used the base namespace.

Previously other projects included this functionality just by #include because
it was all inline, so I had to add dependencies on base_test_support in a few
places.

Moves and renames the command line switch this was using to base_switches. Move
the base switch for process type to chrome switches.

TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3026055

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@56399 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoRe-land just the project file changes from r55416. This makes projects that use
brettw@chromium.org [Sun, 15 Aug 2010 19:58:53 +0000 (19:58 +0000)]
Re-land just the project file changes from r55416. This makes projects that use
base test files dependent on test_support_base.

TEST=none
BUG=none

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@56172 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoRevert 55400 - Cleanup in base. This moves the implementation (and a bunch of header...
nsylvain@chromium.org [Mon, 9 Aug 2010 17:32:32 +0000 (17:32 +0000)]
Revert 55400 - Cleanup in base. This moves the implementation (and a bunch of header file
dependencies) from the multiprocess test and the test_suite headers to .cc
files. Moves multiprocess_test to the test directory, and all of this stuff to
the existing base_test_support project. I also used the base namespace.

Previously other projects included this functionality just by #include because
it was all inline, so I had to add dependencies on base_test_support in a few
places.

Moves and renames the command line switch this was using to base_switches. Move
the base switch for process type to chrome switches.

TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3026055

TBR=brettw@chromium.org
Review URL: http://codereview.chromium.org/3035062

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@55416 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoCleanup in base. This moves the implementation (and a bunch of header file
brettw@chromium.org [Mon, 9 Aug 2010 15:25:53 +0000 (15:25 +0000)]
Cleanup in base. This moves the implementation (and a bunch of header file
dependencies) from the multiprocess test and the test_suite headers to .cc
files. Moves multiprocess_test to the test directory, and all of this stuff to
the existing base_test_support project. I also used the base namespace.

Previously other projects included this functionality just by #include because
it was all inline, so I had to add dependencies on base_test_support in a few
places.

Moves and renames the command line switch this was using to base_switches. Move
the base switch for process type to chrome switches.

TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3026055

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@55400 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agobase: rename Environment::GetEnv to Environment::GetVar.
tfarina@chromium.org [Sat, 7 Aug 2010 02:57:59 +0000 (02:57 +0000)]
base: rename Environment::GetEnv to Environment::GetVar.

This is the part 4 and the latest of this series.

BUG=None
TEST=trybots

Review URL: http://codereview.chromium.org/3029062

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@55326 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoAdd #include utf_string_conversions.h to all files that use ASCIIToWide and
brettw@chromium.org [Tue, 3 Aug 2010 14:35:22 +0000 (14:35 +0000)]
Add #include utf_string_conversions.h to all files that use ASCIIToWide and
ASCIIToUTF16. I removed string_util includes from a few places where it
obviously wasn't needed.

In a separate pass, I'm going to remove ASCIITo* from string_util, then I'm
going to do an even later pass to find the unnecessary string_util.h includes
and remove them.

TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/3058027

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@54746 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agobase: Rename EnvVarGetter to Environment.
tfarina@chromium.org [Tue, 3 Aug 2010 03:00:50 +0000 (03:00 +0000)]
base: Rename EnvVarGetter to Environment.

Now EnvVarGetter do much more than getting environment variables.

Per suggestion from Pawel in http://codereview.chromium.org/3043018/.

BUG=None
TEST=trybots

Signed-off-by: Thiago Farina <tfarina@chromium.org>
Review URL: http://codereview.chromium.org/3052034

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@54696 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoConvert more callers of the integer/string functions to using
brettw@chromium.org [Sat, 31 Jul 2010 17:29:25 +0000 (17:29 +0000)]
Convert more callers of the integer/string functions to using
string_number_conversions.h

TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/3013046

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@54454 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoMove the number conversions from string_util to a new file.
nsylvain@google.com [Tue, 5 Oct 2010 01:59:31 +0000 (01:59 +0000)]
Move the number conversions from string_util to a new file.

Use the base namespace in the new file. Update callers.

I removed all wstring variants and also the string->number ones that ignore the return value. That encourages people to write code and forget about error handling.

TEST=included unit tests
BUG=none

Review URL: http://codereview.chromium.org/3056029

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@54355 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoRemove deprecated CommandLine::GetLooseValues(), rename to args().
evan@chromium.org [Wed, 21 Jul 2010 15:57:23 +0000 (15:57 +0000)]
Remove deprecated CommandLine::GetLooseValues(), rename to args().

It returned a wstring, when really we wanted the native encoded
strings.  Fixing the majority of callers actually simplified them
in many cases because the callers wanted native strings too.

Since I'm touching every caller, I gave it a more useful name.
I'm not sure where "loose" came from but it never made sense to me.

BUG=24672

Review URL: http://codereview.chromium.org/3028010

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@53193 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoRemove <iostream> where possible.
erg@google.com [Tue, 20 Jul 2010 20:08:23 +0000 (20:08 +0000)]
Remove <iostream> where possible.

<iostream> creates a static initializer. Most people don't need <iostream>
anyway--they really  need <ostream> for operator<< overloads. <iostream>
should *never* be included in a header file; <iosfwd> exists for that purpose.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3014015

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@53083 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agobase: Get rid of the deprecated SysInfo::GetEnvVar.
tfarina@chromium.org [Thu, 8 Jul 2010 03:56:17 +0000 (03:56 +0000)]
base: Get rid of the deprecated SysInfo::GetEnvVar.

Use the new EnvVarGetter::GetEnv instead.

BUG=None
TEST=trybots

Review URL: http://codereview.chromium.org/2876045

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@51829 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoAdd svn:ignore properties for most of the rest of the Chrome Linux checkout.
brettw@chromium.org [Wed, 16 Jun 2010 16:19:22 +0000 (16:19 +0000)]
Add svn:ignore properties for most of the rest of the Chrome Linux checkout.

TEST=none
BUG=none

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@49954 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 years agoUse an array of pages for the large arrays.
sra@chromium.org [Sat, 29 May 2010 00:47:48 +0000 (00:47 +0000)]
Use an array of pages for the large arrays.

The large arrays of ints used by the suffix array code sometimes can't be
allocated due to fragmented address space.  Using an array of 'pages' lets
the allocation be satisfied by many smaller allocations.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/2228003

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@48547 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 years agoFix for bug where 64-bit executables were processed as 32-bit executables.
laforge@chromium.org [Mon, 15 Mar 2010 17:33:46 +0000 (17:33 +0000)]
Fix for bug where 64-bit executables were processed as 32-bit executables.

Added some more logging.

TBR=sra

Review URL: http://codereview.chromium.org/988002

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@41598 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 years agosvn prop fixes. Applied to all files not in third_party.
pkasting@chromium.org [Tue, 9 Mar 2010 02:34:14 +0000 (02:34 +0000)]
svn prop fixes.  Applied to all files not in third_party.
* Removed eol-style, executable and mergeinfo from BMP/GIF/ICO/JPEG files, and set correct mime-type.
* Removed executable and mergeinfo from .c/.cc/.cpp/.h/.m/.mm and .gyp files, and set eol-style to LF.

TBR=evanm
BUG=none
TEST=none

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@40991 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 years agoOpenBSD/FreeBSD GYP changes (most of the remaining ones)
pvalchev@google.com [Thu, 4 Feb 2010 04:19:35 +0000 (04:19 +0000)]
OpenBSD/FreeBSD GYP changes (most of the remaining ones)

Review URL: http://codereview.chromium.org/565043

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@38079 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 years agoClarify licenses on a bunch of files.
evan@chromium.org [Tue, 29 Dec 2009 00:59:31 +0000 (00:59 +0000)]
Clarify licenses on a bunch of files.

In this process, I also filed bugs on various projects we depend
on that also have unclear licenses.

BUG=28291

Review URL: http://codereview.chromium.org/521009

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@35323 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 years agoAdd compiler-specific "examine printf format" attributes to printfs.
evan@chromium.org [Fri, 20 Nov 2009 06:53:28 +0000 (06:53 +0000)]
Add compiler-specific "examine printf format" attributes to printfs.

Functions that take a printf-style format get a new annotation, which
produces a bunch of compiler warnings when you use printf impoperly.
This change adds the annotations and fixes the warnings.

We now must use PRId64 for 64-bit numbers and the PRIsz for size_t.

Review URL: http://codereview.chromium.org/339059

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@32600 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 years agoUse GetSwitchValueASCII.
tony@chromium.org [Fri, 6 Nov 2009 19:55:16 +0000 (19:55 +0000)]
Use GetSwitchValueASCII.

BUG=24672
TEST=None

Original patch by Thiago Farina <thiago.farina@gmail.com> at
http://codereview.chromium.org/296004

Review URL: http://codereview.chromium.org/373013

git-svn-id: http://src.chromium.org/svn/trunk/src/courgette@31269 4ff67af0-8c30-449e-8e8b-ad334ec8d88c