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() == content::GPU_FEATURE_TYPE_ALL && | |
Zhenyao Mo
2012/07/30 22:42:06
!= instead of ==
| |
445 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) && | 446 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) && |
446 !parsed_command_line_.HasSwitch(switches::kSingleProcess) && | 447 !parsed_command_line_.HasSwitch(switches::kSingleProcess) && |
447 !parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { | 448 !parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { |
448 TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process"); | 449 TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process"); |
449 BrowserThread::PostTask( | 450 BrowserThread::PostTask( |
450 BrowserThread::IO, FROM_HERE, base::Bind( | 451 BrowserThread::IO, FROM_HERE, base::Bind( |
451 base::IgnoreResult(&GpuProcessHost::Get), | 452 base::IgnoreResult(&GpuProcessHost::Get), |
452 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 453 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
453 content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); | 454 content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); |
454 } | 455 } |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 676 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
676 if (parameters_.ui_task) | 677 if (parameters_.ui_task) |
677 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 678 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
678 | 679 |
679 base::RunLoop run_loop; | 680 base::RunLoop run_loop; |
680 run_loop.Run(); | 681 run_loop.Run(); |
681 #endif | 682 #endif |
682 } | 683 } |
683 | 684 |
684 } // namespace content | 685 } // namespace content |
OLD | NEW |