Skip to content

Commit

Permalink
Cleanup: Format <optional> include order.
Browse files Browse the repository at this point in the history
This is an automated patch. Please avoid assigning unrelated bug.
 #cleanup

This is a follow-up to @thestig comment:
https://chromium-review.googlesource.com/c/chromium/src/+/5009410/7/pdf/accessibility_helper.cc#11

Several developers, including myself rewrote optional without properly
reordering the #includes at the beginning.
This patches automatically fixes it.

Script:
-------

```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep -v \
      -e "*win*" \
      -e "third_party/*" \
      -e "tools/*" \
    | grep \
      -e "\.h" \
      -e "\.cc" \
    | sort \
    | uniq \
    | xargs sed -i "s/$1/$2/g"
}

replace "#include <optional>" ""
git add -u
git commit -m "remove optional"
git revert HEAD --no-commit
git add -u
echo "Formatting":
echo "IncludeBlocks: Regroup" >> ".clang-format"
echo "IncludeIsMainRegex: \"(_(android|apple|chromeos|freebsd|fuchsia|fuzzer|ios|linux|mac|nacl|openbsd|posix|stubs?|win))?(_(unit|browser|perf)?tests?)?$\"" >> ".clang-format"
git add -u
git cl format --upstream=HEAD
git checkout origin/main -- ".clang-format"
git add -u
git commit -m "revert with format"
git reset --soft origin/main
git add -u
git commit -m "Automated format"
```

cleanup: This is a no-op patch formatting includes.
Bug: 40288126
Change-Id: I5f61b1207c097a4c6b20a034f9d1b323975b1851
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5335142
Owners-Override: Lei Zhang <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Commit-Queue: Arthur Sonzogni <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1267143}
  • Loading branch information
ArthurSonzogni authored and Chromium LUCI CQ committed Feb 29, 2024
1 parent 104e3c2 commit 5bc3326
Show file tree
Hide file tree
Showing 642 changed files with 750 additions and 449 deletions.
2 changes: 1 addition & 1 deletion android_webview/browser/aw_contents_io_thread_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include <map>
#include <memory>
#include <optional>
#include <utility>

#include <optional>
#include "android_webview/browser/aw_settings.h"
#include "android_webview/browser/network_service/aw_web_resource_intercept_response.h"
#include "android_webview/browser/network_service/aw_web_resource_request.h"
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_http_auth_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include "android_webview/browser/aw_http_auth_handler.h"

#include <optional>
#include <utility>

#include <optional>
#include "android_webview/browser/aw_contents.h"
#include "android_webview/browser_jni_headers/AwHttpAuthHandler_jni.h"
#include "base/android/jni_android.h"
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/cookie_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include <stdint.h>

#include <memory>
#include <optional>
#include <utility>
#include <vector>

#include <optional>
#include "android_webview/browser/aw_browser_context.h"
#include "android_webview/browser/aw_browser_context_store.h"
#include "android_webview/browser/aw_client_hints_controller_delegate.h"
Expand Down
1 change: 1 addition & 0 deletions android_webview/browser/gfx/aw_draw_fn_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define ANDROID_WEBVIEW_BROWSER_GFX_AW_DRAW_FN_IMPL_H_

#include <optional>

#include "android_webview/browser/gfx/aw_vulkan_context_provider.h"
#include "android_webview/browser/gfx/compositor_frame_consumer.h"
#include "android_webview/browser/gfx/render_thread_manager.h"
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/gfx/aw_vulkan_context_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#define ANDROID_WEBVIEW_BROWSER_GFX_AW_VULKAN_CONTEXT_PROVIDER_H_

#include <memory>

#include <optional>

#include "base/memory/raw_ptr.h"
#include "components/viz/common/gpu/vulkan_context_provider.h"
#include "gpu/vulkan/vulkan_device_queue.h"
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/gfx/browser_view_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <stddef.h>

#include <map>
#include <optional>
#include <set>

#include <optional>
#include "android_webview/browser/gfx/begin_frame_source_webview.h"
#include "android_webview/browser/gfx/child_frame.h"
#include "android_webview/browser/gfx/compositor_frame_producer.h"
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/gfx/child_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#define ANDROID_WEBVIEW_BROWSER_GFX_CHILD_FRAME_H_

#include <memory>
#include <optional>
#include <vector>

#include <optional>
#include "base/containers/circular_deque.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "components/viz/common/surfaces/frame_sink_id.h"
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/gfx/render_thread_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include "android_webview/browser/gfx/render_thread_manager.h"

#include <memory>
#include <optional>
#include <utility>

#include <optional>
#include "android_webview/browser/gfx/compositor_frame_producer.h"
#include "android_webview/browser/gfx/gpu_service_webview.h"
#include "android_webview/browser/gfx/hardware_renderer.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#include "android_webview/browser/network_service/aw_proxying_url_loader_factory.h"

#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include <optional>
#include "android_webview/browser/android_protocol_handler.h"
#include "android_webview/browser/aw_browser_context.h"
#include "android_webview/browser/aw_contents_client_bridge.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define ANDROID_WEBVIEW_BROWSER_NETWORK_SERVICE_AW_PROXYING_URL_LOADER_FACTORY_H_

#include <optional>

#include "android_webview/browser/network_service/aw_browser_context_io_thread_handle.h"
#include "base/memory/weak_ptr.h"
#include "components/embedder_support/android/util/android_stream_reader_url_loader.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#ifndef ANDROID_WEBVIEW_BROWSER_NETWORK_SERVICE_AW_WEB_RESOURCE_REQUEST_H_
#define ANDROID_WEBVIEW_BROWSER_NETWORK_SERVICE_AW_WEB_RESOURCE_REQUEST_H_

#include <optional>
#include <string>
#include <vector>

#include <optional>
#include "base/android/scoped_java_ref.h"

namespace net {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#ifndef ANDROID_WEBVIEW_BROWSER_TRACING_AW_BACKGROUND_TRACING_METRICS_PROVIDER_H_
#define ANDROID_WEBVIEW_BROWSER_TRACING_AW_BACKGROUND_TRACING_METRICS_PROVIDER_H_

#include "components/tracing/common/background_tracing_metrics_provider.h"

#include <optional>

#include "base/memory/weak_ptr.h"
#include "components/tracing/common/background_tracing_metrics_provider.h"

namespace tracing {

Expand Down
1 change: 1 addition & 0 deletions android_webview/browser/tracing/aw_tracing_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define ANDROID_WEBVIEW_BROWSER_TRACING_AW_TRACING_DELEGATE_H_

#include <optional>

#include "content/public/browser/tracing_delegate.h"

class PrefRegistrySimple;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#define ANDROID_WEBVIEW_NONEMBEDDED_COMPONENT_UPDATER_AW_COMPONENT_UPDATE_SERVICE_H_

#include <memory>
#include <optional>
#include <string>
#include <vector>

#include <optional>
#include "base/android/scoped_java_ref.h"
#include "base/containers/flat_map.h"
#include "base/functional/callback_forward.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include <iterator>
#include <memory>
#include <optional>
#include <utility>

#include <optional>
#include "android_webview/common/aw_paths.h"
#include "android_webview/nonembedded/component_updater/aw_component_updater_configurator.h"
#include "base/android/path_utils.h"
Expand Down
1 change: 0 additions & 1 deletion ash/ambient/metrics/ambient_metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "base/metrics/histogram_functions.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/strcat.h"

#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "base/values.h"
Expand Down
1 change: 0 additions & 1 deletion ash/ambient/metrics/ambient_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "ash/public/cpp/ambient/ambient_mode_photo_source.h"
#include "base/functional/callback.h"
#include "base/scoped_observation.h"

#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "ui/views/view.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "base/no_destructor.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"

#include "base/strings/stringprintf.h"
#include "cc/paint/skottie_wrapper.h"
#include "third_party/re2/src/re2/re2.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "ash/ambient/test/ambient_test_util.h"
#include "base/check.h"
#include "base/numerics/safe_conversions.h"

#include "cc/paint/skottie_resource_metadata.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down
1 change: 0 additions & 1 deletion ash/ambient/ui/ambient_animation_frame_rate_schedule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/strings/strcat.h"

#include "base/time/time.h"
#include "cc/paint/skottie_marker.h"
#include "third_party/re2/src/re2/re2.h"
Expand Down
1 change: 0 additions & 1 deletion ash/ambient/ui/ambient_animation_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/strings/strcat.h"

#include "base/time/time.h"
#include "cc/paint/skottie_marker.h"
#include "cc/paint/skottie_wrapper.h"
Expand Down
1 change: 1 addition & 0 deletions ash/app_list/views/apps_grid_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "ash/app_list/views/apps_grid_view.h"

#include <stddef.h>

#include <algorithm>
#include <list>
#include <memory>
Expand Down
3 changes: 2 additions & 1 deletion ash/components/arc/timer/arc_timer_bridge_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/components/arc/timer/arc_timer_bridge.h"

#include <map>
#include <memory>
#include <optional>
Expand All @@ -14,7 +16,6 @@
#include "ash/components/arc/session/connection_holder.h"
#include "ash/components/arc/test/connection_holder_util.h"
#include "ash/components/arc/test/fake_timer_instance.h"
#include "ash/components/arc/timer/arc_timer_bridge.h"
#include "ash/components/arc/timer/arc_timer_mojom_traits.h"
#include "base/files/file_descriptor_watcher_posix.h"
#include "base/files/scoped_file.h"
Expand Down
1 change: 1 addition & 0 deletions ash/events/peripheral_customization_event_rewriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "ash/events/peripheral_customization_event_rewriter.h"

#include <linux/input.h>

#include <iterator>
#include <memory>
#include <optional>
Expand Down
3 changes: 2 additions & 1 deletion ash/login/ui/access_code_input_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/login/ui/access_code_input.h"

#include <memory>
#include <optional>
#include <string>

#include "ash/login/ui/access_code_input.h"
#include "ash/test/ash_test_base.h"
#include "base/strings/string_number_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down
3 changes: 2 additions & 1 deletion ash/sensor_info/sensor_provider_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/sensor_info/sensor_provider.h"

#include <memory>
#include <optional>
#include <set>
#include <utility>
#include <vector>

#include "ash/accelerometer/accelerometer_constants.h"
#include "ash/sensor_info/sensor_provider.h"
#include "ash/sensor_info/sensor_types.h"
#include "ash/test/ash_test_helper.h"
#include "base/memory/scoped_refptr.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/public/cpp/input_device_settings_controller.h"

#include <cstdint>
#include <memory>
#include <optional>
Expand All @@ -10,7 +12,6 @@
#include "ash/constants/ash_pref_names.h"
#include "ash/events/event_rewriter_controller_impl.h"
#include "ash/public/cpp/ash_prefs.h"
#include "ash/public/cpp/input_device_settings_controller.h"
#include "ash/public/mojom/input_device_settings.mojom.h"
#include "ash/session/session_controller_impl.h"
#include "ash/shell.h"
Expand Down
1 change: 1 addition & 0 deletions base/android/jni_conversions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <jni.h>

#include <optional>
#include <string>

Expand Down
6 changes: 3 additions & 3 deletions base/android/pre_freeze_background_memory_trimmer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "base/android/pre_freeze_background_memory_trimmer.h"

#include <optional>
#include <string>

#include "base/android/build_info.h"
#include "base/android/pmf_utils.h"
#include "base/check.h"
Expand All @@ -18,9 +21,6 @@
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/time/time.h"

#include <optional>
#include <string>

namespace base::android {
namespace {

Expand Down
1 change: 1 addition & 0 deletions base/android/token_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define BASE_ANDROID_TOKEN_ANDROID_H_

#include <jni.h>

#include <optional>

#include "base/android/scoped_java_ref.h"
Expand Down
1 change: 1 addition & 0 deletions base/big_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
#include <string.h>

#include <optional>
#include <type_traits>

Expand Down
3 changes: 1 addition & 2 deletions base/json/json_reader_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <string_view>

#include "base/json/json_reader.h"

#include <optional>
#include <string_view>

#include "base/json/json_writer.h"
#include "base/values.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/animation/animation_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#define CC_ANIMATION_ANIMATION_DELEGATE_H_

#include <memory>

#include <optional>

#include "base/time/time.h"
#include "cc/animation/animation_export.h"
#include "ui/gfx/animation/keyframe/animation_curve.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/animation/scroll_offset_animation_curve.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#define CC_ANIMATION_SCROLL_OFFSET_ANIMATION_CURVE_H_

#include <memory>

#include <optional>

#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
Expand Down
1 change: 1 addition & 0 deletions cc/animation/scroll_timeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <optional>
#include <vector>

#include "base/time/time.h"
#include "cc/animation/animation_export.h"
#include "cc/animation/animation_timeline.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/animation/worklet_animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#define CC_ANIMATION_WORKLET_ANIMATION_H_

#include <memory>
#include <optional>
#include <string>

#include <optional>
#include "base/gtest_prod_util.h"
#include "base/time/time.h"
#include "cc/animation/animation.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/base/list_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#include <iterator>
#include <memory>
#include <optional>
#include <utility>

#include <optional>
#include "base/check.h"
#include "cc/base/list_container_helper.h"

Expand Down
Loading

0 comments on commit 5bc3326

Please sign in to comment.