| 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 ui::Clipboard::SetAllowedThreads(allowed_clipboard_threads); | 742 ui::Clipboard::SetAllowedThreads(allowed_clipboard_threads); |
| 743 | 743 |
| 744 // When running the GPU thread in-process, avoid optimistically starting it | 744 // When running the GPU thread in-process, avoid optimistically starting it |
| 745 // since creating the GPU thread races against creation of the one-and-only | 745 // since creating the GPU thread races against creation of the one-and-only |
| 746 // ChildProcess instance which is created by the renderer thread. | 746 // ChildProcess instance which is created by the renderer thread. |
| 747 if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed() && | 747 if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed() && |
| 748 IsForceCompositingModeEnabled() && | 748 IsForceCompositingModeEnabled() && |
| 749 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) && | 749 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) && |
| 750 !parsed_command_line_.HasSwitch(switches::kSingleProcess) && | 750 !parsed_command_line_.HasSwitch(switches::kSingleProcess) && |
| 751 !parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { | 751 !parsed_command_line_.HasSwitch(switches::kInProcessGPU)) { |
| 752 TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process"); | 752 TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process", |
| 753 TRACE_EVENT_SCOPE_THREAD); |
| 753 BrowserThread::PostTask( | 754 BrowserThread::PostTask( |
| 754 BrowserThread::IO, FROM_HERE, base::Bind( | 755 BrowserThread::IO, FROM_HERE, base::Bind( |
| 755 base::IgnoreResult(&GpuProcessHost::Get), | 756 base::IgnoreResult(&GpuProcessHost::Get), |
| 756 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 757 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
| 757 CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); | 758 CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); |
| 758 } | 759 } |
| 759 #endif // !defined(OS_IOS) | 760 #endif // !defined(OS_IOS) |
| 760 } | 761 } |
| 761 | 762 |
| 762 void BrowserMainLoop::InitializeToolkit() { | 763 void BrowserMainLoop::InitializeToolkit() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 813 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 813 if (parameters_.ui_task) | 814 if (parameters_.ui_task) |
| 814 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 815 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
| 815 | 816 |
| 816 base::RunLoop run_loop; | 817 base::RunLoop run_loop; |
| 817 run_loop.Run(); | 818 run_loop.Run(); |
| 818 #endif | 819 #endif |
| 819 } | 820 } |
| 820 | 821 |
| 821 } // namespace content | 822 } // namespace content |
| OLD | NEW |