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

Side by Side Diff: gpu/ipc/service/child_window_win.h

Issue 2729073002: Fix DirectCompositionSurfaceTest.TestMakeCurrent flakiness. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/ipc/service/child_window_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_ 5 #ifndef GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_
6 #define GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_ 6 #define GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/task_runner.h"
9 #include "gpu/ipc/service/image_transport_surface_delegate.h" 10 #include "gpu/ipc/service/image_transport_surface_delegate.h"
10 11
11 #include <windows.h> 12 #include <windows.h>
12 13
13 namespace gpu { 14 namespace gpu {
14 15
15 struct SharedData; 16 struct SharedData;
16 17
17 // The window DirectComposition renders into needs to be owned by the process 18 // The window DirectComposition renders into needs to be owned by the process
18 // that's currently doing the rendering. The class creates and owns a window 19 // that's currently doing the rendering. The class creates and owns a window
19 // which is reparented by the browser to be a child of its window. 20 // which is reparented by the browser to be a child of its window.
20 class ChildWindowWin { 21 class ChildWindowWin {
21 public: 22 public:
22 ChildWindowWin(base::WeakPtr<ImageTransportSurfaceDelegate> delegate, 23 ChildWindowWin(base::WeakPtr<ImageTransportSurfaceDelegate> delegate,
23 HWND parent_window); 24 HWND parent_window);
24 ~ChildWindowWin(); 25 ~ChildWindowWin();
25 26
26 bool Initialize(); 27 bool Initialize();
27 void ClearInvalidContents(); 28 void ClearInvalidContents();
28 HWND window() const { return window_; } 29 HWND window() const { return window_; }
29 30
31 scoped_refptr<base::TaskRunner> GetTaskRunnerForTesting();
32
30 private: 33 private:
31 // This member contains all the data that can be accessed from the main or 34 // This member contains all the data that can be accessed from the main or
32 // window owner threads. 35 // window owner threads.
33 std::unique_ptr<SharedData> shared_data_; 36 std::unique_ptr<SharedData> shared_data_;
34 // The eventual parent of the window living in the browser process. 37 // The eventual parent of the window living in the browser process.
35 HWND parent_window_; 38 HWND parent_window_;
36 HWND window_; 39 HWND window_;
37 // The window is initially created with this parent window. We need to keep it 40 // The window is initially created with this parent window. We need to keep it
38 // around so that we can destroy it at the end. 41 // around so that we can destroy it at the end.
39 HWND initial_parent_window_; 42 HWND initial_parent_window_;
40 base::WeakPtr<ImageTransportSurfaceDelegate> delegate_; 43 base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
41 44
42 DISALLOW_COPY_AND_ASSIGN(ChildWindowWin); 45 DISALLOW_COPY_AND_ASSIGN(ChildWindowWin);
43 }; 46 };
44 47
45 } // namespace gpu 48 } // namespace gpu
46 49
47 #endif // GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_ 50 #endif // GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | gpu/ipc/service/child_window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698