| Index: content/browser/renderer_host/context_provider_factory_impl_android.h
|
| diff --git a/content/browser/renderer_host/context_provider_factory_impl_android.h b/content/browser/renderer_host/context_provider_factory_impl_android.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4fb233a9c79593c8b7c9ff0b0f1e50f1df2fc656
|
| --- /dev/null
|
| +++ b/content/browser/renderer_host/context_provider_factory_impl_android.h
|
| @@ -0,0 +1,87 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_BROWSER_RENDERER_HOST_CONTEXT_PROVIDER_FACTORY_IMPL_ANDROID_H_
|
| +#define CONTENT_BROWSER_RENDERER_HOST_CONTEXT_PROVIDER_FACTORY_IMPL_ANDROID_H_
|
| +
|
| +#include <list>
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/timer/timer.h"
|
| +#include "content/common/content_export.h"
|
| +#include "content/public/browser/android/context_provider_factory.h"
|
| +
|
| +namespace base {
|
| +template <typename T>
|
| +struct DefaultSingletonTraits;
|
| +}
|
| +
|
| +namespace cc {
|
| +class VulkanInProcessContextProvider;
|
| +}
|
| +
|
| +namespace gpu {
|
| +class GpuChannelHost;
|
| +}
|
| +
|
| +namespace content {
|
| +class ContextProviderCommandBuffer;
|
| +
|
| +class CONTENT_EXPORT ContextProviderFactoryImpl
|
| + : public ContextProviderFactory {
|
| + public:
|
| + using GpuChannelRequestCallback =
|
| + base::Callback<void(scoped_refptr<gpu::GpuChannelHost>)>;
|
| +
|
| + static ContextProviderFactoryImpl* GetInstance();
|
| +
|
| + ~ContextProviderFactoryImpl() override;
|
| +
|
| + void RequestRenderContextProvider(
|
| + ContextProviderCallback result_callback) override;
|
| +
|
| + void RequestGpuChannel(
|
| + GpuChannelRequestCallback gpu_channel_request_callback);
|
| +
|
| + scoped_refptr<cc::VulkanInProcessContextProvider>
|
| + GetSharedVulkanContextProviderAndroid();
|
| +
|
| + private:
|
| + friend struct base::DefaultSingletonTraits<ContextProviderFactoryImpl>;
|
| +
|
| + ContextProviderFactoryImpl();
|
| +
|
| + // Will return nullptr if the Gpu channel has not been established.
|
| + gpu::GpuChannelHost* EnsureGpuChannelEstablished();
|
| + void OnGpuChannelEstablished();
|
| + void OnGpuChannelTimeout();
|
| +
|
| + void HandlePendingRequests();
|
| +
|
| + void CreateRenderCompositorContexts(
|
| + ContextProviders& context_providers,
|
| + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
|
| +
|
| + scoped_refptr<ContextProviderCommandBuffer>
|
| + SharedCompositorWorkerContextProvider(
|
| + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
|
| +
|
| + GpuChannelRequestCallback gpu_channel_request_callback_;
|
| + std::list<ContextProviderCallback> render_context_request_callbacks_;
|
| +
|
| + scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_;
|
| +
|
| + bool in_handle_pending_requests_;
|
| +
|
| + base::OneShotTimer establish_gpu_channel_timeout_;
|
| +
|
| + base::WeakPtrFactory<ContextProviderFactoryImpl> weak_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ContextProviderFactoryImpl);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_RENDERER_HOST_CONTEXT_PROVIDER_FACTORY_IMPL_ANDROID_H_
|
|
|