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

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

Issue 1579863003: Convert Pass()→std::move() for Mac build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | device/bluetooth/bluetooth_l2cap_channel_mac.mm » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/debugger.h" 10 #include "base/debug/debugger.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // whatever occurs before it. 140 // whatever occurs before it.
141 HandleRendererErrorTestParameters(parsed_command_line); 141 HandleRendererErrorTestParameters(parsed_command_line);
142 142
143 RendererMainPlatformDelegate platform(parameters); 143 RendererMainPlatformDelegate platform(parameters);
144 #if defined(OS_MACOSX) 144 #if defined(OS_MACOSX)
145 // As long as scrollbars on Mac are painted with Cocoa, the message pump 145 // As long as scrollbars on Mac are painted with Cocoa, the message pump
146 // needs to be backed by a Foundation-level loop to process NSTimers. See 146 // needs to be backed by a Foundation-level loop to process NSTimers. See
147 // http://crbug.com/306348#c24 for details. 147 // http://crbug.com/306348#c24 for details.
148 scoped_ptr<base::MessagePump> pump(new base::MessagePumpNSRunLoop()); 148 scoped_ptr<base::MessagePump> pump(new base::MessagePumpNSRunLoop());
149 scoped_ptr<base::MessageLoop> main_message_loop( 149 scoped_ptr<base::MessageLoop> main_message_loop(
150 new base::MessageLoop(pump.Pass())); 150 new base::MessageLoop(std::move(pump)));
151 #else 151 #else
152 // The main message loop of the renderer services doesn't have IO or UI tasks. 152 // The main message loop of the renderer services doesn't have IO or UI tasks.
153 scoped_ptr<base::MessageLoop> main_message_loop(new base::MessageLoop()); 153 scoped_ptr<base::MessageLoop> main_message_loop(new base::MessageLoop());
154 #endif 154 #endif
155 155
156 base::PlatformThread::SetName("CrRendererMain"); 156 base::PlatformThread::SetName("CrRendererMain");
157 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler( 157 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler(
158 scheduler::RendererScheduler::Create()); 158 scheduler::RendererScheduler::Create());
159 159
160 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); 160 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // zygote_main_linux.cc. However, calling multiple times from the same thread 199 // zygote_main_linux.cc. However, calling multiple times from the same thread
200 // is OK. 200 // is OK.
201 InitializeWebRtcModule(); 201 InitializeWebRtcModule();
202 #endif 202 #endif
203 203
204 { 204 {
205 #if defined(OS_WIN) || defined(OS_MACOSX) 205 #if defined(OS_WIN) || defined(OS_MACOSX)
206 // TODO(markus): Check if it is OK to unconditionally move this 206 // TODO(markus): Check if it is OK to unconditionally move this
207 // instruction down. 207 // instruction down.
208 RenderProcessImpl render_process; 208 RenderProcessImpl render_process;
209 RenderThreadImpl::Create(main_message_loop.Pass(), 209 RenderThreadImpl::Create(std::move(main_message_loop),
210 renderer_scheduler.Pass()); 210 std::move(renderer_scheduler));
211 #endif 211 #endif
212 bool run_loop = true; 212 bool run_loop = true;
213 if (!no_sandbox) 213 if (!no_sandbox)
214 run_loop = platform.EnableSandbox(); 214 run_loop = platform.EnableSandbox();
215 #if defined(OS_POSIX) && !defined(OS_MACOSX) 215 #if defined(OS_POSIX) && !defined(OS_MACOSX)
216 RenderProcessImpl render_process; 216 RenderProcessImpl render_process;
217 RenderThreadImpl::Create(std::move(main_message_loop), 217 RenderThreadImpl::Create(std::move(main_message_loop),
218 std::move(renderer_scheduler)); 218 std::move(renderer_scheduler));
219 #endif 219 #endif
220 RenderThreadImpl::current()->Send( 220 RenderThreadImpl::current()->Send(
(...skipping 16 matching lines...) Expand all
237 // ignore shutdown-only leaks. 237 // ignore shutdown-only leaks.
238 __lsan_do_leak_check(); 238 __lsan_do_leak_check();
239 #endif 239 #endif
240 } 240 }
241 platform.PlatformUninitialize(); 241 platform.PlatformUninitialize();
242 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0); 242 TRACE_EVENT_ASYNC_END0("startup", "RendererMain", 0);
243 return 0; 243 return 0;
244 } 244 }
245 245
246 } // namespace content 246 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/gpu_main.cc ('k') | device/bluetooth/bluetooth_l2cap_channel_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698