0

Remove forwarding headers

bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Remove the forwarding headers as
well as do some assorted cleanup related to those headers.

Fixed: 1364441
No-Try: true
Cq-Include-Trybots: luci.chrome.try:mac-chrome,win-chrome,linux-chrome,chromeos-eve-chrome,android-internal-rel
Change-Id: I309149935f721c27f2c3373ef40627c0c1f7537b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4167020
Commit-Queue: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093705}
This commit is contained in:
Avi Drissman
2023-01-18 02:45:14 +00:00
committed by Chromium LUCI CQ
parent 19ba360fd4
commit d4459dbffb
33 changed files with 43 additions and 98 deletions
base
chrome
chromeos/ash
components
services
cros_healthd
testing
bindings
components
creator
download
internal
password_manager
core
browser
device/bluetooth/bluez
docs
fuchsia_web/webengine/browser
services/network/attribution
third_party/blink
renderer
platform
scheduler
tools
blinkpy

@ -224,14 +224,10 @@ component("base") {
"base_switches.h",
"big_endian.cc",
"big_endian.h",
"bind.h",
"bit_cast.h",
"bits.h",
"build_time.cc",
"build_time.h",
"callback.h",
"callback_forward.h",
"callback_helpers.h",
"callback_list.cc",
"callback_list.h",
"cancelable_callback.h",

@ -1,12 +0,0 @@
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// TODO(https://crbug.com/1364441): Temporary forwarding header.
#ifndef BASE_BIND_H_
#define BASE_BIND_H_
#include "base/functional/bind.h"
#endif // BASE_BIND_H_

@ -1,12 +0,0 @@
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// TODO(https://crbug.com/1364441): Temporary forwarding header.
#ifndef BASE_CALLBACK_H_
#define BASE_CALLBACK_H_
#include "base/functional/callback.h"
#endif // BASE_CALLBACK_H_

@ -1,12 +0,0 @@
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// TODO(https://crbug.com/1364441): Temporary forwarding header.
#ifndef BASE_CALLBACK_FORWARD_H_
#define BASE_CALLBACK_FORWARD_H_
#include "base/functional/callback_forward.h"
#endif // BASE_CALLBACK_FORWARD_H_

@ -1,12 +0,0 @@
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// TODO(https://crbug.com/1364441): Temporary forwarding header.
#ifndef BASE_CALLBACK_HELPERS_H_
#define BASE_CALLBACK_HELPERS_H_
#include "base/functional/callback_helpers.h"
#endif // BASE_CALLBACK_HELPERS_H_

@ -35,7 +35,7 @@
#include "base/mac/scoped_block.h"
#endif
// See base/callback.h for user documentation.
// See base/functional/callback.h for user documentation.
//
//
// CONCEPTS:

@ -4,7 +4,7 @@
#include "chrome/browser/apps/app_deduplication_service/app_deduplication_server_connector.h"
#include "base/callback.h"
#include "base/functional/callback.h"
#include "chrome/browser/apps/app_deduplication_service/app_deduplication_mapper.h"
#include "chrome/browser/apps/app_deduplication_service/proto/app_deduplication.pb.h"
#include "google_apis/google_api_keys.h"

@ -9,7 +9,7 @@
#include <string>
#include <vector>
#include "base/callback_forward.h"
#include "base/functional/callback_forward.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/apps/app_deduplication_service/proto/deduplication_data.pb.h"

@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_ASH_MOJO_SERVICE_MANAGER_CONNECTION_HELPER_H_
#define CHROME_BROWSER_ASH_MOJO_SERVICE_MANAGER_CONNECTION_HELPER_H_
#include <base/callback_helpers.h>
#include "base/functional/callback_helpers.h"
namespace ash {
namespace mojo_service_manager {

@ -6,8 +6,8 @@
#include <memory>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "chrome/browser/headless/headless_mode_util.h"
#include "components/headless/command_handler/headless_command_handler.h"
#include "content/public/browser/browser_context.h"

@ -6,7 +6,7 @@
#define CHROME_BROWSER_PASSWORD_MANAGER_ANDROID_PASSWORD_MANAGER_LIFECYCLE_HELPER_IMPL_H_
#include "base/android/scoped_java_ref.h"
#include "base/callback.h" // callback_forward doesn't suffice for members.
#include "base/functional/callback.h" // callback_forward doesn't suffice for members.
#include "chrome/browser/password_manager/android/password_manager_lifecycle_helper.h"
// Simple JNI bridge to implement the PasswordManagerLifecycleHelper interface.

@ -7,8 +7,8 @@
#include <vector>
#include "base/base64.h"
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/strings/strcat.h"
#include "base/task/bind_post_task.h"
#include "base/task/task_traits.h"

@ -8,7 +8,7 @@
#include <memory>
#include "ash/public/cpp/saved_desk_delegate.h"
#include "base/callback_forward.h"
#include "base/functional/callback_forward.h"
#include "base/memory/weak_ptr.h"
#include "chromeos/crosapi/mojom/desk_template.mojom-forward.h"
#include "components/favicon_base/favicon_types.h"

@ -4,7 +4,6 @@
#include "chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.h"
#include "base/bind.h"
#include "base/functional/bind.h"
#include "chrome/browser/lookalikes/safety_tip_ui_helper.h"
#include "chrome/browser/platform_util.h"

@ -4,7 +4,7 @@
#include <utility>
#include "base/callback_forward.h"
#include "base/functional/callback_forward.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "build/build_config.h"

@ -1,10 +1,9 @@
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/app_home/app_home_page_handler.h"
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/containers/flat_set.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"

@ -9,7 +9,6 @@
#include <utility>
#include <vector>
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback_helpers.h"

@ -4,7 +4,7 @@
#include "chrome/browser/ui/webui/web_app_internals/web_app_internals_ui.h"
#include "base/bind.h"
#include "base/functional/bind.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/web_app_internals/web_app_internals_handler.h"
#include "chrome/browser/ui/webui/webui_util.h"

@ -5,9 +5,10 @@
#ifndef CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_H_
#define CHROME_TEST_CHROMEDRIVER_NET_SYNC_WEBSOCKET_H_
#include <base/callback.h>
#include <string>
#include "base/functional/callback.h"
class GURL;
class Timeout;

@ -5,8 +5,8 @@
#include "chromeos/ash/components/network/hotspot_allowed_flag_handler.h"
#include "ash/constants/ash_features.h"
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "chromeos/ash/components/dbus/shill/shill_manager_client.h"
#include "chromeos/ash/components/network/network_event_log.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"

@ -16,10 +16,9 @@ namespace {{namespace}} {
#include "{{module.path}}-connectivity.h"
#include <base/callback_helpers.h>
#include <base/check.h>
#include <base/logging.h>
#include "base/check.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "chromeos/ash/services/cros_healthd/testing/bindings/local_state.h"
#include "chromeos/ash/services/cros_healthd/testing/bindings/remote_state.h"
#include "chromeos/ash/services/cros_healthd/testing/bindings/utils.h"

@ -7,7 +7,7 @@
#include <string>
#include "base/callback.h"
#include "base/functional/callback.h"
namespace creator {

@ -6,9 +6,9 @@
#include <memory>
#import "base/callback_helpers.h"
#import "base/files/file_util.h"
#import "base/files/scoped_temp_dir.h"
#import "base/functional/callback_helpers.h"
#import "base/guid.h"
#import "base/run_loop.h"
#import "base/sequence_checker.h"

@ -8,8 +8,6 @@
#include <utility>
#include "base/barrier_callback.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"

@ -7,9 +7,9 @@
#include <iterator>
#include <ostream>
#include <base/callback_helpers.h>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "dbus/property.h"

@ -6,8 +6,8 @@
The templated `base::{Once, Repeating}Callback<>` classes are generalized
function objects. Together with the `base::Bind{Once, Repeating}()` functions in
base/bind.h, they provide a type-safe method for performing partial application
of functions.
base/functional/bind.h, they provide a type-safe method for performing partial
application of functions.
Partial application is the process of binding a subset of a function's arguments
to produce another function that takes fewer arguments. This can be used to pass
@ -916,7 +916,7 @@ references. (Binding to non-const references is forbidden, see bind.h.)
To change this behavior, we introduce a set of argument wrappers (e.g.,
`base::Unretained()`). These are simple container templates that are passed by
value, and wrap a pointer to argument. Each helper has a comment describing it
in base/bind.h.
in base/functional/bind.h.
These types are passed to the `Unwrap()` functions to modify the behavior of
`base::Bind{Once, Repeating}()`. The `Unwrap()` functions change behavior by doing partial
@ -940,5 +940,6 @@ void Foo(int x, bool y);
base::BindOnce(&Foo, _1, false); // _1 is a placeholder.
```
If you are thinking of forward declaring `base::{Once, Repeating}Callback` in your own header
file, please include "base/callback_forward.h" instead.
If you are thinking of forward declaring `base::{Once, Repeating}Callback` in
your own header file, please include "base/functional/callback_forward.h"
instead.

@ -110,10 +110,11 @@ ninja -C out/Default chrome
5. Use clangd in your favourite editor, see detailed [instructions](
https://clangd.llvm.org/installation.html#editor-plugins).
* Optional: You may want to add `-header-insertion=never` to the clangd flags,
so that your editor doesn't automatically add incorrect #include lines. The
feature doesn't correctly handle some common Chromium headers like
`base/strings/string_piece_forward.h` and `base/callback_forward.h`
* Optional: You may want to add `-header-insertion=never` to the clangd
flags, so that your editor doesn't automatically add incorrect #include
lines. The feature doesn't correctly handle some common Chromium headers
like `base/strings/string_piece_forward.h` and
`base/functional/callback_forward.h`
## Background Indexing

@ -388,16 +388,16 @@ A good rule of thumb is that any method on a delegate that:
should be a property on the framework object instead of a delegate method.
[Bind]: ../../base/bind.h
[Bind]: ../../base/functional/bind.h
[BrowserListObserver]: ../../chrome/browser/ui/browser_list_observer.h
[CallbackList]: ../../base/callback_list.h
[Callback]: ../../base/callback.h
[Callback]: ../../base/functional/callback.h
[CheckedObserver]: ../../base/observer_list_types.h
[ObserverList]: ../../base/observer_list.h
[base::ScopedObservation]: ../../base/scoped_observation.h
[Subscription]: ../../base/callback_list.h
[URLRequestJobFactory::ProtocolHandler]: ../../net/url_request/url_request_job_factory.h
[Unretained]: ../../base/bind.h
[Unretained]: ../../base/functional/bind.h
[ViewObserver]: ../../ui/views/view_observer.h
[WebContentsDelegate]: ../../content/public/browser/web_contents_delegate.h
[WebContentsObserver]: ../../content/public/browser/web_contents_observer.h

@ -46,7 +46,7 @@ There are two common scenarios for hitting the pragma:
using techniques such as forward declarations to avoid increasing the header
size. Even complex classes may have forward declarations available, see for
example
[https://source.chromium.org/chromium/chromium/src/+/HEAD:base/callback_forward.h](callback_forward.h)
[https://source.chromium.org/chromium/chromium/src/+/HEAD:base/functional/callback_forward.h](callback_forward.h)
and
[https://source.chromium.org/chromium/chromium/src/+/HEAD:base/strings/string_piece_forward.h](string_piece_forward.h).
Many types defined in .mojom.h files have forward declarations in a

@ -5,11 +5,11 @@
#include <lib/fdio/namespace.h>
#include <stdint.h>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/fuchsia/file_utils.h"
#include "base/fuchsia/fuchsia_logging.h"
#include "base/functional/bind.h"
#include "base/no_destructor.h"
#include "base/system/sys_info.h"
#include "base/threading/thread_restrictions.h"

@ -6,8 +6,8 @@
#include <utility>
#include "base/bind.h"
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/task/thread_pool.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"

@ -9,13 +9,13 @@ include_rules = [
"+base/atomic_sequence_num.h",
"+base/atomicops.h",
"+base/barrier_closure.h",
"+base/callback_helpers.h",
"+base/cancelable_callback.h",
"+base/command_line.h",
"+base/compiler_specific.h",
"+base/containers/circular_deque.h",
"+base/feature_list.h",
"+base/format_macros.h",
"+base/functional/callback_helpers.h",
"+base/gtest_prod_util.h",
"+base/logging.h",
"+base/message_loop/message_loop.h",

@ -149,7 +149,7 @@ _CONFIG = [
'base::expected',
'base::unexpected',
# //base/bind.h
# //base/functional/bind.h
'base::IgnoreResult',
# //base/bits.h
@ -159,12 +159,12 @@ _CONFIG = [
'base::ObserverList',
'base::CheckedObserver',
# //base/callback_helpers.h.
# //base/functional/callback_helpers.h.
'base::DoNothing',
'base::SplitOnceCallback',
# //base/callback.h is allowed, but you need to use WTF::Bind or
# WTF::BindRepeating to create callbacks in Blink.
# //base/functional/callback.h is allowed, but you need to use
# WTF::Bind or WTF::BindRepeating to create callbacks in Blink.
'base::BarrierClosure',
'base::NullCallback',
'base::OnceCallback',