[ios blink] Fix single process tests
Single process tests were failing because no BELayerHierarchyTransport was registered. Since this is all in process, just create a stub transport for now. Change-Id: I9c7146787648ccd9377b60f51283efe8ff590637 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6394815 Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/main@{#1437842}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
3aefe83b08
commit
0c34943f46
@ -25,6 +25,10 @@
|
||||
#include "base/android/jni_android.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
#include "gpu/ipc/common/ios/be_layer_hierarchy_transport.h"
|
||||
#endif
|
||||
|
||||
namespace content {
|
||||
namespace {
|
||||
|
||||
@ -34,6 +38,25 @@ BASE_FEATURE(kInProcessGpuUseIOThread,
|
||||
|
||||
} // namespace
|
||||
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
class InProcessGpuThread::BELayerHierarchyTransportImpl
|
||||
: public gpu::BELayerHierarchyTransport {
|
||||
public:
|
||||
BELayerHierarchyTransportImpl() {
|
||||
gpu::BELayerHierarchyTransport::SetInstance(this);
|
||||
}
|
||||
~BELayerHierarchyTransportImpl() override {
|
||||
gpu::BELayerHierarchyTransport::SetInstance(nullptr);
|
||||
}
|
||||
|
||||
void ForwardBELayerHierarchyToBrowser(
|
||||
gpu::SurfaceHandle surface_handle,
|
||||
xpc_object_t ipc_representation) override {
|
||||
// Nothing to do.
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
InProcessGpuThread::InProcessGpuThread(
|
||||
const InProcessChildThreadParams& params,
|
||||
const gpu::GpuPreferences& gpu_preferences)
|
||||
@ -65,6 +88,11 @@ void InProcessGpuThread::Init() {
|
||||
io_thread_type = base::ThreadType::kDisplayCritical;
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
be_layer_transport_ =
|
||||
std::make_unique<InProcessGpuThread::BELayerHierarchyTransportImpl>();
|
||||
#endif
|
||||
|
||||
if (base::FeatureList::IsEnabled(kInProcessGpuUseIOThread)) {
|
||||
gpu_process_ = std::make_unique<ChildProcess>(params_.child_io_runner());
|
||||
} else {
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "build/build_config.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/common/in_process_child_thread_params.h"
|
||||
#include "gpu/config/gpu_preferences.h"
|
||||
@ -32,11 +33,18 @@ class InProcessGpuThread : public base::Thread {
|
||||
void CleanUp() override;
|
||||
|
||||
private:
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
class BELayerHierarchyTransportImpl;
|
||||
#endif
|
||||
|
||||
InProcessChildThreadParams params_;
|
||||
|
||||
// Deleted in CleanUp() on the gpu thread, so don't use smart pointers.
|
||||
std::unique_ptr<ChildProcess> gpu_process_;
|
||||
gpu::GpuPreferences gpu_preferences_;
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
std::unique_ptr<BELayerHierarchyTransportImpl> be_layer_transport_;
|
||||
#endif
|
||||
};
|
||||
|
||||
CONTENT_EXPORT base::Thread* CreateInProcessGpuThread(
|
||||
|
Reference in New Issue
Block a user