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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1547793004: Make gpu black list work again on Linux (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
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 "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 697 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
698 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); 698 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr);
699 } 699 }
700 700
701 int BrowserMainLoop::PreCreateThreads() { 701 int BrowserMainLoop::PreCreateThreads() {
702 if (parts_) { 702 if (parts_) {
703 TRACE_EVENT0("startup", 703 TRACE_EVENT0("startup",
704 "BrowserMainLoop::CreateThreads:PreCreateThreads"); 704 "BrowserMainLoop::CreateThreads:PreCreateThreads");
705 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::PreCreateThreads"); 705 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::PreCreateThreads");
706 706
707 result_code_ = parts_->PreCreateThreads(); 707 result_code_ = parts_->PreCreateThreadsBegin();
708 } 708 }
709 709
710 // Initialize an instance of FeatureList. This will be a no-op if an instance 710 // Initialize an instance of FeatureList. This will be a no-op if an instance
711 // was already set up by the embedder. 711 // was already set up by the embedder.
712 base::FeatureList::InitializeInstance(); 712 base::FeatureList::InitializeInstance();
713 713
714 // TODO(chrisha): Abstract away this construction mess to a helper function, 714 // TODO(chrisha): Abstract away this construction mess to a helper function,
715 // once MemoryPressureMonitor is made a concrete class. 715 // once MemoryPressureMonitor is made a concrete class.
716 #if defined(OS_CHROMEOS) 716 #if defined(OS_CHROMEOS)
717 if (chromeos::switches::MemoryPressureHandlingEnabled()) { 717 if (chromeos::switches::MemoryPressureHandlingEnabled()) {
(...skipping 21 matching lines...) Expand all
739 #if defined(OS_MACOSX) && !defined(OS_IOS) 739 #if defined(OS_MACOSX) && !defined(OS_IOS)
740 // The WindowResizeHelper allows the UI thread to wait on specific renderer 740 // The WindowResizeHelper allows the UI thread to wait on specific renderer
741 // and GPU messages from the IO thread. Initializing it before the IO thread 741 // and GPU messages from the IO thread. Initializing it before the IO thread
742 // starts ensures the affected IO thread messages always have somewhere to go. 742 // starts ensures the affected IO thread messages always have somewhere to go.
743 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); 743 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get());
744 #endif 744 #endif
745 745
746 // 1) Need to initialize in-process GpuDataManager before creating threads. 746 // 1) Need to initialize in-process GpuDataManager before creating threads.
747 // It's unsafe to append the gpu command line switches to the global 747 // It's unsafe to append the gpu command line switches to the global
748 // CommandLine::ForCurrentProcess object after threads are created. 748 // CommandLine::ForCurrentProcess object after threads are created.
749 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags. 749 // 2) Must be after parts_->PreCreateThreadsBegin to pick up chrome://flags.
750 GpuDataManagerImpl::GetInstance()->Initialize(); 750 GpuDataManagerImpl::GetInstance()->Initialize();
751 751
752 #if !defined(OS_IOS) && (!defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)) 752 #if !defined(OS_IOS) && (!defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID))
753 // Single-process is an unsupported and not fully tested mode, so 753 // Single-process is an unsupported and not fully tested mode, so
754 // don't enable it for official Chrome builds (except on Android). 754 // don't enable it for official Chrome builds (except on Android).
755 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) 755 if (parsed_command_line_.HasSwitch(switches::kSingleProcess))
756 RenderProcessHost::SetRunRendererInProcess(true); 756 RenderProcessHost::SetRunRendererInProcess(true);
757 #endif 757 #endif
758 758
759 // parts may want to do some processing just before actually starting the
760 // threads.
761 if (parts_)
762 parts_->PreCreateThreadsEnd();
763
759 return result_code_; 764 return result_code_;
760 } 765 }
761 766
762 void BrowserMainLoop::CreateStartupTasks() { 767 void BrowserMainLoop::CreateStartupTasks() {
763 TRACE_EVENT0("startup", "BrowserMainLoop::CreateStartupTasks"); 768 TRACE_EVENT0("startup", "BrowserMainLoop::CreateStartupTasks");
764 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::CreateStartupTasks"); 769 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::CreateStartupTasks");
765 770
766 // First time through, we really want to create all the tasks 771 // First time through, we really want to create all the tasks
767 if (!startup_task_runner_.get()) { 772 if (!startup_task_runner_.get()) {
768 #if defined(OS_ANDROID) 773 #if defined(OS_ANDROID)
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 #endif 1201 #endif
1197 1202
1198 bool always_uses_gpu = true; 1203 bool always_uses_gpu = true;
1199 bool established_gpu_channel = false; 1204 bool established_gpu_channel = false;
1200 #if defined(OS_ANDROID) && !defined(USE_AURA) 1205 #if defined(OS_ANDROID) && !defined(USE_AURA)
1201 // TODO(crbug.com/439322): This should be set to |true|. 1206 // TODO(crbug.com/439322): This should be set to |true|.
1202 established_gpu_channel = false; 1207 established_gpu_channel = false;
1203 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); 1208 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel);
1204 #elif defined(USE_AURA) || defined(OS_MACOSX) 1209 #elif defined(USE_AURA) || defined(OS_MACOSX)
1205 established_gpu_channel = true; 1210 established_gpu_channel = true;
1211 DVLOG(1) << "check and maybe start gpu process";
1206 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || 1212 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() ||
1207 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit)) { 1213 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit)) {
1208 established_gpu_channel = always_uses_gpu = false; 1214 established_gpu_channel = always_uses_gpu = false;
1209 } 1215 }
1210 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); 1216 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel);
1217 DVLOG(1) << "/check and maybe start gpu process";
1211 ImageTransportFactory::Initialize(); 1218 ImageTransportFactory::Initialize();
1212 #if defined(USE_AURA) 1219 #if defined(USE_AURA)
1213 bool use_mus_in_renderer = false; 1220 bool use_mus_in_renderer = false;
1214 #if defined (MOJO_SHELL_CLIENT) 1221 #if defined (MOJO_SHELL_CLIENT)
1215 use_mus_in_renderer = base::CommandLine::ForCurrentProcess()->HasSwitch( 1222 use_mus_in_renderer = base::CommandLine::ForCurrentProcess()->HasSwitch(
1216 switches::kUseMusInRenderer); 1223 switches::kUseMusInRenderer);
1217 #endif // defined(MOJO_SHELL_CLIENT); 1224 #endif // defined(MOJO_SHELL_CLIENT);
1218 if (aura::Env::GetInstance() && !use_mus_in_renderer) { 1225 if (aura::Env::GetInstance() && !use_mus_in_renderer) {
1219 aura::Env::GetInstance()->set_context_factory(GetContextFactory()); 1226 aura::Env::GetInstance()->set_context_factory(GetContextFactory());
1220 } 1227 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 DCHECK(is_tracing_startup_for_duration_); 1469 DCHECK(is_tracing_startup_for_duration_);
1463 1470
1464 is_tracing_startup_for_duration_ = false; 1471 is_tracing_startup_for_duration_ = false;
1465 TracingController::GetInstance()->StopTracing( 1472 TracingController::GetInstance()->StopTracing(
1466 TracingController::CreateFileSink( 1473 TracingController::CreateFileSink(
1467 startup_trace_file_, 1474 startup_trace_file_,
1468 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1475 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1469 } 1476 }
1470 1477
1471 } // namespace content 1478 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698