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

Unified Diff: ui/compositor/test/in_process_context_factory.h

Issue 2083853002: exo: Recreate Surface resources on context lost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/test/in_process_context_factory.h
diff --git a/ui/compositor/test/in_process_context_factory.h b/ui/compositor/test/in_process_context_factory.h
index 525126021bfcaeb7ce39167941acb89347d80a52..3870f038b805a894f3cf30bec3a429a20629559b 100644
--- a/ui/compositor/test/in_process_context_factory.h
+++ b/ui/compositor/test/in_process_context_factory.h
@@ -41,6 +41,10 @@ class InProcessContextFactory : public ContextFactory {
use_test_surface_ = use_test_surface;
}
+ // This is used to call OnLostResources on all clients, to ensure they stop
+ // using the SharedMainThreadContextProvider.
+ void SendOnLostResources();
+
// ContextFactory implementation
void CreateOutputSurface(base::WeakPtr<Compositor> compositor) override;
@@ -63,6 +67,8 @@ class InProcessContextFactory : public ContextFactory {
void SetAuthoritativeVSyncInterval(ui::Compositor* compositor,
base::TimeDelta interval) override {}
void SetOutputIsSecure(ui::Compositor* compositor, bool secure) override {}
+ void AddObserver(ContextFactoryObserver* observer) override;
+ void RemoveObserver(ContextFactoryObserver* observer) override;
private:
scoped_refptr<InProcessContextProvider> shared_main_thread_contexts_;
@@ -75,6 +81,7 @@ class InProcessContextFactory : public ContextFactory {
bool use_test_surface_;
bool context_factory_for_test_;
cc::SurfaceManager* surface_manager_;
+ base::ObserverList<ContextFactoryObserver> observer_list_;
base::hash_map<Compositor*, std::unique_ptr<cc::Display>>
per_compositor_data_;
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698