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

Unified Diff: components/mus/public/cpp/window_surface.h

Issue 1484533002: mus: Introduce AttachSurface to allow creating Surface prior to OnEmbed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Sadrul's comments Created 5 years, 1 month 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 | « components/mus/public/cpp/window.h ('k') | components/mus/public/interfaces/window_tree.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/window_surface.h
diff --git a/components/mus/public/cpp/window_surface.h b/components/mus/public/cpp/window_surface.h
index 49ae2d313d2fafe3c6867df05065ea53b9389aae..2a285259d0a696ae977e03595a63b71d240cba42 100644
--- a/components/mus/public/cpp/window_surface.h
+++ b/components/mus/public/cpp/window_surface.h
@@ -5,21 +5,28 @@
#ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_SURFACE_H_
#define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_SURFACE_H_
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
+#include "base/threading/thread_checker.h"
#include "components/mus/public/interfaces/compositor_frame.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/interface_ptr_info.h"
namespace mus {
+class WindowSurfaceBinding;
class WindowSurfaceClient;
class Window;
-// A WindowSurface is wrapper to simplify submitting CompositorFrames to Views,
-// and receiving ReturnedResources.
+// A WindowSurface is wrapper to simplify submitting CompositorFrames to
+// Windows, and receiving ReturnedResources.
class WindowSurface : public mojom::SurfaceClient {
public:
+ // static
+ static scoped_ptr<WindowSurface> Create(
+ scoped_ptr<WindowSurfaceBinding>* surface_binding);
+
~WindowSurface() override;
// Called to indicate that the current thread has assumed control of this
@@ -46,7 +53,29 @@ class WindowSurface : public mojom::SurfaceClient {
mojo::InterfaceRequest<mojom::SurfaceClient> client_request_;
mojom::SurfacePtr surface_;
scoped_ptr<mojo::Binding<mojom::SurfaceClient>> client_binding_;
- bool bound_to_thread_;
+ scoped_ptr<base::ThreadChecker> thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowSurface);
+};
+
+// A WindowSurfaceBinding is a bundle of mojo interfaces that are to be used by
+// or implemented by the Mus window server when passed into
+// Window::AttachSurface. WindowSurfaceBinding has no standalone functionality.
+class WindowSurfaceBinding {
+ public:
+ ~WindowSurfaceBinding();
+
+ private:
+ friend class WindowSurface;
+ friend class Window;
+
+ WindowSurfaceBinding(mojo::InterfaceRequest<mojom::Surface> surface_request,
+ mojom::SurfaceClientPtr surface_client);
+
+ mojo::InterfaceRequest<mojom::Surface> surface_request_;
+ mojom::SurfaceClientPtr surface_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowSurfaceBinding);
};
} // namespace mus
« no previous file with comments | « components/mus/public/cpp/window.h ('k') | components/mus/public/interfaces/window_tree.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698