27 Commits
Author SHA1 Message Date
Darnell Andries d4c72967f9 Extend OHTTP client to support relay headers and chunking (#36292)
* Extend OHTTP client to support relay headers and chunking

* Address PR feedback
2026-05-20 19:44:18 +01:00
Darnell Andries edfcf48e1f Add ObliviousHttpChunkProcessor to enable chunked OHTTP (#36291)
* Add `ObliviousHttpChunkProcessor` to enable chunked OHTTP

* Address PR feedback

* Address PR feedback
2026-05-15 00:23:35 +01:00
cdesouza-chromium 5eb666f034 [CodeHealth] Run gn format on all files (#30448)
This PR is the run of `gn format` on all `gn` files. This is a
mechanical change done with:

```sh
git ls-files -- "*.gn" | xargs gn format
git ls-files -- "*.gni" | xargs gn format
```

This change has been motivated primarily by an improvement to the
formatters privided by `gn` correcting cases of redundant target naming,
i.e cases where `//foo:foo` is used, and should just be `//foo`.

For this particular `gn` change, see:
https://chromium.googlesource.com/chromium/src/+/c822490a82cdb6ad479159683a92858f7c6f0a58

Resolves https://github.com/brave/brave-browser/issues/48161
2025-08-05 18:08:10 +01:00
cdesouza-chromium 821274796b [IWYU] Fixing logging inclusions pt.11 (#29531)
This change is one of many fixing inclusion for the following files:

    - `base/notimplemented.h`
    - `base/notreached.h`
    - `base/check.h`
    - `base/dcheck_is_on.h`
    - `base/check_deref.h`
    - `base/check_op.h`
    - `base/logging/log_severity.h`
    - `base/logging.h`

This change is a mechanical change done with the following script:
https://github.com/brave/brave-browser/issues/46707#issuecomment-2960116515

Resolves https://github.com/brave/brave-browser/issues/46707
2025-06-12 13:48:07 +01:00
cdesouza-chromium 713f6cd686 [CodeHealth] Remove CHECK(false) uses (#26602)
All uses of `CHECK(false)` are incorrect and should be either a
`NOTREACHED`, `LOG(ERROR)`, or higher `CHECK` that removed the enclosing
conditional code path.

Resolves https://github.com/brave/brave-browser/issues/42331
2024-11-18 16:13:27 +00:00
cdesouza-chromium 6da3839de9 [CodeHealth] Fix various use-after-move violations (#26526)
This change fixes several instances where use-after-move is possible in
our codebase. For potential use-after-move cases involving
`OnceCallback` instances, those are potential crahes in the application.

Additionally, this PR corrects the use of moved-from std containers. It
is valid to use a moved-from container, but it is expected that the
container is cleared before being used again.

Resolves https://github.com/brave/brave-browser/issues/42264
2024-11-13 23:59:32 +00:00
Anthony Tseng 957be1b9f1 Scale up bitmap size to fit in 300 dpi image to accomodate small fonts docs 2024-04-12 11:55:45 -07:00
Anthony Tseng cf0853f624 Use PreviewPageTextExtractor to convert every pdf page into image and OCR after
conversion. Also decouple OCR logic from FetchPageContent.
2024-04-12 11:55:45 -07:00
Anthony Tseng d2c55fa804 Share kMaxPreviewPages between PreviewPageTextExtractor and PdfToBitmapConverter 2024-04-12 11:55:45 -07:00
Anthony Tseng 9b931e1658 Fix deps and buildflag 2024-04-12 11:55:45 -07:00
Anthony Tseng fff56ebbda Merge extracted texts after OCR 2024-04-12 11:55:44 -07:00
Anthony Tseng 9099778cf6 Extract page content through print preview 2024-04-12 11:55:42 -07:00
Artem Samoilenko 8b88a2436e Replaced NOTREACHED with DCHECK in SystemRequestHandler::OnBeforeSystemRequest
Changing to DCHECK to avoid crash dump uploading as this is spamming our
Backtrace system at the moment.
Generally, if we get here, it means that `BraveBrowserProcessImpl::Init`
hasn't been called yet and so we don't need to apply our filters in this
case.
2024-04-04 08:47:33 -04:00
cdesouza-chromium b94efd40d1 Use base::NoDestructor rather than Singleton (#18846)
This change replaces all uses of `base::Singleton` across the codebase,
in favor of `base::NoDestructor`. This is following the a direction
taken upstream, in getting `base::Singleton` deleted.

LSC doc:
https://docs.google.com/document/d/1x1LqRQyfBOmpMkNQBYs7QBPSxLtuiImvmgcJYI_kaS4/edit?usp=sharing
2023-06-13 03:00:07 +01:00
Emerick Rogul 7d7bca1cef bind.h, callback{,_forward,_helpers}.h now located in //base/functionality
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/cd23b8b9d212daf06dde638488dbaa355d6651fa

commit cd23b8b9d212daf06dde638488dbaa355d6651fa
Author: Daniel Cheng <dcheng@chromium.org>
Date:   Fri Sep 16 17:16:24 2022 +0000

    Move bind.h, callback{,_forward,_helpers}.h into //base/functional

    Forwarding headers remain in the old locations to ease migration.
    Include paths for files in //base/functional/ are also fixed up to the
    new canonical path; remaining fixups are deferred until followups to
    minimize the risk of conflicts.

    Bug: 1364441
2023-02-22 06:29:17 -05:00
Claudio DeSouza 2987acef1e [CodeHealth] Clang tidy browser with use-equals-default V
This change corrects the constructors of several classes under
browser/, using clang-tidy's modernize-use-equals-default. Additionally,
this commit includes a few additional straggler files.
2022-08-17 15:48:08 +01:00
Mikhail 6387cfd7d4 Move a part of //brave/common to //brave/components (#13456)
* Move a part of //brave/common to //brave/components

* Fix lint issues

* Remove brave_features.*

* Fix android build

* Remove dead includes

* fix compilation

* Fix review issues

* Fix android gn check

* Revert patch changes

* Fix deps duplication & copyright

* Fix some DEPS/BUILD.gn contradictions

* gn format

* move sources.gni

* Fix nits

* Fix after rebase
2022-05-27 16:44:18 +07:00
Mario Sanchez Prada bbf5fd3fe9 Remove deprecated DISALLOW_ macros from Brave-specific code
Macros such as DISALLOW_COPY_AND_ASSIGN() are deprecated since r711900
per style arbitration [1]. This commit replaces the macros with deleted
constructors and methods, which is preferred by the Google C++ Style
Guide [2][3].

Also remove unneeded "base/macros.h" #includes when possible.

This CL is created semi-mechanically with remove_disallow and
remove_base_macros [4].

[1]: https://groups.google.com/a/chromium.org/g/cxx/c/qwH2hxaEjac/m/TUKq6eqfCwAJ
[2]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability
[3]: https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types
[4]: https://pkg.go.dev/go.timothygu.me/tools/cr/cmd

Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/d002a3bee7ae75780b604d17df19291a3dd303fb

commit d002a3bee7ae75780b604d17df19291a3dd303fb
Author: Peter Boström <pbos@chromium.org>
Date:   Fri Nov 5 17:17:19 2021 +0000

    Remove DISALLOW_ macros from base/macros.h

    This removes DISALLOW_COPY(), DISALLOW_ASSIGN() and
    DISALLOW_COPY_AND_ASSIGN() from base/macros.h. PRESUBMITs are also
    updated to no longer check for these macros.

    IWYU removal is left as a separate change just in case this needs to be
    reverted.

    Bug: 1010217
2022-01-24 15:33:37 -05:00
Mario Sanchez Prada 5de37dafc8 Fix build due to missing include for network::ResourceRequest upstream
//chrome/browser/net/system_network_context_manager.cc is wrongly using
network::ResourceRequest without including it first, which is causing
a build failure on Brave due to overrides, so let's make sure that such
header is included before using that type.
2021-09-13 14:53:09 -04:00
Mario Sanchez Prada 10c9ed746e Move away from using base::{Bind,Callback,Closure}()
base::{Bind,Callback,Closure}() have been deprecatedfor a while now,
are finally gone on Chromium 92, so it would be good to migrate all
current instances in the code (and stop introducing new ones) to the
Once/Repeating variants instead to easy further rebases.

This patch changes ALL instances of those old definitions and move
to using the Once variants whenever possible (as they are preferred)
and Repeating variants in every other case.

Last, this patch also makes some changes in brave_rewards_api.{h,cc}
to use weak pointers instead of base::Unretained() when binding
callbacks, for extra safety (and consistency with existing code).

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2867526

Resolves https://github.com/brave/brave-browser/issues/15855
2021-05-20 16:27:04 +02:00
Mario Sanchez Prada 577eba4cdc Merge //brave/browser:browser_process into //chrome/browser
This is the very first step towards a clearer way to organize and
state dependencies between targets: for now we just remove this
target and fold everything into //chrome/browser via a massive
dump into browser/sources.gni with no further changes, plus the
necessary adaptations wherever the old target was referenced.

Once this is in place, next steps will extract different subsets
of the sources dumped in there into separate .gni files, so that
it can be more clearly stated which dependencies are actually
related to which subset of source files, instead of having the
giant merge of dependencies we had until now in a single target.

Once those separate .gni files are in place, and each of them
with their own clear set of dependencies, we should be in a much
better position to reorganize things and see what can be moved
around into independent GN targets instead of being part of the
//chrome/browser main target.

Finally, this change also makes the //brave/browser target a group
instead of a source_set and adjust visibility rules in a more
precise way, so that we can still reference //brave/browser from
different places in Brave (vs having to reference //chrome/browser).
2021-04-23 08:13:55 +02:00
bridiver fb3c0f5561 buildtools/checkdeps/checkdeps.py brave --extra-repos=brave runs succesfully 2021-02-06 13:34:00 -07:00
mkarolin 36d98fde8b [GN] no more jumbo.
Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/878b18040e2d5a6d2c39f5a49be6f9dc04c35d03

commit 878b18040e2d5a6d2c39f5a49be6f9dc04c35d03
Author: Dirk Pranke <dpranke@google.com>
Date:   Fri Aug 7 20:53:38 2020 +0000

    Remove all remaining references to the jumbo build.

    This removes jumbo.gni, the imports of jumbo.gni, and
    any remaining stray references to it in the build files and docs.

    Bug: 994387
2020-09-11 14:45:31 -04:00
mkarolin 255b51bc0e Renamed build output in brave/network/public/cpp.
Due to a collision with another target:

ERROR at //build/config/BUILDCONFIG.gn:570:5: Duplicate output file.
    target(_target_type, _target_name) {
    ^-----------------------------------
Two or more targets generate the same output:
  cpp.dll

This is can often be fixed by changing one of the target names, or by
setting an output_name on one of them.

Collisions:
  //brave/services/network/public/cpp:cpp
  //media/learning/mojo/public/cpp:cpp

Chromium change:

https://chromium.googlesource.com/chromium/src/+/96665a836d2b2ffab4951167fbf3230dbe3aec30

commit 96665a836d2b2ffab4951167fbf3230dbe3aec30
Author: liberato@chromium.org <liberato@chromium.org>
Date:   Thu Jan 23 00:35:37 2020 +0000

    Attach SmoothnessHelper to WMPI for MediaCap experiment

    This CL also plumbs ukm::SourceId through BeginObservation, instead
    of CompleteObservation so that default target values work.
2020-03-19 16:51:30 -04:00
samartnik 0bd0aa0a22 Fixed debug build for Windows 2020-01-04 07:57:56 -05:00
samartnik 674353cb1c Added deps. Minor review fixes. 2019-12-24 08:07:08 -05:00
samartnik e4f3242c79 Fixed Android mono builds 2019-12-24 08:07:08 -05:00