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

Unified Diff: content/browser/compositor/frame_sink_manager_host.h

Issue 2810703004: Add observers to FrameSinkManagerHost. (Closed)
Patch Set: Make more better. Created 3 years, 8 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
Index: content/browser/compositor/frame_sink_manager_host.h
diff --git a/content/browser/compositor/frame_sink_manager_host.h b/content/browser/compositor/frame_sink_manager_host.h
index 8c7865ddbef16db670fc221000383d1d93c2663d..6d600e61223101b32f82acadfc514310eb56fef5 100644
--- a/content/browser/compositor/frame_sink_manager_host.h
+++ b/content/browser/compositor/frame_sink_manager_host.h
@@ -7,9 +7,11 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/observer_list.h"
#include "cc/ipc/frame_sink_manager.mojom.h"
#include "cc/surfaces/frame_sink_id.h"
#include "components/viz/frame_sinks/mojo_frame_sink_manager.h"
+#include "content/browser/compositor/frame_sink_observer.h"
#include "content/common/content_export.h"
#include "mojo/public/cpp/bindings/binding.h"
@@ -33,6 +35,9 @@ class CONTENT_EXPORT FrameSinkManagerHost
// Start Mojo connection to FrameSinkManager. Most tests won't need this.
void ConnectToFrameSinkManager();
+ void AddObserver(FrameSinkObserver* observer);
Fady Samuel 2017/04/28 04:58:00 I had envisioned this would take in a FrameSinkId
kylechar 2017/05/01 19:07:48 After doing a quick implementation with unordered_
+ void RemoveObserver(FrameSinkObserver* observer);
+
// See frame_sink_manager.mojom for descriptions.
void CreateCompositorFrameSink(
const cc::FrameSinkId& frame_sink_id,
@@ -59,6 +64,9 @@ class CONTENT_EXPORT FrameSinkManagerHost
// happen using Mojo. See http://crbug.com/657959.
viz::MojoFrameSinkManager frame_sink_manager_;
+ // Local observers to that receive OnSurfaceCreated() messages from IPC.
+ base::ObserverList<FrameSinkObserver> observers_;
+
DISALLOW_COPY_AND_ASSIGN(FrameSinkManagerHost);
};

Powered by Google App Engine
This is Rietveld 408576698