OLD | NEW |
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 <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 gpu_init.set_sandbox_helper(&sandbox_helper); | 254 gpu_init.set_sandbox_helper(&sandbox_helper); |
255 | 255 |
256 // Gpu initialization may fail for various reasons, in which case we will need | 256 // Gpu initialization may fail for various reasons, in which case we will need |
257 // to tear down this process. However, we can not do so safely until the IPC | 257 // to tear down this process. However, we can not do so safely until the IPC |
258 // channel is set up, because the detection of early return of a child process | 258 // channel is set up, because the detection of early return of a child process |
259 // is implemented using an IPC channel error. If the IPC channel is not fully | 259 // is implemented using an IPC channel error. If the IPC channel is not fully |
260 // set up between the browser and GPU process, and the GPU process crashes or | 260 // set up between the browser and GPU process, and the GPU process crashes or |
261 // exits early, the browser process will never detect it. For this reason we | 261 // exits early, the browser process will never detect it. For this reason we |
262 // defer tearing down the GPU process until receiving the GpuMsg_Initialize | 262 // defer tearing down the GPU process until receiving the GpuMsg_Initialize |
263 // message from the browser. | 263 // message from the browser. |
264 const bool init_success = gpu_init.InitializeAndStartSandbox(command_line); | 264 // TODO(fwang): Must plumb the shell::Connector* to here. |
| 265 const bool init_success = |
| 266 gpu_init.InitializeAndStartSandbox(command_line, nullptr); |
265 const bool dead_on_arrival = !init_success; | 267 const bool dead_on_arrival = !init_success; |
266 | 268 |
267 logging::SetLogMessageHandler(NULL); | 269 logging::SetLogMessageHandler(NULL); |
268 GetContentClient()->SetGpuInfo(gpu_init.gpu_info()); | 270 GetContentClient()->SetGpuInfo(gpu_init.gpu_info()); |
269 | 271 |
270 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory; | 272 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory; |
271 if (init_success && | 273 if (init_success && |
272 gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) | 274 gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) |
273 gpu_memory_buffer_factory = gpu::GpuMemoryBufferFactory::CreateNativeType(); | 275 gpu_memory_buffer_factory = gpu::GpuMemoryBufferFactory::CreateNativeType(); |
274 | 276 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return true; | 359 return true; |
358 } | 360 } |
359 | 361 |
360 return false; | 362 return false; |
361 } | 363 } |
362 #endif // defined(OS_WIN) | 364 #endif // defined(OS_WIN) |
363 | 365 |
364 } // namespace. | 366 } // namespace. |
365 | 367 |
366 } // namespace content | 368 } // namespace content |
OLD | NEW |