This change deprecates arraysize in favor of base::size(array) and adds
a corresponding PRESUBMIT warning to discourage further usage.
Bug: 837308
Change-Id: Iedd676f691cb46ca4a108462cedefbe91690240b
Reviewed-on: https://chromium-review.googlesource.com/1030333
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554351}
Rather than forcing enums to define a kMaxValue enumerator and
manually update it, just automatically generate it for mojo
enums. kMaxValue shares the value of the highest enumerator:
this is done to avoid switch statements having to handle useless
sentinel values.
However, since the UMA histogram macros for enums require that
the boundary is 1 greater than the highest legal value, also
add a new helper that automatically calculate boundary based on
the existence of Enum::kMaxValue to avoid awkward static_casts
to int and then back to the enum type.
Bug: 742517
Tbr: sky@chromium.org
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I84b1985c9d93b6ca7576947936f3dc9cd9ec22c8
Reviewed-on: https://chromium-review.googlesource.com/982944
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547276}
This is simlar to base::LazyInstance<T>::Leaky but intended for use in
function-local scope.
This is intended to be a drop-in replacement for:
- CR_DEFINE_STATIC_LOCAL(...); in function scope
- static T* x = new X; in function scope
- static T& x = *new X; in function scope
- base::LazyInstance<T> x; in global scope
and should be preferred in new code.
Change-Id: I75eda47e7dca8205f4086bd298839c261454a3e7
Reviewed-on: https://chromium-review.googlesource.com/869351
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530361}
Currently, seccomp_bpf is not supported on mips64el, and the build
configuration sets use_seccomp_bpf=false on mips64el. This CL adds support
for seccomp-bpf on mips64el, and resolves many compiler errors when
compiling on mips64el.
R= machenbach@chromium.org, brettw@chromium.org
TBR=jorgelo
Bug: 742738
Change-Id: I79c5d1800c0a198a70c1f19a818885b726cbcc4f
Reviewed-on: https://chromium-review.googlesource.com/571385
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Chris Palmer <palmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502712}
Since the DISALLOW_* macros now use the C++11 syntax "= delete", it
does not matter whether they are used in the public or the private
section of a class definition.
In fact, the style guide recomments putting deleted constructors or
assignment operators in the public section.
Thus, remove the hint to put them in the private: declarations.
Drive-by: Fix the syntax of the deleted copy assignment operator.
R=thakis@chromium.org
Change-Id: I10af0d71c18dc1f3b08e4601ae571ed53d8c71e3
Reviewed-on: https://chromium-review.googlesource.com/578027
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488172}
This enables the new implementation all the time.
BUG=447156
TEST=none
TBR=thakis
Review-Url: https://codereview.chromium.org/2017213002
Cr-Commit-Position: refs/heads/master@{#396628}
This enables the new implementation on all platforms, but only for non-branded
builds. Since the CQ doesn't include these by default, the chance of breaking
them is greater.
Stage three will be to enable this all the time.
BUG=447156
TEST=none
TBR=thakis
Review-Url: https://codereview.chromium.org/2017813002
Cr-Commit-Position: refs/heads/master@{#396380}
This lands the new implementation for only (non-CrOS) Linux. Hopefully this
will prevent regressions in cross-platform code while other platforms are
brought up.
BUG=447156
TEST=none
Review-Url: https://codereview.chromium.org/2006733006
Cr-Commit-Position: refs/heads/master@{#396295}
There isn't much that uses bit_cast. bit_cast requires memcpy which
requires <string.h>
On Mac, <string.h> includes AvailabilityInternal.h which is half a
megabyte and defines dozens of macros. Providing <string.h> in
base/macros.h also tempts IWYU violations. Try to avoid it.
Add base/bit_cast.h and include it from the 17 files that need it. Then
remove the <string.h> #include from base/macros.h and IWYU.
BUG=395001
Review URL: https://codereview.chromium.org/399313006
Cr-Commit-Position: refs/heads/master@{#369348}
Looks like nothing needs it anymore, everything uses the
DISALLOW_COPY_AND_ASSIGN spelling these days.
No behavior change.
BUG=none
NOTRY=true
Review URL: https://codereview.chromium.org/1499933002
Cr-Commit-Position: refs/heads/master@{#363223}
This will guarantee the error to be at compile time, and not rely on
the call visibility (private).
DISALLOW_COPY_AND_ASSIGN and DISSALOW_IMPLICIT_CONSTRUCTORS can't be
changed yet because they are redefine in different place in the code
base.
BUG=447156
Review URL: https://codereview.chromium.org/1151443003
Cr-Commit-Position: refs/heads/master@{#331017}
mojo redefines ArraySizeHelper in the mojo namespace. When arraysize is used
in the mojo namespace, with both version in scope, the compiler, on android, is complaining that the reference is
not unique. To prevent this, qualify the usage of ArraySizeHelper in
base/macros.h
Review URL: https://codereview.chromium.org/804023002
Cr-Commit-Position: refs/heads/master@{#315290}
Include it directly in files which want it.
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/733763003
Cr-Commit-Position: refs/heads/master@{#305137}
Document the old-school types as deprecated, now that we use stdint.h
everywhere.
R=brettw@chromium.org
BUG=138542
Review URL: https://codereview.chromium.org/127293002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243653 0039d316-1c4b-4281-b951-d872f2087c98