From f2ea90d9cf667612b2913a6f30636a4773bad026 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 28 Feb 2023 18:38:25 +0000 Subject: [PATCH] IWYU: include blink::URLLoader for unique_ptr usage in WebLocalFrameClient Recent refactor broke again libstdc++ build by not including URLLoader header. But the reason for that change was removing in public code includes of non public code, as URLLoader. To fix the problem, move the implementation exposing the problem to the .cc file. Fixes build error with libstdc++: /usr/include/c++/12/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = blink::URLLoader]’: /usr/include/c++/12/bits/unique_ptr.h:396:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = blink::URLLoader; _Dp = std::default_delete]’ ../../third_party/blink/public/web/web_local_frame_client.h:678:12: required from here /usr/include/c++/12/bits/unique_ptr.h:93:23: error: invalid application of ‘sizeof’ to incomplete type ‘blink::URLLoader’ Bug: 957519 Change-Id: I0db2f86603fba4fe8f10d6c4370ad1ff4c9ca70b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4276241 Reviewed-by: Daniel Cheng Commit-Queue: José Dapena Paz Cr-Commit-Position: refs/heads/main@{#1111077} --- diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h index d6bb896..246d2ff 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h @@ -674,9 +674,7 @@ return nullptr; } - virtual std::unique_ptr CreateURLLoaderForTesting() { - return nullptr; - } + virtual std::unique_ptr CreateURLLoaderForTesting(); virtual void OnStopLoading() {} diff --git a/third_party/blink/renderer/core/frame/web_local_frame_client.cc b/third_party/blink/renderer/core/frame/web_local_frame_client.cc index a3617af..3adcd7c 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_client.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_client.cc @@ -7,6 +7,7 @@ #include "mojo/public/cpp/bindings/pending_remote.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/common/browser_interface_broker_proxy.h" +#include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader.h" namespace blink { @@ -25,4 +26,9 @@ // have this implementation in the base class. return AssociatedInterfaceProvider::GetEmptyAssociatedInterfaceProvider(); } + +std::unique_ptr WebLocalFrameClient::CreateURLLoaderForTesting() { + return nullptr; +} + } // namespace blink