This source file includes following definitions.
- SandboxInitialized
- RunProcess
- BasicStartupComplete
- RegisterApplicationNativeMethods
#include "chrome/app/android/chrome_main_delegate_android.h"
#include "base/android/jni_android.h"
#include "base/debug/trace_event.h"
#include "chrome/browser/android/chrome_jni_registrar.h"
#include "chrome/browser/android/chrome_startup_flags.h"
#include "chrome/browser/android/uma_utils.h"
#include "components/startup_metric_utils/startup_metric_utils.h"
#include "content/public/browser/browser_main_runner.h"
ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() {
}
ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() {
}
void ChromeMainDelegateAndroid::SandboxInitialized(
const std::string& process_type) {
ChromeMainDelegate::SandboxInitialized(process_type);
}
int ChromeMainDelegateAndroid::RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) {
TRACE_EVENT0("startup", "ChromeMainDelegateAndroid::RunProcess")
if (process_type.empty()) {
JNIEnv* env = base::android::AttachCurrentThread();
RegisterApplicationNativeMethods(env);
if (!browser_runner_.get()) {
base::Time startTime = chrome::android::GetMainEntryPointTime();
startup_metric_utils::RecordSavedMainEntryPointTime(startTime);
browser_runner_.reset(content::BrowserMainRunner::Create());
}
return browser_runner_->Initialize(main_function_params);
}
return ChromeMainDelegate::RunProcess(process_type, main_function_params);
}
bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) {
SetChromeSpecificCommandLineFlags();
return ChromeMainDelegate::BasicStartupComplete(exit_code);
}
bool ChromeMainDelegateAndroid::RegisterApplicationNativeMethods(JNIEnv* env) {
return chrome::android::RegisterJni(env);
}