chromium/src/courgette.git
3 weeks agoFixes for re-enabling more MSVC level 4 warnings: courgette/ edition master
pkasting@chromium.org [Tue, 8 Jul 2014 08:40:56 +0000 (08:40 +0000)]
Fixes for re-enabling more MSVC level 4 warnings: courgette/ edition

This contains fixes for the following sorts of issues:
* Signedness mismatch

BUG=81439
TEST=none

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

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

6 weeks agoMinor Fixes for Windows GN build.
brettw@chromium.org [Sat, 14 Jun 2014 20:34:16 +0000 (20:34 +0000)]
Minor Fixes for Windows GN build.

TBR=scottmg

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

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

6 weeks agoAdd more content subtargets and deps to the GN build.
brettw@chromium.org [Fri, 13 Jun 2014 23:48:50 +0000 (23:48 +0000)]
Add more content subtargets and deps to the GN build.

Includes courgette, libva, and lzma.

TBR=scottmg

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

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

2 months agoRemove {linux|android}_use_tcmalloc and switch to use_allocator in Chromium.
dmikurube@chromium.org [Wed, 7 May 2014 18:45:59 +0000 (18:45 +0000)]
Remove {linux|android}_use_tcmalloc and switch to use_allocator in Chromium.

If this change breaks some bots, please try restarting the
bot before reverting it. http://crrev.com/264460 may not be
effective yet until restarting.

See the bug and http://crrev.com/255129 for the details.

BUG=345554

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

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

3 months agoRemove all uses of toolkit_use_gtk in the gyp files.
erg@chromium.org [Thu, 17 Apr 2014 19:20:23 +0000 (19:20 +0000)]
Remove all uses of toolkit_use_gtk in the gyp files.

BUG=297026
R=ben@chromium.org, brettw@chromium.org

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

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

3 months agoPort to x64 Android.
anton@chromium.org [Thu, 3 Apr 2014 11:35:46 +0000 (11:35 +0000)]
Port to x64 Android.
New compiler version complains about used before initialized.
Compiler is wrong about this, but there is no harm in initializing.

BUG=346626

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

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

4 months agoFix "unreachable code" warnings (MSVC warning 4702), misc. edition.
pkasting@chromium.org [Tue, 18 Mar 2014 19:04:21 +0000 (19:04 +0000)]
Fix "unreachable code" warnings (MSVC warning 4702), misc. edition.

This CL covers top-level directories that only had one or two modified files.

BUG=346399
TEST=none
R=darin@chromium.org

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

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

4 months agoMove WriteFile and WriteFileDescriptor from file_util to base namespace.
brettw@chromium.org [Thu, 6 Mar 2014 20:42:30 +0000 (20:42 +0000)]
Move WriteFile and WriteFileDescriptor from file_util to base namespace.

R=viettrungluu@chromium.org
TBR=viettrungluu

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

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

4 months agoAdd use_allocator instead of linux_use_tcmalloc to switch the allocator.
dmikurube@chromium.org [Wed, 5 Mar 2014 20:07:26 +0000 (20:07 +0000)]
Add use_allocator instead of linux_use_tcmalloc to switch the allocator.

This change is to add a new build option 'use_allocator' which will
replace 'linux_use_tcmalloc' in the future. It doesn't change the
behavior immediately. The migration plan is as follows:

1) (this change)
... Add 'use_allocator' and set its default to "see_use_tcmalloc".
... Change allocator conditions to check use_allocator firstly.
... Use linux_use_tcmalloc if use_allocator=="see_use_tcmalloc".
... NO IMPACT without specifying use_allocator explicitly.
2) Change Blink to accept use_allocator. http://crrev.com/177053003/
3) Change gyp to accept use_allocator. http://crrev.com/178643004/
4) PSA the transition period to chromium-dev@.
5) (after the PSA-ed transition period)
... Make 'use_allocator' to "tcmalloc" or "none" (it depends) by default.
... Remove all linux_use_tcmalloc.
... Assert in gyp_chromium to check if linux_use_tcmalloc is not specified.

At the point of this change (1), linux_use_tcmalloc is still used by default
because 'use_allocator%': "see_use_tcmalloc".

As written in http://crbug.com/345554, linux_use_tcmalloc would
be confusing to have more options about allocators. We plan to:
A) enable gperftools' heap-profiler with non-tcmalloc allocator,
B) add a new memory allocator instead of tcmalloc.

BUG=345554, 339604, 341349
R=agl@chromium.org, brettw@chromium.org, dgarrett@chromium.org, jam@chromium.org, jamesr@chromium.org, joi@chromium.org, miket@chromium.org, nick@chromium.org, rsleevi@chromium.org, scherkus@chromium.org, sergeyu@chromium.org, shess@chromium.org, sievers@chromium.org, sky@chromium.org, vitalybuka@chromium.org, willchan@chromium.org

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

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

5 months agoRemove PlatformFile from courgette
rvargas@chromium.org [Fri, 21 Feb 2014 16:07:52 +0000 (16:07 +0000)]
Remove PlatformFile from courgette

BUG=322664
R=tommi@chromium.org

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

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

6 months agoAllow Win64 build of base library even in a Win32 build.
petewil@chromium.org [Thu, 9 Jan 2014 18:48:05 +0000 (18:48 +0000)]
Allow Win64 build of base library even in a Win32 build.

Some components of a 32 bit build of chrome for Windows need to be built
as Win64 Dlls.  To allow those components to use base, we make a Win64
build of the base library even when building chrome 32 bit.

This is needed by the Chrome Desk Band code. crbug.com/327435.
https://codereview.chromium.org/79173004/

BUG=327435

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

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

7 months agoUpdate uses of UTF conversions in courgette/, device/, extensions/, google_apis/...
avi@chromium.org [Wed, 25 Dec 2013 18:18:01 +0000 (18:18 +0000)]
Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media/, net/ to use the base:: namespace.

BUG=330556
TEST=no change
TBR=ben@chromium.org

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

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

7 months agoMove GetFileSize, NormalizeFilePath to base namespace
brettw@chromium.org [Wed, 4 Dec 2013 18:22:49 +0000 (18:22 +0000)]
Move GetFileSize, NormalizeFilePath to base namespace

BUG=
R=viettrungluu@chromium.org

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

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

7 months agoMove temp file functions to base namespace.
brettw@chromium.org [Tue, 3 Dec 2013 17:55:52 +0000 (17:55 +0000)]
Move temp file functions to base namespace.

BUG=

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

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

10 months agoAdd PE64 support to courgette
wfh@chromium.org [Wed, 25 Sep 2013 19:05:51 +0000 (19:05 +0000)]
Add PE64 support to courgette

Add tests for PE64

BUG=38784
NOTRY=true

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

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

10 months agoFix +x bit on courgette testdata
scottmg@chromium.org [Tue, 24 Sep 2013 18:27:34 +0000 (18:27 +0000)]
Fix +x bit on courgette testdata

BUG=38784

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

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

10 months agoCommit binary files needed by Courgette tests for PE 64.
scottmg@chromium.org [Tue, 24 Sep 2013 17:43:00 +0000 (17:43 +0000)]
Commit binary files needed by Courgette tests for PE 64.

These files are referenced by unittests, and not used otherwise. They are
in this commit to work around the git-svn binary file brokeness.

This is the CL they actually belong to:
  https://codereview.chromium.org/23600063/

BUG=38784
R=wfh@chromium.org

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

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

10 months agoRevert 224789 "Add PE64 support to courgette"
piman@chromium.org [Mon, 23 Sep 2013 21:56:39 +0000 (21:56 +0000)]
Revert 224789 "Add PE64 support to courgette"

Caused failures: http://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/23037/steps/courgette_unittests/logs/stdio

> Add PE64 support to courgette
>
> Add tests for PE64
>
> BUG=38784
>
> Review URL: https://chromiumcodereview.appspot.com/23600063

TBR=wfh@chromium.org

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

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

10 months agoAdd PE64 support to courgette
wfh@chromium.org [Mon, 23 Sep 2013 21:05:22 +0000 (21:05 +0000)]
Add PE64 support to courgette

Add tests for PE64

BUG=38784

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

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

10 months agoConvert most run_all_unittests.cc files to use new unit test launcher.
phajdan.jr@chromium.org [Thu, 5 Sep 2013 18:20:36 +0000 (18:20 +0000)]
Convert most run_all_unittests.cc files to use new unit test launcher.

Note that the new code is still behind a runtime flag
(--brave-new-test-launcher), but compiling tests with support for it
will make further testing possible.

BUG=236893, 79359
R=akalin@chromium.org, enne@chromium.org, erikwright@chromium.org, joi@chromium.org, keybuk@chromium.org, sky@chromium.org, thestig@chromium.org, tommi@chromium.org, wtc@chromium.org, xhwang@chromium.org, yzshen@chromium.org

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

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

11 months agoMove ReadFileToString to the base namespace.
brettw@chromium.org [Fri, 30 Aug 2013 18:23:50 +0000 (18:23 +0000)]
Move ReadFileToString to the base namespace.

BUG=

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

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

11 months agoFactored common functionality out of the Courgette stress test scripts
dgarrett@chromium.org [Wed, 28 Aug 2013 23:12:58 +0000 (23:12 +0000)]
Factored common functionality out of the Courgette stress test scripts

BUG=274054
R=dgarrett@chromium.org

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

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

11 months agoAdded documentation for Courgette internals.
dgarrett@chromium.org [Wed, 28 Aug 2013 23:09:07 +0000 (23:09 +0000)]
Added documentation for Courgette internals.

It consists of a markdown file, png diagrams, and the generated html output.

BUG=274829
R=benchan@chromium.org, dgarrett@chromium.org

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

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

11 months agoCopy courgette.exe to courgette64.exe
jschuh@chromium.org [Fri, 16 Aug 2013 22:30:43 +0000 (22:30 +0000)]
Copy courgette.exe to courgette64.exe

Bot angry file not named way bot want.

R=tommi@chromium.org,laforge@chromium.org
BUG=273246

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

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

11 months agoAdded time and memory metrics and xz compression tests
paulgazz@chromium.org [Wed, 14 Aug 2013 19:36:08 +0000 (19:36 +0000)]
Added time and memory metrics and xz compression tests

BUG=266021,205187,266028

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

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

11 months agoThis patch uses single BytesInstruction Courgette ops to point to long stretches...
paulgazz@chromium.org [Tue, 13 Aug 2013 00:46:30 +0000 (00:46 +0000)]
This patch uses single BytesInstruction Courgette ops to point to long stretches of the binary file, instead of using one ByteInstruction op, which copies one byte at a time.  This reduces memory usages for very large files, since less data is copied, and fewer Instruction classes are constructed.

BUG=266068

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

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

11 months agoARM binaries seen by Courgette have three ISAs, ARM, thumb, and thumb-2. Courgette...
paulgazz@chromium.org [Tue, 6 Aug 2013 00:11:54 +0000 (00:11 +0000)]
ARM binaries seen by Courgette have three ISAs, ARM, thumb, and thumb-2.  Courgette currently identified branch instructions from these ISAs heuristically, which leads to false positives.  This patch improves on the heuristic by ignoring branches to addresses that aren't used very much in the binary.

Currently, the lower threshold for the number of times an address is used is 5, which was found empirically.  ARM versions of chrome OS from daisy_3701.98.0 to daisy_4206.0.0 double the bytes saved by Courgette.

BUG=266019

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

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

12 months agoSupport for ARM 32-bit ELF binaries in Courgette
paulgazz@chromium.org [Thu, 1 Aug 2013 00:11:24 +0000 (00:11 +0000)]
Support for ARM 32-bit ELF binaries in Courgette

Notes for reviewers:
dgarrett: courgette correctness, ARM
benchan: style, correctness

BUG=258640,258645,258653

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

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

12 months agoFixed heaptest errors in courgette_unittests
paulgazz@chromium.org [Fri, 26 Jul 2013 11:11:37 +0000 (11:11 +0000)]
Fixed heaptest errors in courgette_unittests

BUG=263748

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

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

12 months agoAdded a TypedRVA to track what kind of branch instruction is used for
paulgazz@chromium.org [Tue, 23 Jul 2013 21:18:19 +0000 (21:18 +0000)]
Added a TypedRVA to track what kind of branch instruction is used for
the jump and compute the target RVA accordingly.  Also updated the
unit test to use TypedRVA and check that only X86 RVAs are found by
the X86 "disassembler".

BUG=258645

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

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

12 months agoFixed Courgette to correctly regenerate the ELF relocation table for
paulgazz@chromium.org [Thu, 18 Jul 2013 22:07:53 +0000 (22:07 +0000)]
Fixed Courgette to correctly regenerate the ELF relocation table for
ARM binaries.

Note for reviewers:
Don: general courgette correctness
Ben: style, correctness

BUG=258648

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

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

12 months agoAdd testing of disassembly and assembly to the stress tester
paulgazz@chromium.org [Thu, 18 Jul 2013 21:26:24 +0000 (21:26 +0000)]
Add testing of disassembly and assembly to the stress tester

BUG=259153
TEST=run_stress_test data/x86-mario_3701.98.0/bin/ data/x86-mario_4206.0.0/bin/ st_bin_x86_test; analyze_stress_test st_bin_x86_test/log;

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

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

13 months agoUse a direct include of time headers in courgette/, crypto/, dbus/, device/, google_a...
avi@chromium.org [Fri, 28 Jun 2013 15:20:02 +0000 (15:20 +0000)]
Use a direct include of time headers in courgette/, crypto/, dbus/, device/, google_apis/, gpu/, ipc/, jingle/.

BUG=254986
TEST=none
TBR=ben@chromium.org

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

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

13 months agoDefine a LoggingSettings struct to use for InitLogging()
akalin@chromium.org [Fri, 21 Jun 2013 21:15:33 +0000 (21:15 +0000)]
Define a LoggingSettings struct to use for InitLogging()

Update all callers of InitLogging() to use LoggingSettings, only
setting fields that need a non-default value.

Turn LoggingDestination enum into a bit field and define add
LOG_DEFAULT and LOG_ALL constants.

Fix erroneous comment saying that the default was to not lock
the log file.

BUG=247594
TBR=brettw@chromium.org, cpu@chromium.org, gene@chromium.org, jam@chromium.org, rch@chromium.org, scherkus@chromium.org, sergeyu@chromium.org, sky@chromium.org, tkent@chromium.org, yfriedman@chromium.org, zea@chromium.org

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

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

13 months agoDifferential updates for components. We are adding support for delivering delta updat...
sorin@chromium.org [Fri, 21 Jun 2013 20:41:36 +0000 (20:41 +0000)]
Differential updates for components. We are adding support for delivering delta updates for Chrome components. Initial platform support for the patcher is Windows only. The update response includes both the full update and, if available, the differential update. The differential update is tried first, then the full update, if needed.

BUG=245318

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

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

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

13 months agoRevert 207805 "Differential updates for components. We are addin..."
dmichael@chromium.org [Fri, 21 Jun 2013 15:20:49 +0000 (15:20 +0000)]
Revert 207805 "Differential updates for components. We are addin..."

Unit tests fail on Mac Dbg with this patch:
http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac%2010.6%20Tests%20%28dbg%29%284%29&number=29470
and
http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac%2010.7%20Tests%20%28dbg%29%284%29&number=12750

> Differential updates for components. We are adding support for delivering delta updates for Chrome components. Initial platform support for the patcher is Windows only. The update response includes both the full update and, if available, the differential update. The differential update is tried first, then the full update, if needed.
>
> BUG=245318
>
> Review URL: https://chromiumcodereview.appspot.com/15908002

TBR=sorin@chromium.org

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

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

13 months agoDifferential updates for components. We are adding support for delivering delta updat...
sorin@chromium.org [Fri, 21 Jun 2013 14:20:13 +0000 (14:20 +0000)]
Differential updates for components. We are adding support for delivering delta updates for Chrome components. Initial platform support for the patcher is Windows only. The update response includes both the full update and, if available, the differential update. The differential update is tried first, then the full update, if needed.

BUG=245318

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

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

13 months agoFactored out common ELF processing into a common superclass, an x86 subclass, and...
paulgazz@chromium.org [Thu, 20 Jun 2013 10:17:53 +0000 (10:17 +0000)]
Factored out common ELF processing into a common superclass, an x86 subclass, and an initial ARM subclass.

Created a new disassembler virtual class, DisassemblerElf32, that
implements the common functions for processing ELF 32-bit files.  This
class is defined in disassembler_elf_32.{h|cc}, and has nearly all of
the methods and data that used to be in
disassembler_elf_32_x86.{h|cc}.  This class has two subclasses, one
for x86 and one for arm, which implement the architecture-specific
parts for generating courgette patches, namely extracting relative and
absolute addresses.  The ARM subclass is just a shell, but still
yields correct courgette patches.

The rest of the files add new enums for ARM and use the ARM subclasses
for the courgette command-line tool.

BUG=

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

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

13 months agoCreated a script to measure the size of payloads made by courgette, bsdiff, and both.
paulgazz@chromium.org [Wed, 19 Jun 2013 13:09:02 +0000 (13:09 +0000)]
Created a script to measure the size of payloads made by courgette, bsdiff, and both.

Also, the stress tester is updated to remove compressing the bsdiff patch, since the command-line bsdiff tool already compresses the patch.

BUG=244607

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

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

13 months agoFixed a bug where courgette would fail if a relocation entry pointed to a section...
paulgazz@chromium.org [Wed, 12 Jun 2013 18:12:07 +0000 (18:12 +0000)]
Fixed a bug where courgette would fail if a relocation entry pointed to a section that isn't a progbits section, e.g., an init_array section

This fix will check whether the relocation address is inside of an ELF section that isn't PROGBITS, and skip the relocation address if it is inside.

BUG=246763

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

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

13 months agoRename base/hash_tables to base/containers/hash_tables.
brettw@chromium.org [Tue, 11 Jun 2013 17:52:44 +0000 (17:52 +0000)]
Rename base/hash_tables to base/containers/hash_tables.

Remove forwarding header

BUG=
R=avi@chromium.org

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

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

13 months agoUse a direct include of strings headers in courgette/.
avi@chromium.org [Tue, 11 Jun 2013 13:26:25 +0000 (13:26 +0000)]
Use a direct include of strings headers in courgette/.

BUG=247723
TEST=none
TBR=ben@chromium.org

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

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

13 months agoUse a direct include of utf_string_conversions.h in chrome_frame/, chromeos/, cloud_p...
avi@chromium.org [Fri, 7 Jun 2013 22:23:48 +0000 (22:23 +0000)]
Use a direct include of utf_string_conversions.h in chrome_frame/, chromeos/, cloud_print/, components/, courgette/, device/, extensions/.

BUG=none
TEST=none
TBR=ben@chromium.org

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

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

13 months agoInitial commit of the courgette stress tester script
paulgazz@chromium.org [Tue, 4 Jun 2013 06:14:24 +0000 (06:14 +0000)]
Initial commit of the courgette stress tester script

BUG=244603

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

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

14 months agoCleanup: Remove unneeded base/file_util.h includes in chrome_frame, courgette, ipc...
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

14 months 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

15 months 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

15 months 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

15 months 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

15 months 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

16 months 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

16 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

17 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

17 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

17 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

17 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

17 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

18 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

3 years 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

3 years 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

3 years 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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