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 {
// THREAD SAFTEY: Accessing the CommandLine instance for this process is
// technically not threadsafe when using the component build. However, the
// instance is initialized on the main thread before any other threads are
// started (see content/app/content_main_runner.cc), so accessing this instance
// on those threads for read-operations is safe in practice.
// started (see content/app/content_main_runner_impl.cc), so accessing this
// instance on those threads for read-operations is safe in practice.
void InitCommandLineShlib(const std::vector<std::string>& argv);
} // namespace chromecast
......
......@@ -71,7 +71,7 @@ template("implement_content_app") {
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
# headers of all process types and varies significantly per platform in
# between browser and child. Otherwise it would require many "nogncheck"
......@@ -84,7 +84,7 @@ template("implement_content_app") {
check_includes = false
sources = [
"content_main_runner.cc",
"content_main_runner_impl.cc",
]
configs += extra_configs
......
......@@ -191,8 +191,8 @@ void InitializeFieldTrialAndFeatureList(
// browser process.
field_trial_list->reset(new base::FieldTrialList(nullptr));
// Ensure any field trials in browser are reflected into the child
// process.
// Ensure any field trials in browser are reflected into the child
// process.
#if defined(OS_WIN)
base::FieldTrialList::CreateTrialsFromCommandLine(
command_line, switches::kFieldTrialHandle, -1);
......@@ -587,12 +587,12 @@ static void RegisterMainThreadFactories() {
#else
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kSingleProcess)) {
LOG(FATAL) <<
"--single-process is not supported in chrome multiple dll browser.";
LOG(FATAL)
<< "--single-process is not supported in chrome multiple dll browser.";
}
if (command_line.HasSwitch(switches::kInProcessGPU)) {
LOG(FATAL) <<
"--in-process-gpu is not supported in chrome multiple dll browser.";
LOG(FATAL)
<< "--in-process-gpu is not supported in chrome multiple dll browser.";
}
#endif // !CHROME_MULTIPLE_DLL_BROWSER && !CHROME_MULTIPLE_DLL_CHILD
}
......@@ -600,22 +600,21 @@ static void RegisterMainThreadFactories() {
// Run the FooMain() for a given process type.
// If |process_type| is empty, runs BrowserMain().
// Returns the exit code for this process.
int RunNamedProcessTypeMain(
const std::string& process_type,
int RunNamedProcessTypeMain(const std::string& process_type,
const MainFunctionParams& main_function_params,
ContentMainDelegate* delegate) {
static const MainFunction kMainFunctions[] = {
#if !defined(CHROME_MULTIPLE_DLL_CHILD)
{ "", BrowserMain },
{"", BrowserMain},
#endif
#if !defined(CHROME_MULTIPLE_DLL_BROWSER)
#if BUILDFLAG(ENABLE_PLUGINS)
{ switches::kPpapiPluginProcess, PpapiPluginMain },
{ switches::kPpapiBrokerProcess, PpapiBrokerMain },
{switches::kPpapiPluginProcess, PpapiPluginMain},
{switches::kPpapiBrokerProcess, PpapiBrokerMain},
#endif // ENABLE_PLUGINS
{ switches::kUtilityProcess, UtilityMain },
{ switches::kRendererProcess, RendererMain },
{ switches::kGpuProcess, GpuMain },
{switches::kUtilityProcess, UtilityMain},
{switches::kRendererProcess, RendererMain},
{switches::kGpuProcess, GpuMain},
#endif // !CHROME_MULTIPLE_DLL_BROWSER
};
......@@ -624,8 +623,8 @@ int RunNamedProcessTypeMain(
for (size_t i = 0; i < arraysize(kMainFunctions); ++i) {
if (process_type == kMainFunctions[i].name) {
if (delegate) {
int exit_code = delegate->RunProcess(process_type,
main_function_params);
int exit_code =
delegate->RunProcess(process_type, main_function_params);
#if defined(OS_ANDROID)
// 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
......@@ -719,10 +718,10 @@ class ContentMainRunnerImpl : public ContentMainRunner {
is_initialized_ = true;
delegate_ = params.delegate;
// The exit manager is in charge of calling the dtors of singleton objects.
// On Android, AtExitManager is set up when library is loaded.
// 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.
// The exit manager is in charge of calling the dtors of singleton objects.
// On Android, AtExitManager is set up when library is loaded.
// 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.
#if !defined(OS_ANDROID)
if (!ui_task_) {
// When running browser tests, don't create a second AtExitManager as that
......@@ -752,8 +751,8 @@ class ContentMainRunnerImpl : public ContentMainRunner {
#if defined(OS_WIN)
if (command_line.HasSwitch(switches::kDeviceScaleFactor)) {
std::string scale_factor_string = command_line.GetSwitchValueASCII(
switches::kDeviceScaleFactor);
std::string scale_factor_string =
command_line.GetSwitchValueASCII(switches::kDeviceScaleFactor);
double scale_factor = 0;
if (base::StringToDouble(scale_factor_string, &scale_factor))
display::win::SetDefaultDeviceScaleFactor(scale_factor);
......
......@@ -499,7 +499,7 @@ jumbo_source_set("browser") {
"browser_main.h",
"browser_main_loop.cc",
"browser_main_loop.h",
"browser_main_runner.cc",
"browser_main_runner_impl.cc",
"browser_plugin/browser_plugin_embedder.cc",
"browser_plugin/browser_plugin_embedder.h",
"browser_plugin/browser_plugin_guest.cc",
......
......@@ -127,9 +127,9 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
main_loop_->MainMessageLoopStart();
main_loop_->PostMainMessageLoopStart();
// 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
// to browser_shutdown::Shutdown or BrowserProcess::EndSession.
// 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 to browser_shutdown::Shutdown or BrowserProcess::EndSession.
ui::InitializeInputMethod();
UMA_HISTOGRAM_TIMES("Startup.BrowserMainRunnerImplInitializeStep1Time",
......@@ -215,16 +215,16 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
main_loop_->ShutdownThreadsAndCleanUp();
ui::ShutdownInputMethod();
#if defined(OS_WIN)
#if defined(OS_WIN)
ole_initializer_.reset(NULL);
#endif
#if defined(OS_ANDROID)
#endif
#if defined(OS_ANDROID)
// Forcefully terminates the RunLoop inside MessagePumpForUI, ensuring
// proper shutdown for content_browsertests. Shutdown() is not used by
// the actual browser.
if (base::RunLoop::IsRunningOnCurrentThread())
base::RunLoop::QuitCurrentDeprecated();
#endif
#endif
main_loop_.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