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

Unified Diff: gpu/ipc/service/child_window_win.h

Issue 2623763003: Split out ChildWindowWin (Closed)
Patch Set: add comment Created 3 years, 11 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 | « gpu/ipc/service/child_window_surface_win.cc ('k') | gpu/ipc/service/child_window_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/child_window_win.h
diff --git a/gpu/ipc/service/child_window_win.h b/gpu/ipc/service/child_window_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..2bccf9ff926e310c77fef88b795ab3b8811474f3
--- /dev/null
+++ b/gpu/ipc/service/child_window_win.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_
+#define GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_
+
+#include "base/memory/weak_ptr.h"
+#include "gpu/ipc/service/image_transport_surface_delegate.h"
+
+#include <windows.h>
+
+namespace gpu {
+
+struct SharedData;
+
+// The window DirectComposition renders into needs to be owned by the process
+// that's currently doing the rendering. The class creates and owns a window
+// which is reparented by the browser to be a child of its window.
+class ChildWindowWin {
+ public:
+ ChildWindowWin(base::WeakPtr<ImageTransportSurfaceDelegate> delegate,
+ HWND parent_window);
+ ~ChildWindowWin();
+
+ bool Initialize();
+ void ClearInvalidContents();
+ HWND window() const { return window_; }
+
+ private:
+ // This member contains all the data that can be accessed from the main or
+ // window owner threads.
+ std::unique_ptr<SharedData> shared_data_;
+ // The eventual parent of the window living in the browser process.
+ HWND parent_window_;
+ HWND window_;
+ // The window is initially created with this parent window. We need to keep it
+ // around so that we can destroy it at the end.
+ HWND initial_parent_window_;
+ base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChildWindowWin);
+};
+
+} // namespace gpu
+
+#endif // GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_
« no previous file with comments | « gpu/ipc/service/child_window_surface_win.cc ('k') | gpu/ipc/service/child_window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698