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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
`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}
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}
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}
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}
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}
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}
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}
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}
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}
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}