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

Side by Side Diff: content/common/gpu/gpu_channel_test_common.h

Issue 1716813002: Use GpuPreferences to avoid directly accessing switches in gpu related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "content/common/gpu/gpu_channel.h" 8 #include "content/common/gpu/gpu_channel.h"
9 #include "content/common/gpu/gpu_channel_manager.h" 9 #include "content/common/gpu/gpu_channel_manager.h"
10 #include "content/common/gpu/gpu_channel_manager_delegate.h" 10 #include "content/common/gpu/gpu_channel_manager_delegate.h"
11 #include "gpu/command_buffer/service/gpu_preferences.h"
11 #include "ipc/ipc_test_sink.h" 12 #include "ipc/ipc_test_sink.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 namespace base { 15 namespace base {
15 class TestSimpleTaskRunner; 16 class TestSimpleTaskRunner;
16 } // namespace base 17 } // namespace base
17 18
18 namespace IPC { 19 namespace IPC {
19 class TestSink; 20 class TestSink;
20 } // namespace IPC 21 } // namespace IPC
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 const gfx::PluginWindowHandle& child_window) override; 58 const gfx::PluginWindowHandle& child_window) override;
58 #endif 59 #endif
59 60
60 IPC::ChannelHandle last_established_channel_handle_; 61 IPC::ChannelHandle last_established_channel_handle_;
61 62
62 DISALLOW_COPY_AND_ASSIGN(TestGpuChannelManagerDelegate); 63 DISALLOW_COPY_AND_ASSIGN(TestGpuChannelManagerDelegate);
63 }; 64 };
64 65
65 class TestGpuChannelManager : public GpuChannelManager { 66 class TestGpuChannelManager : public GpuChannelManager {
66 public: 67 public:
67 TestGpuChannelManager(GpuChannelManagerDelegate* delegate, 68 TestGpuChannelManager(const gpu::GpuPreferences& gpu_preferences,
69 GpuChannelManagerDelegate* delegate,
68 base::SingleThreadTaskRunner* task_runner, 70 base::SingleThreadTaskRunner* task_runner,
69 base::SingleThreadTaskRunner* io_task_runner, 71 base::SingleThreadTaskRunner* io_task_runner,
70 gpu::SyncPointManager* sync_point_manager, 72 gpu::SyncPointManager* sync_point_manager,
71 GpuMemoryBufferFactory* gpu_memory_buffer_factory); 73 GpuMemoryBufferFactory* gpu_memory_buffer_factory);
72 ~TestGpuChannelManager() override; 74 ~TestGpuChannelManager() override;
73 75
74 protected: 76 protected:
75 scoped_ptr<GpuChannel> CreateGpuChannel( 77 scoped_ptr<GpuChannel> CreateGpuChannel(
76 int client_id, 78 int client_id,
77 uint64_t client_tracing_id, 79 uint64_t client_tracing_id,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 ~GpuChannelTestCommon() override; 116 ~GpuChannelTestCommon() override;
115 117
116 protected: 118 protected:
117 GpuChannelManager* channel_manager() { return channel_manager_.get(); } 119 GpuChannelManager* channel_manager() { return channel_manager_.get(); }
118 TestGpuChannelManagerDelegate* channel_manager_delegate() { 120 TestGpuChannelManagerDelegate* channel_manager_delegate() {
119 return channel_manager_delegate_.get(); 121 return channel_manager_delegate_.get();
120 } 122 }
121 base::TestSimpleTaskRunner* task_runner() { return task_runner_.get(); } 123 base::TestSimpleTaskRunner* task_runner() { return task_runner_.get(); }
122 124
123 private: 125 private:
126 gpu::GpuPreferences gpu_preferences_;
124 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; 127 scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
125 scoped_refptr<base::TestSimpleTaskRunner> io_task_runner_; 128 scoped_refptr<base::TestSimpleTaskRunner> io_task_runner_;
126 scoped_ptr<gpu::SyncPointManager> sync_point_manager_; 129 scoped_ptr<gpu::SyncPointManager> sync_point_manager_;
127 scoped_ptr<TestGpuChannelManagerDelegate> channel_manager_delegate_; 130 scoped_ptr<TestGpuChannelManagerDelegate> channel_manager_delegate_;
128 scoped_ptr<GpuChannelManager> channel_manager_; 131 scoped_ptr<GpuChannelManager> channel_manager_;
129 }; 132 };
130 133
131 } // namespace content 134 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698