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

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: Add ThreadChecker 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
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..b69f36ae1ed8a3e92a134ee05ecd622e41afb8d5 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,26 @@ 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);
+};
+
+class WindowSurfaceBinding {
sadrul 2015/11/27 21:21:37 Document
Fady Samuel 2015/11/28 21:47:36 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698