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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 BrowserThreadsStarted(); | 435 BrowserThreadsStarted(); |
436 | 436 |
437 if (parts_.get()) | 437 if (parts_.get()) |
438 parts_->PreMainMessageLoopRun(); | 438 parts_->PreMainMessageLoopRun(); |
439 | 439 |
440 // When running the GPU thread in-process, avoid optimistically starting it | 440 // When running the GPU thread in-process, avoid optimistically starting it |
441 // since creating the GPU thread races against creation of the one-and-only | 441 // since creating the GPU thread races against creation of the one-and-only |
442 // ChildProcess instance which is created by the renderer thread. | 442 // ChildProcess instance which is created by the renderer thread. |
443 GpuDataManager* gpu_data_manager = content::GpuDataManager::GetInstance(); | 443 GpuDataManager* gpu_data_manager = content::GpuDataManager::GetInstance(); |
444 if (gpu_data_manager->GpuAccessAllowed() && | 444 if (gpu_data_manager->GpuAccessAllowed() && |
| 445 (gpu_data_manager->GetGpuFeatureType() & |
| 446 GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) == 0 && |
445 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) && | 447 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) && |
446 !parsed_command_line_.HasSwitch(switches::kSingleProcess) && | 448 !parsed_command_line_.HasSwitch(switches::kSingleProcess) && |
447 !parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { | 449 !parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { |
448 TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process"); | 450 TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process"); |
449 BrowserThread::PostTask( | 451 BrowserThread::PostTask( |
450 BrowserThread::IO, FROM_HERE, base::Bind( | 452 BrowserThread::IO, FROM_HERE, base::Bind( |
451 base::IgnoreResult(&GpuProcessHost::Get), | 453 base::IgnoreResult(&GpuProcessHost::Get), |
452 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 454 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
453 content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); | 455 content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); |
454 } | 456 } |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 677 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
676 if (parameters_.ui_task) | 678 if (parameters_.ui_task) |
677 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 679 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
678 | 680 |
679 base::RunLoop run_loop; | 681 base::RunLoop run_loop; |
680 run_loop.Run(); | 682 run_loop.Run(); |
681 #endif | 683 #endif |
682 } | 684 } |
683 | 685 |
684 } // namespace content | 686 } // namespace content |
OLD | NEW |