blob: fe663ce445cbed900af5e97dfa1977fd6b65329e [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "build/build_config.h"
#include "chrome/browser/first_run/upgrade_util.h"
#include "components/startup_metric_utils/startup_metric_utils.h"
// The entry point for all invocations of Chromium, browser and renderer. On
// windows, this does nothing but load chrome.dll and invoke its entry point in
// order to make it easy to update the app from GoogleUpdate. We don't need
// that extra layer with on linux.
// Default AddressSanitizer options for the official build. These do not affect
// tests or non-official Chromium builds.
// - disable the strict memcmp() checking ( and
// - set the malloc_context_size (i.e. the size of stack traces collected by
// ASan for each malloc/free) to 5. These stack traces tend to accumulate
// very fast in applications using JIT (v8 in Chrome's case), see
// - disable the in-process symbolization, which isn't 100% compatible with
// the existing sandboxes and doesn't make much sense for stripped official
// binaries.
const char *kAsanDefaultOptions =
"malloc_context_size=5 strict_memcmp=0 symbolize=false";
// Override the default ASan options for the Google Chrome executable.
// __asan_default_options should not be instrumented, because it is called
// before ASan is initialized.
extern "C"
const char *__asan_default_options() {
return kAsanDefaultOptions;
extern "C" {
int ChromeMain(int argc, const char** argv);
int main(int argc, const char** argv) {
int return_code = ChromeMain(argc, argv);
#if defined(OS_LINUX)
// Launch a new instance if we're shutting down because we detected an
// upgrade in the persistent mode.
return return_code;