Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: content/public/browser/android/context_provider_factory.h

Issue 2190033002: content: Add ContextProviderFactory to create a render ContextProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_CONTEXT_PROVIDER_FACTORY_H_
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_CONTEXT_PROVIDER_FACTORY_H_
7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h"
11
12 namespace cc {
13 class ContextProvider;
14 class VulkanContextProvider;
15 }
16
17 namespace content {
18
19 // This class is not thread-safe and should only be accessed from the UI thread.
20 class CONTENT_EXPORT ContextProviderFactory {
21 public:
22 struct ContextProviders {
23 ContextProviders();
24 ~ContextProviders();
25
26 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider;
27
28 scoped_refptr<cc::ContextProvider> compositor_context_provider;
29 scoped_refptr<cc::ContextProvider> worker_context_provider;
30 };
31
32 using ContextProviderCallback = base::Callback<void(const ContextProviders&)>;
33
34 static ContextProviderFactory* GetInstance();
35
36 virtual ~ContextProviderFactory(){};
37
38 // Creates a ContextProvider with an offscreen context for a compositor
39 // rendering web content.
40 virtual void RequestRenderContextProvider(
41 ContextProviderCallback result_callback) = 0;
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTEXT_PROVIDER_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698