Commit b2c9713c authored by Xi Han's avatar Xi Han Committed by Commit Bot

Rename content_main_runner.cc and browser_main_runner.cc.

This CL is a precursor CL for https://crrev.com/c/969098. It simply contains a
file renaming to keep log history:

1. content_main_runner.cc rename to content_main_runner_impl.cc
2. browser_main_runner.cc rename to browser_main_runner_impl.cc

It allows to introduce content_main_runner_impl.h and browser_main_runner_impl.h
which contain new methods without changing their interface in /content/public.

Bug: 740677
Change-Id: I4e42bb594d65888b4358ac843b13837be26a5b7e
Reviewed-on: https://chromium-review.googlesource.com/1042456
Commit-Queue: Xi Han <hanxi@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557620}
parent 3de68da5
...@@ -23,8 +23,8 @@ namespace chromecast { ...@@ -23,8 +23,8 @@ namespace chromecast {
// THREAD SAFTEY: Accessing the CommandLine instance for this process is // THREAD SAFTEY: Accessing the CommandLine instance for this process is
// technically not threadsafe when using the component build. However, the // technically not threadsafe when using the component build. However, the
// instance is initialized on the main thread before any other threads are // instance is initialized on the main thread before any other threads are
// started (see content/app/content_main_runner.cc), so accessing this instance // started (see content/app/content_main_runner_impl.cc), so accessing this
// on those threads for read-operations is safe in practice. // instance on those threads for read-operations is safe in practice.
void InitCommandLineShlib(const std::vector<std::string>& argv); void InitCommandLineShlib(const std::vector<std::string>& argv);
} // namespace chromecast } // namespace chromecast
......
...@@ -71,7 +71,7 @@ template("implement_content_app") { ...@@ -71,7 +71,7 @@ template("implement_content_app") {
content_app_deps += [ "//content/ppapi_plugin:ppapi_plugin_sources" ] content_app_deps += [ "//content/ppapi_plugin:ppapi_plugin_sources" ]
} }
# Compile content_main_runner.cc in a separate target to exempt from GN # Compile content_main_runner_impl.cc in a separate target to exempt from GN
# header checking without exempting any other source file. This file includes # header checking without exempting any other source file. This file includes
# headers of all process types and varies significantly per platform in # headers of all process types and varies significantly per platform in
# between browser and child. Otherwise it would require many "nogncheck" # between browser and child. Otherwise it would require many "nogncheck"
...@@ -84,7 +84,7 @@ template("implement_content_app") { ...@@ -84,7 +84,7 @@ template("implement_content_app") {
check_includes = false check_includes = false
sources = [ sources = [
"content_main_runner.cc", "content_main_runner_impl.cc",
] ]
configs += extra_configs configs += extra_configs
......
...@@ -191,8 +191,8 @@ void InitializeFieldTrialAndFeatureList( ...@@ -191,8 +191,8 @@ void InitializeFieldTrialAndFeatureList(
// browser process. // browser process.
field_trial_list->reset(new base::FieldTrialList(nullptr)); field_trial_list->reset(new base::FieldTrialList(nullptr));
// Ensure any field trials in browser are reflected into the child // Ensure any field trials in browser are reflected into the child
// process. // process.
#if defined(OS_WIN) #if defined(OS_WIN)
base::FieldTrialList::CreateTrialsFromCommandLine( base::FieldTrialList::CreateTrialsFromCommandLine(
command_line, switches::kFieldTrialHandle, -1); command_line, switches::kFieldTrialHandle, -1);
...@@ -587,12 +587,12 @@ static void RegisterMainThreadFactories() { ...@@ -587,12 +587,12 @@ static void RegisterMainThreadFactories() {
#else #else
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kSingleProcess)) { if (command_line.HasSwitch(switches::kSingleProcess)) {
LOG(FATAL) << LOG(FATAL)
"--single-process is not supported in chrome multiple dll browser."; << "--single-process is not supported in chrome multiple dll browser.";
} }
if (command_line.HasSwitch(switches::kInProcessGPU)) { if (command_line.HasSwitch(switches::kInProcessGPU)) {
LOG(FATAL) << LOG(FATAL)
"--in-process-gpu is not supported in chrome multiple dll browser."; << "--in-process-gpu is not supported in chrome multiple dll browser.";
} }
#endif // !CHROME_MULTIPLE_DLL_BROWSER && !CHROME_MULTIPLE_DLL_CHILD #endif // !CHROME_MULTIPLE_DLL_BROWSER && !CHROME_MULTIPLE_DLL_CHILD
} }
...@@ -600,22 +600,21 @@ static void RegisterMainThreadFactories() { ...@@ -600,22 +600,21 @@ static void RegisterMainThreadFactories() {
// Run the FooMain() for a given process type. // Run the FooMain() for a given process type.
// If |process_type| is empty, runs BrowserMain(). // If |process_type| is empty, runs BrowserMain().
// Returns the exit code for this process. // Returns the exit code for this process.
int RunNamedProcessTypeMain( int RunNamedProcessTypeMain(const std::string& process_type,
const std::string& process_type,
const MainFunctionParams& main_function_params, const MainFunctionParams& main_function_params,
ContentMainDelegate* delegate) { ContentMainDelegate* delegate) {
static const MainFunction kMainFunctions[] = { static const MainFunction kMainFunctions[] = {
#if !defined(CHROME_MULTIPLE_DLL_CHILD) #if !defined(CHROME_MULTIPLE_DLL_CHILD)
{ "", BrowserMain }, {"", BrowserMain},
#endif #endif
#if !defined(CHROME_MULTIPLE_DLL_BROWSER) #if !defined(CHROME_MULTIPLE_DLL_BROWSER)
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
{ switches::kPpapiPluginProcess, PpapiPluginMain }, {switches::kPpapiPluginProcess, PpapiPluginMain},
{ switches::kPpapiBrokerProcess, PpapiBrokerMain }, {switches::kPpapiBrokerProcess, PpapiBrokerMain},
#endif // ENABLE_PLUGINS #endif // ENABLE_PLUGINS
{ switches::kUtilityProcess, UtilityMain }, {switches::kUtilityProcess, UtilityMain},
{ switches::kRendererProcess, RendererMain }, {switches::kRendererProcess, RendererMain},
{ switches::kGpuProcess, GpuMain }, {switches::kGpuProcess, GpuMain},
#endif // !CHROME_MULTIPLE_DLL_BROWSER #endif // !CHROME_MULTIPLE_DLL_BROWSER
}; };
...@@ -624,8 +623,8 @@ int RunNamedProcessTypeMain( ...@@ -624,8 +623,8 @@ int RunNamedProcessTypeMain(
for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { for (size_t i = 0; i < arraysize(kMainFunctions); ++i) {
if (process_type == kMainFunctions[i].name) { if (process_type == kMainFunctions[i].name) {
if (delegate) { if (delegate) {
int exit_code = delegate->RunProcess(process_type, int exit_code =
main_function_params); delegate->RunProcess(process_type, main_function_params);
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// In Android's browser process, the negative exit code doesn't mean the // In Android's browser process, the negative exit code doesn't mean the
// default behavior should be used as the UI message loop is managed by // default behavior should be used as the UI message loop is managed by
...@@ -719,10 +718,10 @@ class ContentMainRunnerImpl : public ContentMainRunner { ...@@ -719,10 +718,10 @@ class ContentMainRunnerImpl : public ContentMainRunner {
is_initialized_ = true; is_initialized_ = true;
delegate_ = params.delegate; delegate_ = params.delegate;
// The exit manager is in charge of calling the dtors of singleton objects. // The exit manager is in charge of calling the dtors of singleton objects.
// On Android, AtExitManager is set up when library is loaded. // On Android, AtExitManager is set up when library is loaded.
// A consequence of this is that you can't use the ctor/dtor-based // A consequence of this is that you can't use the ctor/dtor-based
// TRACE_EVENT methods on Linux or iOS builds till after we set this up. // TRACE_EVENT methods on Linux or iOS builds till after we set this up.
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
if (!ui_task_) { if (!ui_task_) {
// When running browser tests, don't create a second AtExitManager as that // When running browser tests, don't create a second AtExitManager as that
...@@ -752,8 +751,8 @@ class ContentMainRunnerImpl : public ContentMainRunner { ...@@ -752,8 +751,8 @@ class ContentMainRunnerImpl : public ContentMainRunner {
#if defined(OS_WIN) #if defined(OS_WIN)
if (command_line.HasSwitch(switches::kDeviceScaleFactor)) { if (command_line.HasSwitch(switches::kDeviceScaleFactor)) {
std::string scale_factor_string = command_line.GetSwitchValueASCII( std::string scale_factor_string =
switches::kDeviceScaleFactor); command_line.GetSwitchValueASCII(switches::kDeviceScaleFactor);
double scale_factor = 0; double scale_factor = 0;
if (base::StringToDouble(scale_factor_string, &scale_factor)) if (base::StringToDouble(scale_factor_string, &scale_factor))
display::win::SetDefaultDeviceScaleFactor(scale_factor); display::win::SetDefaultDeviceScaleFactor(scale_factor);
......
...@@ -499,7 +499,7 @@ jumbo_source_set("browser") { ...@@ -499,7 +499,7 @@ jumbo_source_set("browser") {
"browser_main.h", "browser_main.h",
"browser_main_loop.cc", "browser_main_loop.cc",
"browser_main_loop.h", "browser_main_loop.h",
"browser_main_runner.cc", "browser_main_runner_impl.cc",
"browser_plugin/browser_plugin_embedder.cc", "browser_plugin/browser_plugin_embedder.cc",
"browser_plugin/browser_plugin_embedder.h", "browser_plugin/browser_plugin_embedder.h",
"browser_plugin/browser_plugin_guest.cc", "browser_plugin/browser_plugin_guest.cc",
......
...@@ -127,9 +127,9 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { ...@@ -127,9 +127,9 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
main_loop_->MainMessageLoopStart(); main_loop_->MainMessageLoopStart();
main_loop_->PostMainMessageLoopStart(); main_loop_->PostMainMessageLoopStart();
// WARNING: If we get a WM_ENDSESSION, objects created on the stack here // WARNING: If we get a WM_ENDSESSION, objects created on the stack here
// are NOT deleted. If you need something to run during WM_ENDSESSION add it // are NOT deleted. If you need something to run during WM_ENDSESSION add
// to browser_shutdown::Shutdown or BrowserProcess::EndSession. // it to browser_shutdown::Shutdown or BrowserProcess::EndSession.
ui::InitializeInputMethod(); ui::InitializeInputMethod();
UMA_HISTOGRAM_TIMES("Startup.BrowserMainRunnerImplInitializeStep1Time", UMA_HISTOGRAM_TIMES("Startup.BrowserMainRunnerImplInitializeStep1Time",
...@@ -215,16 +215,16 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { ...@@ -215,16 +215,16 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
main_loop_->ShutdownThreadsAndCleanUp(); main_loop_->ShutdownThreadsAndCleanUp();
ui::ShutdownInputMethod(); ui::ShutdownInputMethod();
#if defined(OS_WIN) #if defined(OS_WIN)
ole_initializer_.reset(NULL); ole_initializer_.reset(NULL);
#endif #endif
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// Forcefully terminates the RunLoop inside MessagePumpForUI, ensuring // Forcefully terminates the RunLoop inside MessagePumpForUI, ensuring
// proper shutdown for content_browsertests. Shutdown() is not used by // proper shutdown for content_browsertests. Shutdown() is not used by
// the actual browser. // the actual browser.
if (base::RunLoop::IsRunningOnCurrentThread()) if (base::RunLoop::IsRunningOnCurrentThread())
base::RunLoop::QuitCurrentDeprecated(); base::RunLoop::QuitCurrentDeprecated();
#endif #endif
main_loop_.reset(nullptr); main_loop_.reset(nullptr);
notification_service_.reset(nullptr); notification_service_.reset(nullptr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment