Chromium Code Reviews| Index: ui/android/context_provider_factory.h |
| diff --git a/ui/android/context_provider_factory.h b/ui/android/context_provider_factory.h |
| index 8ad9d6f4a0c3eacef8a1e0982a974b337ceb4684..c5654d768840c2389d88ca56fb064b9379d13ba4 100644 |
| --- a/ui/android/context_provider_factory.h |
| +++ b/ui/android/context_provider_factory.h |
| @@ -31,8 +31,24 @@ namespace ui { |
| // This class is not thread-safe and should only be accessed from the UI thread. |
| class UI_ANDROID_EXPORT ContextProviderFactory { |
| public: |
| + enum class ContextCreationResult { |
| + FAILURE_GPU_PROCESS_INITIALIZATION_FAILED, |
| + |
| + // Used when the browser is shutting down. No more requests should be made |
|
David Trainor- moved to gerrit
2016/08/18 17:49:43
Should we enforce/DCHECK that we don't get calls a
Khushal
2016/08/18 18:29:13
We can internally enforce that we are not getting
|
| + // after this. |
| + FAILURE_BROWSER_SHUTDOWN, |
| + |
| + // The GpuSurfaceHandle for the request was lost before the context could be |
| + // created. This is used for on-screen context requests only. |
| + FAILURE_GPU_SURFACE_HANDLE_LOST, |
| + |
| + // Set if the Context creation was successful. |
| + SUCCESS, |
| + }; |
| + |
| using ContextProviderCallback = |
| - base::Callback<void(const scoped_refptr<cc::ContextProvider>&)>; |
| + base::Callback<void(const scoped_refptr<cc::ContextProvider>&, |
| + ContextCreationResult)>; |
| enum class ContextType { |
| BLIMP_RENDER_COMPOSITOR_CONTEXT, |
| @@ -52,8 +68,8 @@ class UI_ANDROID_EXPORT ContextProviderFactory { |
| // Creates an offscreen ContextProvider for the compositor. Any shared |
| // contexts passed here *must* have been created using this factory. |
| - // The callback may be triggered synchronously if possible, and will always |
| - // have the context provider. |
| + // The callback may be triggered synchronously if possible. If the context |
| + // creation fails, a null context is passed with the specified reason. |
| virtual void CreateOffscreenContextProvider( |
| ContextType context_type, |
| gpu::SharedMemoryLimits shared_memory_limits, |