0
Commit Graph

60 Commits

Author SHA1 Message Date
Alan Zhao
66e43855c5 Explicitly #include <utility> in snippet.h
snippet.h uses std::pair, which is currently provided via <utility> via
a transitive include in libc++ that is not guaranteed to exist and will
go away once libc++ is modularized.

Bug: 543704
Change-Id: I568188fd60dc88d6206fd37ed1779c6217c3b636
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4289668
Auto-Submit: Alan Zhao <ayzhao@google.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1109385}
2023-02-24 01:44:40 +00:00
Avi Drissman
8ba1bad80d Update copyright headers in components/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: If6a3370b0b2849d889ce797596fe1ccbad2f3fe6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3891619
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1046502}
2022-09-13 19:22:36 +00:00
Daniel Cheng
7b7aaecca4 Migrate base::{size,empty,data} to STL equivalents in //components.
Bug: 1299695
Change-Id: Ia2ef2239d649b2a50569cad9b3f293ca23510b68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3491962
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#975484}
2022-02-26 17:57:25 +00:00
Peter Boström
b9e2c27ca6 Remove unused "base/macros.h" in components/
Removes `#include "base/macros.h"` from files in components/ that do not
contain `ignore_result(`.

Bug: 1010217
Change-Id: Ic1ea0c59d63652bc896e80638a7ff919c872f1c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3275012
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940666}
2021-11-11 05:31:49 +00:00
Peter Boström
09c0182fae Replace DISALLOW_COPY_AND_ASSIGN in components/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: I917bfbff1357e9e2cfe330d242feff6bb73e1bce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167004
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923103}
2021-09-20 22:43:27 +00:00
manukh
2e18f9a910 [memories] Tighten omnibox action chip matching to exact matches only
This CL makes the omnibox action chip for the Memories / Journeys
feature only admit exact matches.

This should reduce the amount that the action chip triggers, which was
previously triggering for almost everything.

I suspect this will still trigger quite a lot.

It also adds some new functionality in QueryParser component to support
this exact matching.

Bug: 1208958, 1171352
Change-Id: Ia57cdd2081b886612a425547f8a94400c91def1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3130588
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sophie Chang <sophiechang@chromium.org>
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#917460}
2021-09-01 23:52:23 +00:00
Hans Wennborg
e93e9b2565 Reland "[base] Don't include <ostream> in string_piece.h"
This is a reland of 472bf833d1
Includes fix for fuchsia-x64-dbg in
components/viz/service/surfaces/surface_reference.cc

Original change's description:
> [base] Don't include <ostream> in string_piece.h
>
> It's not needed, and adds ca 200 MB of compiler input to the build.
>
> This also adds an implementation of CHECK_OP's "argument stringification"
> function for std::string values, since those previously relied on
> operator<< for stringification which would now require including
> <ostream> in many new files.
>
> Bug: 242216
> Change-Id: I34807204a82e622e50a5bbcabb7055c0b2f51f21
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3009579
> Commit-Queue: Hans Wennborg <hans@chromium.org>
> Reviewed-by: danakj <danakj@chromium.org>
> Owners-Override: danakj <danakj@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#900025}

Cq-Include-Trybots: luci.chromium.try:fuchsia-compile-x64-dbg
Bug: 242216
Change-Id: Ibdf16a1ec0307bd94aed2bfb327b7c64317e96bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3015330
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900528}
2021-07-12 16:58:29 +00:00
Peter Williamson
1e83eef107 Revert "[base] Don't include <ostream> in string_piece.h"
This reverts commit 472bf833d1.

Reason for revert: Breaks the build.
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8842170960527832208/+/u/compile/stdout?format=raw

It looks like surface_reference.cc didn't get a complete definition of string

Original change's description:
> [base] Don't include <ostream> in string_piece.h
>
> It's not needed, and adds ca 200 MB of compiler input to the build.
>
> This also adds an implementation of CHECK_OP's "argument stringification"
> function for std::string values, since those previously relied on
> operator<< for stringification which would now require including
> <ostream> in many new files.
>
> Bug: 242216
> Change-Id: I34807204a82e622e50a5bbcabb7055c0b2f51f21
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3009579
> Commit-Queue: Hans Wennborg <hans@chromium.org>
> Reviewed-by: danakj <danakj@chromium.org>
> Owners-Override: danakj <danakj@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#900025}

Bug: 242216
Change-Id: Ib735d7e6687dabca68f0073920f568679cb03bdb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3017486
Auto-Submit: Peter Williamson <petewil@chromium.org>
Reviewed-by: Peter Williamson <petewil@chromium.org>
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Owners-Override: Peter Williamson <petewil@chromium.org>
Owners-Override: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900045}
2021-07-09 17:06:45 +00:00
Hans Wennborg
472bf833d1 [base] Don't include <ostream> in string_piece.h
It's not needed, and adds ca 200 MB of compiler input to the build.

This also adds an implementation of CHECK_OP's "argument stringification"
function for std::string values, since those previously relied on
operator<< for stringification which would now require including
<ostream> in many new files.

Bug: 242216
Change-Id: I34807204a82e622e50a5bbcabb7055c0b2f51f21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3009579
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900025}
2021-07-09 15:34:54 +00:00
Lei Zhang
d073f65fc0 Swap from base/stl_util.h to cxx17_backports.h in components/ .cc files.
base::size() has been moved to base/cxx17_backports.h, so .cc files that
use base::size(), but no other function from base/stl_util.h, can
directly include base/cxx17_backports.h and not base/stl_util.h.

Bug: 1210983
Change-Id: I445378492ab1193ea76ca0c0b9958e9cb9c4ca0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2915464
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Commit-Queue: Greg Kerr <kerrnel@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886365}
2021-05-25 17:43:06 +00:00
Tommy Li
fecf98cb6d [memories] Make Searching work against Remote Endpoint provided clusters
Previously, searching with a query against remote-endpoint provided
clusters didn't work, because the keyword match had a problem with
uppercase keywords.

This CL fixes that and adds a test.

It also changes the match mode to DEFAULT, which I think it closer to
our product intention.

It also adds a DCHECK to the QueryParser class to guard against this
footgun in the future.

Bug: 1179068, 1171352
Change-Id: I373efa3acc1c00c99d7d671bb30fcdc0deafc2b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2878915
Commit-Queue: Tommy Li <tommycli@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: manuk hovanesian <manukh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880216}
2021-05-07 02:29:04 +00:00
Jan Wilken Dörrie
756999e8b7 [LSC] Remove base::ASCIIToUTF16("...") in //components
This change removes calls to base::ASCIIToUTF16 in //components with a
single-line string literal and replaces them with a u"..." literal
instead. Files where this change would cause compilation errors were not
changed.

This is a mechanical change:

$ git grep -lw ASCIIToUTF16 components | xargs \
    sed -i 's/\(base::\)\?ASCIIToUTF16(\("\(\\.\|[^\\"]\)*"\))/u\2/g'
$ git cl format

Bug: 1189439
Change-Id: Ie31fb5af442621ca093c5dfc46b69c846307731a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2780083
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865632}
2021-03-23 15:05:24 +00:00
Jan Wilken Dörrie
2c470ea5c9 [LSC] Remove UTF8ToUTF16 from Literals without Escape Sequences
This change removes calls to base::UTF8ToUTF16 with a single-line string
literal not containing escape sequences and replaces them with a u"..."
literal instead.

This is a mechanical change:
$ git grep -lw UTF8ToUTF16 | \
      xargs sed -i 's/\(base::\)\?UTF8ToUTF16(\("[^\\"]*"\))/u\2/g'
$ git cl format

AX-Relnotes: n/a.

Bug: 1189439
Change-Id: I6df2e531f62926a12be3f610ce8627d94ec407f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2776021
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865390}
2021-03-22 22:26:24 +00:00
Jan Wilken Dörrie
09a4396a44 [LSC] Remove base/strings/string16.h #includes
This change removes #includes of base/strings/string16.h from the
codebase.

Bug: 1184339
Change-Id: I3b29dd94c6955d01029d24f88177b755863c865d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2756167
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Owners-Override: Jan Wilken Dörrie <jdoerrie@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862683}
2021-03-14 19:20:08 +00:00
Jan Wilken Dörrie
fa241bad9f [LSC] Replace base::string16 with std::u16string in //components
This change replaces base::string16 with std::u16string in //components.

Reproduction steps:
$ git grep -lw 'base::string16' components | \
      xargs sed -i 's/\bbase::string16\b/std::u16string/g'
$ git cl format

Bug: 1184339
Change-Id: Ifd99bc43ca04810a480466369b5cd6680bbe89ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752068
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862035}
2021-03-11 17:57:01 +00:00
Jan Wilken Dörrie
ad587c3edb [LSC] Add #include <string> to prepare for removal of base::string16
This change adds #include <string> to files currently including
"base/strings/string16.h". This prepares these files for the planned
removal of the base::string16 alias.

In order to adhere to the style guide [1] the following logic was
performed:

* Insert into an existing block of C++ STL includes, if possible
* Else insert `#include <string>` followed by a newline before the first
  #include "some_header.h" line that is not referring to a matching header
  (only relevant for implementation and test files)

[1] https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes

Bug: 1184339
Change-Id: I96660fec3fff0192d53e9728bbbae86228a52c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2749296
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Owners-Override: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#861966}
2021-03-11 14:09:27 +00:00
manukh
36a2258714 Rename params and rephrase comments for QueryParser::DoesQueryMatch.
The params were previoulsy named "text", "query_words", & "query_nodes".
It was unclear which param was being searched in and which param was
being searched for.

This CL renames the params to "find_in_text", "find_in_words", &
"find_nodes".

Change-Id: I3d3f3daa63fc4422936cafd3347f7d6bbb02fed6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690177
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#853413}
2021-02-12 06:13:40 +00:00
manukh
217cc4cf7a Make QueryParser methods static.
The class has no members or state. Making its methods static allows
callers to avoid having to construct an instance or be passed an
instance before invoking its methods.

Change-Id: I5b4d879593e97765f6a76574bb22084304a08da0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2689032
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#853351}
2021-02-12 01:49:05 +00:00
Norman Rosas
90a236ac5d Added DIR_METADATA files to a batch of subfolders in //components/q… and
//components/r… also removed duplicated metadata from OWNERS files

Bug: 1113033
Change-Id: Idf79214ca7fafb82c3808068e46d3b02966fc922
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2570198
Auto-Submit: Norman Rosas <normando@google.com>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833436}
2020-12-03 20:58:12 +00:00
Hans Wennborg
df87046cb8 Remove/replace unnecessary logging.h includes in .cc files (components)
CHECK, CHECK_EQ etc., and NOTREACHED/NOTIMPLEMENTED have moved
to the much smaller headers check.h, check_op.h, and notreached.h,
respectively.

This CL updates .cc files to use those headers instead when
possible, with the purpose of saving compile time.

(Split out from https://crrev.com/c/2164525 which also has
notes on how the change was generated.)

Bug: 1031540
Change-Id: I1c0c8450be6320577ebebe39a2cb1abc692fe8b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164613
Commit-Queue: Hans Wennborg <hans@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763287}
2020-04-28 11:06:24 +00:00
Daniel McArdle
d62953a65f Add AtExitManager to query_parser_fuzzer
Bug: 1074601
Change-Id: Ied6e4b667a43f1bfb51313671cbbb9437243f4e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167575
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763027}
2020-04-27 21:39:19 +00:00
Nico Weber
647392b66b Reformat all gn files in /components/query_parser.
`gn format` recently changed its formatting behavior
for deps, source, and a few other elements when they
are assigned (with =) single-element lists to be consistent
with the formatting of updates (with +=) with single-element.

Now that we've rolled in a GN binary with the change,
reformat all files so that people don't get presubmit
warnings due to this.

This CL was uploaded by git cl split.

R=sky@chromium.org

Bug: 1041419
Change-Id: I1df130dbe6275b89218441287ab13e58544ef78a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1997947
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730686}
2020-01-13 19:06:28 +00:00
Daniel McArdle
48d41d7212 query_parser_fuzzer: Abort early on large inputs
In the attached bug, the query_parser::ParseQueryImpl function is
timing out after 25 seconds while parsing a large input (109K). The
problem appears to be that the ICU function |ubrk_next| is a little
slow. There isn't anything obvious we can do to improve performance,
so we will now reject inputs that are larger than ~1/2 of the "bad"
input's size.

Bug: 1015888
Change-Id: Icd3b1bcf30714fd39ef6700e0f44fbf09efa3c82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1869771
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707678}
2019-10-20 17:03:16 +00:00
Daniel McArdle
32eeca8dc0 Improve speed of QueryNodeList::RemoveEmptySubnodes
Reduces complexity from O(n^2) to O(n).  Prior to this commit, we were
performing an O(n) vector::erase for each empty child, say O(n) of
them. Now, we do an amortized constant vector::push_back for each
child to keep, along with O(n) constant-time vector::swap operations.

Bug: 1014388
Change-Id: I4e614463c5ac207dd036876a54e65cca8ce0ed25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863154
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706175}
2019-10-15 22:00:11 +00:00
Daniel McArdle
a8e1bf0700 Initialize ICU in query_parser_fuzzer
Bug: 1013545
Change-Id: I3780efe1bdddcf02bf0c9cfa880a36b4cf67b067
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1856802
Reviewed-by: Abhishek Arya <inferno@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705597}
2019-10-14 18:09:47 +00:00
Daniel McArdle
f4d4c68787 Add query_parser_fuzzer for component query_parser::QueryParser
Bug: 1012848
Change-Id: If0b9c22bcf3d8341d826dfbc718fe47ebb6328ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850432
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704609}
2019-10-10 13:58:52 +00:00
Eric Foo
f4ac408be2 OWNERS files updated with latest COMPONENT and TEAMS.
This is CL is generated by a script. Data is pulled from
review conducted in Q2 2019. See https://tinyurl.com/yxau5sc4
for context.

Please review and LGTM before July 16th or the CL will be
submitted as-is.

TBR=sky@chromium.org
NOTRY=true

Bug: 977050
Change-Id: I931d31a5f716e469e52e85fdaa0ff9781febba00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1700842
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Scott Violet <sky@chromium.org>
Auto-Submit: Eric Foo <efoo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678275}
2019-07-17 14:54:13 +00:00
Nico Weber
ec858f79ed Remove a few unnecessary semicolons.
Bug: 926235
Change-Id: I3a65db96b88035f4953a169e79a718ac3252e339
Reviewed-on: https://chromium-review.googlesource.com/c/1463160
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632410}
2019-02-15 00:28:32 +00:00
Nico Weber
199cd029e4 Remove a few semicolons.
No behavior change.

Bug: 926235
Change-Id: I731ae4f33079088d62b0748c99663fb9c5667fff
Reviewed-on: https://chromium-review.googlesource.com/c/1458680
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630025}
2019-02-07 19:07:54 +00:00
Avi Drissman
2244c2d53c Use base::size rather than arraysize in components/.
This is purely a mechanical change; there is no intended behavior change.

BUG=837308
TBR=caitkp@chromium.org

Change-Id: Ic548dc0e6bc08a177987c7b6c1f2eed1db8023fd
Reviewed-on: https://chromium-review.googlesource.com/c/1390897
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618888}
2018-12-25 23:08:02 +00:00
jdoerrie
3feb1854e1 [clang-tidy] Apply modernize-use-auto in /components
This change applies clang-tidy's modernize-use-auto [1] in /components.
This change does not rewrite new and cast expressions.

Reproduction steps:
- run clang-tidy's modernize-use-auto
- run git cl format
- manually remove unused typedefs due to -Wunused-local-typedef error

[1] https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html

This CL was uploaded by git cl split.

R=jochen@chromium.org

Bug: 890902
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: Ibbb775036736e0b07c6ce5393569ed40878b5c62
Reviewed-on: https://chromium-review.googlesource.com/c/1257852
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597078}
2018-10-05 12:16:44 +00:00
Daniel Cheng
62ede92bcf Change various move constructors to be noexcept = default.
Declaring move constructors and assignment operators noexcept
allows STL containers to use moves instead of copies, which is
generally more efficient.

Previously, there were compiler issues that prevented this from
working [1]. They seem to have mysteriously fixed themselves
and testing on https://godbolt.org/g/TqfqtK seems to indicate that
the previously highlighted problematic test cases now work.

[1] https://groups.google.com/a/chromium.org/forum/#!topic/cxx/ze4WJFg7RvU

Bug: 706963
Change-Id: Ieb73b4c53ab4235838265f1d968d2a57aa34a737
Reviewed-on: https://chromium-review.googlesource.com/1003872
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549678}
2018-04-10 23:37:27 +00:00
Brett Wilson
c466dc805f Remove brettw from owners files.
Removes myself from all owners files except tools/gn.

Replace myself with dpranke for owners of BUILDCONFIG.gn

TBR=jam@chromium.org

Change-Id: I015c6724ba04c07a9954107e1f5319ff3ef480ce
Reviewed-on: https://chromium-review.googlesource.com/891669
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Brett Wilson <brettw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532534}
2018-01-29 19:20:12 +00:00
Gyuyoung Kim
8b084c0832 Replace base::MakeUnique with std::make_unique in components/ - 2
If file doesn't use base::WrapUnique, base/memory/ptr_util.h includes
are changed to <memory>.

Bug: 755727
Change-Id: I6fc3a696a2222e140d6d366b2bc9b285fdef2dbc
Reviewed-on: https://chromium-review.googlesource.com/878083
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung.kim@lge.com>
Cr-Commit-Position: refs/heads/master@{#531218}
2018-01-23 13:34:37 +00:00
Ivan Kotenkov
75b1c3aed7 Convert 0 and NULL to nullptr in components.
Steps to replicate:
1. Build clang-tidy and clang-apply-replacements as described here: https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md
2. Build targets necessary for the change in out/gn.
3. Generate the compilation database:
  tools/clang/scripts/generate_compdb.py -p out/gn > compile_commands.json
4. Run clang-tidy and apply replacements:
  cd out/gn && PATH_TO_RUN_CLANG_TIDY/run-clang-tidy.py -p ../../ -clang-tidy-binary PATH_TO_CLANG_TIDY_BINARY -clang-apply-replacements-binary PATH_TO_CLANG_APPLY_REPLACEMENTS_BINARY -checks=-*,modernize-use-nullptr -fix -j 8 DIR_TO_CONVERT

Bug: 403854, 776257
Change-Id: Ifd0c147ac6866beacffbddb0c56b20502cb4f127
Reviewed-on: https://chromium-review.googlesource.com/732308
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Ivan Kotenkov <kotenkov@yandex-team.ru>
Cr-Commit-Position: refs/heads/master@{#511144}
2017-10-24 14:47:24 +00:00
brettw
57694b362c Some C++11 cleanup of history types.
History has a lot of vectors of structs that include things like URLs and strings that could benefit from move constructors. This implements move constructors on such classes in history_types.h.

Moves initialization of many values from explicit constructor initializer lists to the class definition for clarity and de-duplication. For URLRow this allowed removing the Initialize() helper function.

Some structs were using implicitly defined copy and assignment operators. These are defined now so they can be out-of-line for code bloat reasons.

An unused constructor on URLResult is removed.

Out-of-date references to dirty bits in comments in URLRow are removed. These dirty bits no longer exist.

Friend declarations in URLRow (these were related to handling of the aforementioned dirty bits) were removed and two places depending on these friend declarations were changed to use set_*() functions instead. A set_url() function was added which was the only missing setter.

Review-Url: https://codereview.chromium.org/2781263002
Cr-Commit-Position: refs/heads/master@{#461159}
2017-03-31 17:23:40 +00:00
avi
8e000a71c7 Remove stl_util's deletion function use from components/query_parser/.
BUG=555865, 554289

Review-Url: https://codereview.chromium.org/2463683002
Cr-Commit-Position: refs/heads/master@{#429341}
2016-11-02 18:08:55 +00:00
skyostil
4638441024 components: Use stl utilities from the base namespace
The utilities in base/stl_util.h have been moved from the global
into the base namespace. This patch updates the call sites accordingly.

No functional changes.

This patch was generated with the following script:
https://drive.google.com/open?id=0ByyxMXB38gLDNXJFaUdVbjhoemM

BUG=636301

Review-Url: https://codereview.chromium.org/2231753002
Cr-Commit-Position: refs/heads/master@{#411644}
2016-08-12 14:36:15 +00:00
dcheng
82beb4ff41 Convert //components/[o-t]* from scoped_ptr to std::unique_ptr
BUG=554298
R=danakj@chromium.org
TBR=jochen@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#389637}
2016-04-26 00:36:40 +00:00
vmpstr
b6449d51ce components: Add out-of-line copy ctors for complex classes.
This patch adds out of line copy constructors for classes that our
clang-plugin considers heavy. This is an effort to enable copy
constructor checks by default.

BUG=436357
R=jochen@chromium.org, dcheng@chromium.org, thakis@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

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

Cr-Commit-Position: refs/heads/master@{#377717}
2016-02-25 23:56:46 +00:00
avi
f57136c138 Switch to standard integer types in components/, part 3 of 4.
BUG=138542
TBR=blundell@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#366874}
2015-12-25 23:28:47 +00:00
brettw
15764b1f1b Add more components to "gn check", work on dom_distiller.
Added components are:
  bitmap_uploader
  browser_sync
  dom_distiller
  exp
  proxy_config
  query_parser
  rappor
  renderer_context_menu
  resource_provider
  resources
  rlz
  safe_browsing_db
  safe_json
  scheduler
  search

The dom distiller GN build was a little messed up. The JNI registrar files were in core but referenced files in content. I moved the registrar files to content/browser which is where they're needed and matches some other components. There were also some other duplicated java targets, and I split out the content build file into separate subdirectories and renamed the targets to match.

TBR=dpranke@chromium.org
BUG=562773

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

Cr-Commit-Position: refs/heads/master@{#362234}
2015-11-30 22:12:01 +00:00
brettw
b4bb70f084 Add more components tests to GN build.
visitedlink, query_parser, web_cache, autofill

CQ_EXTRA_TRYBOTS=tryserver.chromium.mac:mac_chromium_gn_rel;tryserver.chromium.win:win8_chromium_gn_dbg
TBR=-dpranke@chromium.org

Reland of http://crrev.com/1303013005#ps40001

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

Cr-Commit-Position: refs/heads/master@{#345010}
2015-08-23 18:32:21 +00:00
tommi
d5661a88da Revert of Add more components tests to GN build. (patchset id:40001 of https://codereview.chromium.org/1303013005/ )
Reason for revert:
Breaks compile on the Win GN bot:

http://build.chromium.org/p/chromium.win/buildstatus?builder=Win%20x64%20GN%20%28dbg%29&number=8108

http://build.chromium.org/p/chromium.win/builders/Win%20x64%20GN%20%28dbg%29/builds/8108/steps/compile/logs/stdio

Original issue's description:
> Add more components tests to GN build.
>
> visitedlink, query_parser, web_cache, autofill
>
> CQ_EXTRA_TRYBOTS=tryserver.chromium.mac:mac_chromium_gn_rel
> TBR=-dpranke@chromium.org
>
> Committed: https://crrev.com/0eb6b59c463a0aa9dd01956b5542b8cf158e835a
> Cr-Commit-Position: refs/heads/master@{#344993}

TBR=dpranke@chromium.org,brettw@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#344999}
2015-08-23 08:39:32 +00:00
brettw
0eb6b59c46 Add more components tests to GN build.
visitedlink, query_parser, web_cache, autofill

CQ_EXTRA_TRYBOTS=tryserver.chromium.mac:mac_chromium_gn_rel
TBR=-dpranke@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#344993}
2015-08-22 23:37:22 +00:00
brettw
fce8d19805 Replace ToLower calls to the new format
Replaces
  base::StringToLowerASCII(string)
with
  base::ToLowerASCII(string)
This form is 1:1 search and replace.

A bunch of places did something like this:
  std::string foo(something_else);
  base::StringToLowerASCII(&foo);
which became:
  foo = base::ToLowerASCII(something_else);

A couple places really wanted in-place changing and they became:
  foo = base::ToLowerASCII(foo);

There was pretty trivial cleanup in chrome_main_delegate.cc chrome/test/chromedriver/server/http_handler.cc (fix indenting).

There was more cleanup in:
chrome/installer/util/language_selector.cc and components/plugins/renderer/mobile_youtube_plugin.cc

In components/history/core/browser/url_utils.cc I removed the call since it was calling ToLower on the host name out of a GURL, which is already guaranteed to be lower-case.

NOPRESUBMIT=true
(due to touching code with wstrings)

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

Cr-Commit-Position: refs/heads/master@{#342659}
2015-08-10 19:08:31 +00:00
brettw
8be197d144 Update SplitString calls in components
This converts calls from the old form to the new form. Some calls that iterated over the results were changed to a range-based for loop with an inline call to SplitString. Some places were changed to use StringPieces when it was safe to do so.

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

Cr-Commit-Position: refs/heads/master@{#340209}
2015-07-23 23:25:00 +00:00
kkimlabs
f1a7a37376 Allow systematic prefix search in bookmarks.
This CL allows the bookmark model's search to always use prefix search, even
when terms are too short.

BUG=415774

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

Cr-Commit-Position: refs/heads/master@{#302598}
2014-11-04 10:31:47 +00:00
dcheng
00ea022b81 Standardize usage of virtual/override/final in components/
BUG=417463
TBR=blundell@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#300456}
2014-10-21 11:25:34 +00:00
viettrungluu
37a447b86b Convert ARRAYSIZE_UNSAFE -> arraysize in components/.
BUG=423134

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

Cr-Commit-Position: refs/heads/master@{#299934}
2014-10-16 18:24:13 +00:00