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

Side by Side Diff: content/renderer/render_thread_impl_browsertest.cc

Issue 1873783003: Convert //content/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « content/renderer/render_thread_impl.cc ('k') | content/renderer/render_view_browsertest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #if defined(COMPILER_MSVC) 96 #if defined(COMPILER_MSVC)
97 // See explanation for other RenderViewHostImpl which is the same issue. 97 // See explanation for other RenderViewHostImpl which is the same issue.
98 #pragma warning(push) 98 #pragma warning(push)
99 #pragma warning(disable: 4250) 99 #pragma warning(disable: 4250)
100 #endif 100 #endif
101 101
102 class RenderThreadImplForTest : public RenderThreadImpl { 102 class RenderThreadImplForTest : public RenderThreadImpl {
103 public: 103 public:
104 RenderThreadImplForTest( 104 RenderThreadImplForTest(
105 const InProcessChildThreadParams& params, 105 const InProcessChildThreadParams& params,
106 scoped_ptr<scheduler::RendererScheduler> scheduler, 106 std::unique_ptr<scheduler::RendererScheduler> scheduler,
107 scoped_refptr<base::SingleThreadTaskRunner>& test_task_counter) 107 scoped_refptr<base::SingleThreadTaskRunner>& test_task_counter)
108 : RenderThreadImpl(params, std::move(scheduler), test_task_counter) { 108 : RenderThreadImpl(params, std::move(scheduler), test_task_counter) {}
109 }
110 109
111 ~RenderThreadImplForTest() override {} 110 ~RenderThreadImplForTest() override {}
112 111
113 using ChildThreadImpl::OnMessageReceived; 112 using ChildThreadImpl::OnMessageReceived;
114 113
115 private: 114 private:
116 }; 115 };
117 116
118 #if defined(COMPILER_MSVC) 117 #if defined(COMPILER_MSVC)
119 #pragma warning(pop) 118 #pragma warning(pop)
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 cmd->AppendSwitchASCII(switches::kNumRasterThreads, "1"); 168 cmd->AppendSwitchASCII(switches::kNumRasterThreads, "1");
170 std::string image_targets; 169 std::string image_targets;
171 for (size_t format = 0; 170 for (size_t format = 0;
172 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { 171 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) {
173 if (!image_targets.empty()) 172 if (!image_targets.empty())
174 image_targets += ","; 173 image_targets += ",";
175 image_targets += base::UintToString(GL_TEXTURE_2D); 174 image_targets += base::UintToString(GL_TEXTURE_2D);
176 } 175 }
177 cmd->AppendSwitchASCII(switches::kContentImageTextureTarget, image_targets); 176 cmd->AppendSwitchASCII(switches::kContentImageTextureTarget, image_targets);
178 177
179 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler = 178 std::unique_ptr<scheduler::RendererScheduler> renderer_scheduler =
180 scheduler::RendererScheduler::Create(); 179 scheduler::RendererScheduler::Create();
181 InitializeMojo(); 180 InitializeMojo();
182 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter( 181 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter(
183 test_task_counter_.get()); 182 test_task_counter_.get());
184 thread_ = new RenderThreadImplForTest( 183 thread_ = new RenderThreadImplForTest(
185 InProcessChildThreadParams(test_helper_->GetChannelId(), 184 InProcessChildThreadParams(test_helper_->GetChannelId(),
186 test_helper_->GetIOTaskRunner(), 185 test_helper_->GetIOTaskRunner(),
187 test_helper_->GetMessagePipeHandle()), 186 test_helper_->GetMessagePipeHandle()),
188 std::move(renderer_scheduler), test_task_counter); 187 std::move(renderer_scheduler), test_task_counter);
189 cmd->InitFromArgv(old_argv); 188 cmd->InitFromArgv(old_argv);
190 189
191 test_msg_filter_ = make_scoped_refptr( 190 test_msg_filter_ = make_scoped_refptr(
192 new QuitOnTestMsgFilter(test_helper_->GetMessageLoop())); 191 new QuitOnTestMsgFilter(test_helper_->GetMessageLoop()));
193 thread_->AddFilter(test_msg_filter_.get()); 192 thread_->AddFilter(test_msg_filter_.get());
194 } 193 }
195 194
196 scoped_refptr<TestTaskCounter> test_task_counter_; 195 scoped_refptr<TestTaskCounter> test_task_counter_;
197 scoped_ptr<ContentClient> content_client_; 196 std::unique_ptr<ContentClient> content_client_;
198 scoped_ptr<ContentBrowserClient> content_browser_client_; 197 std::unique_ptr<ContentBrowserClient> content_browser_client_;
199 scoped_ptr<ContentRendererClient> content_renderer_client_; 198 std::unique_ptr<ContentRendererClient> content_renderer_client_;
200 scoped_ptr<RenderThreadImplBrowserIPCTestHelper> test_helper_; 199 std::unique_ptr<RenderThreadImplBrowserIPCTestHelper> test_helper_;
201 scoped_ptr<MockRenderProcess> mock_process_; 200 std::unique_ptr<MockRenderProcess> mock_process_;
202 scoped_refptr<QuitOnTestMsgFilter> test_msg_filter_; 201 scoped_refptr<QuitOnTestMsgFilter> test_msg_filter_;
203 RenderThreadImplForTest* thread_; // Owned by mock_process_. 202 RenderThreadImplForTest* thread_; // Owned by mock_process_.
204 std::string channel_id_; 203 std::string channel_id_;
205 }; 204 };
206 205
207 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { 206 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) {
208 ASSERT_TRUE(thread->input_handler_manager()); 207 ASSERT_TRUE(thread->input_handler_manager());
209 } 208 }
210 209
211 // Check that InputHandlerManager outlives compositor thread because it uses 210 // Check that InputHandlerManager outlives compositor thread because it uses
(...skipping 25 matching lines...) Expand all
237 test_helper_->Sender()->Send(new WebSocketMsg_NotifyFailure(1, "")); 236 test_helper_->Sender()->Send(new WebSocketMsg_NotifyFailure(1, ""));
238 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop()); 237 test_helper_->Sender()->Send(new TestMsg_QuitRunLoop());
239 238
240 test_helper_->GetMessageLoop()->Run(); 239 test_helper_->GetMessageLoop()->Run();
241 240
242 EXPECT_EQ(0, test_task_counter_->NumTasksPosted()); 241 EXPECT_EQ(0, test_task_counter_->NumTasksPosted());
243 } 242 }
244 243
245 } // namespace 244 } // namespace
246 } // namespace content 245 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698