summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 04:05:25 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 04:05:25 +0000
commit54c6efa65afd6484f304ed01786865e84bb11b1b (patch)
treef76555ba859355f299f1a237a4aa3e45a79cb4e3
parent398273b1dd2c6f93a1a21fa6a9d8e5c5479864d7 (diff)
downloadchromium_src-54c6efa65afd6484f304ed01786865e84bb11b1b.zip
chromium_src-54c6efa65afd6484f304ed01786865e84bb11b1b.tar.gz
chromium_src-54c6efa65afd6484f304ed01786865e84bb11b1b.tar.bz2
Cleanup of windows launch code
This is a redo of https://codereview.chromium.org/142473002/ The windows startup code was handling aura and non-aura cases which require different startup logic in metro (immersive mode). Since we don't support the non-Aura logic we can get rid of a lot of code. Tbring gab for the installer constant addition. TBR=gab BUG=none Review URL: https://codereview.chromium.org/158403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253709 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chrome_exe_main_win.cc53
-rw-r--r--chrome/app/client_util.cc161
-rw-r--r--chrome/app/client_util.h26
-rw-r--r--chrome/app/metro_driver_win.cc70
-rw-r--r--chrome/app/metro_driver_win.h33
-rw-r--r--chrome/chrome_exe.gypi2
-rw-r--r--chrome/installer/util/util_constants.cc1
-rw-r--r--chrome/installer/util/util_constants.h3
-rw-r--r--win8/metro_driver/chrome_app_view_ash.cc4
-rw-r--r--win8/metro_driver/metro_driver.cc9
-rw-r--r--win8/metro_driver/metro_driver.h4
11 files changed, 120 insertions, 246 deletions
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc
index 51b1edf..de2ba11 100644
--- a/chrome/app/chrome_exe_main_win.cc
+++ b/chrome/app/chrome_exe_main_win.cc
@@ -10,29 +10,19 @@
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
-#include "base/lazy_instance.h"
-#include "chrome/app/chrome_breakpad_client.h"
#include "chrome/app/client_util.h"
-#include "chrome/app/metro_driver_win.h"
#include "chrome/browser/chrome_process_finder_win.h"
#include "chrome/browser/policy/policy_path_parser.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "chrome_elf/chrome_elf_main.h"
-#include "components/breakpad/app/breakpad_client.h"
-#include "components/breakpad/app/breakpad_win.h"
#include "components/startup_metric_utils/startup_metric_utils.h"
-#include "content/public/app/startup_helper_win.h"
#include "content/public/common/result_codes.h"
-#include "sandbox/win/src/sandbox_factory.h"
#include "ui/gfx/win/dpi.h"
namespace {
-base::LazyInstance<chrome::ChromeBreakpadClient>::Leaky
- g_chrome_breakpad_client = LAZY_INSTANCE_INITIALIZER;
-
void CheckSafeModeLaunch() {
unsigned short k1 = ::GetAsyncKeyState(VK_CONTROL);
unsigned short k2 = ::GetAsyncKeyState(VK_MENU);
@@ -41,36 +31,6 @@ void CheckSafeModeLaunch() {
::SetEnvironmentVariableA(chrome::kSafeModeEnvVar, "1");
}
-int RunChrome(HINSTANCE instance) {
- breakpad::SetBreakpadClient(g_chrome_breakpad_client.Pointer());
-
- CheckSafeModeLaunch();
-
- bool exit_now = true;
- // We restarted because of a previous crash. Ask user if we should relaunch.
- // Only show this for the browser process. See crbug.com/132119.
- const std::string process_type =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kProcessType);
- if (process_type.empty()) {
- if (breakpad::ShowRestartDialogIfCrashed(&exit_now)) {
- if (exit_now)
- return content::RESULT_CODE_NORMAL_EXIT;
- }
- }
-
- // Initialize the sandbox services.
- sandbox::SandboxInterfaceInfo sandbox_info = {0};
- content::InitializeSandboxInfo(&sandbox_info);
-
- // Load and launch the chrome dll. *Everything* happens inside.
- MainDllLoader* loader = MakeMainDllLoader();
- int rc = loader->Launch(instance, &sandbox_info);
- loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
- delete loader;
- return rc;
-}
-
// List of switches that it's safe to rendezvous early with. Fast start should
// not be done if a command line contains a switch not in this set.
// Note this is currently stored as a list of two because it's probably faster
@@ -135,9 +95,12 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
if (AttemptFastNotify(*CommandLine::ForCurrentProcess()))
return 0;
- MetroDriver metro_driver;
- if (metro_driver.in_metro_mode())
- return metro_driver.RunInMetro(instance, &RunChrome);
- // Not in metro mode, proceed as normal.
- return RunChrome(instance);
+ CheckSafeModeLaunch();
+
+ // Load and launch the chrome dll. *Everything* happens inside.
+ MainDllLoader* loader = MakeMainDllLoader();
+ int rc = loader->Launch(instance);
+ loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded();
+ delete loader;
+ return rc;
}
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc
index dd6becd..d605822 100644
--- a/chrome/app/client_util.cc
+++ b/chrome/app/client_util.cc
@@ -6,9 +6,11 @@
#include <shlwapi.h>
#include "base/command_line.h"
+#include "base/compiler_specific.h"
#include "base/debug/trace_event.h"
#include "base/environment.h"
#include "base/file_version_info.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/rand_util.h" // For PreRead experiment.
@@ -19,19 +21,21 @@
#include "base/strings/utf_string_conversions.h"
#include "base/version.h"
#include "base/win/windows_version.h"
+#include "chrome/app/chrome_breakpad_client.h"
#include "chrome/app/client_util.h"
#include "chrome/app/image_pre_reader_win.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_result_codes.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
-#include "chrome/installer/util/browser_distribution.h"
-#include "chrome/installer/util/channel_info.h"
#include "chrome/installer/util/google_update_constants.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/util_constants.h"
+#include "components/breakpad/app/breakpad_client.h"
#include "components/breakpad/app/breakpad_win.h"
+#include "content/public/app/startup_helper_win.h"
+#include "sandbox/win/src/sandbox.h"
namespace {
// The entry point signature of chrome.dll.
@@ -39,6 +43,9 @@ typedef int (*DLL_MAIN)(HINSTANCE, sandbox::SandboxInterfaceInfo*);
typedef void (*RelaunchChromeBrowserWithNewCommandLineIfNeededFunc)();
+base::LazyInstance<chrome::ChromeBreakpadClient>::Leaky
+ g_chrome_breakpad_client = LAZY_INSTANCE_INITIALIZER;
+
// Returns true if the build date for this module precedes the expiry date
// for the pre-read experiment.
bool PreReadExperimentIsActive() {
@@ -148,29 +155,21 @@ size_t InitPreReadPercentage() {
// Expects that |dir| has a trailing backslash. |dir| is modified so it
// contains the full path that was tried. Caller must check for the return
// value not being null to determine if this path contains a valid dll.
-HMODULE LoadChromeWithDirectory(base::string16* dir) {
+HMODULE LoadModuleWithDirectory(base::string16* dir,
+ const wchar_t* dll_name,
+ bool pre_read) {
::SetCurrentDirectoryW(dir->c_str());
- const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
-#if !defined(CHROME_MULTIPLE_DLL)
- const wchar_t* dll_name = installer::kChromeDll;
-#else
- const wchar_t* dll_name =
- cmd_line.HasSwitch(switches::kProcessType) &&
- cmd_line.GetSwitchValueASCII(switches::kProcessType) != "service"
- ? installer::kChromeChildDll
- : installer::kChromeDll;
-#endif
dir->append(dll_name);
+ if (pre_read) {
#if !defined(WIN_DISABLE_PREREAD)
- // We pre-read the binary to warm the memory caches (fewer hard faults to
- // page parts of the binary in).
- if (!cmd_line.HasSwitch(switches::kProcessType)) {
+ // We pre-read the binary to warm the memory caches (fewer hard faults to
+ // page parts of the binary in).
const size_t kStepSize = 1024 * 1024;
size_t percentage = InitPreReadPercentage();
ImagePreReader::PartialPreReadImage(dir->c_str(), percentage, kStepSize);
- }
#endif
+ }
return ::LoadLibraryExW(dir->c_str(), NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
@@ -186,6 +185,13 @@ void ClearDidRun(const base::string16& dll_path) {
GoogleUpdateSettings::UpdateDidRunState(false, system_level);
}
+bool InMetroMode() {
+ return (wcsstr(
+ ::GetCommandLineW(), L" -ServerName:DefaultBrowserServer") != NULL);
+}
+
+typedef int (*InitMetro)();
+
} // namespace
base::string16 GetExecutablePath() {
@@ -210,7 +216,8 @@ base::string16 GetCurrentModuleVersion() {
//=============================================================================
-MainDllLoader::MainDllLoader() : dll_(NULL) {
+MainDllLoader::MainDllLoader()
+ : dll_(NULL), metro_mode_(InMetroMode()) {
}
MainDllLoader::~MainDllLoader() {
@@ -222,25 +229,26 @@ MainDllLoader::~MainDllLoader() {
// If that fails then we look at the version resource in the current
// module. This is the expected path for chrome.exe browser instances in an
// installed build.
-HMODULE MainDllLoader::Load(base::string16* out_version,
+HMODULE MainDllLoader::Load(const base::string16& version,
base::string16* out_file) {
- const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
- const base::string16 dir(GetExecutablePath());
- *out_file = dir;
- HMODULE dll = LoadChromeWithDirectory(out_file);
- if (!dll) {
- // Loading from same directory (for developers) failed. Look at the version
- // resource in the current module and try loading that.
- base::string16 version_string(GetCurrentModuleVersion());
- if (version_string.empty()) {
- LOG(ERROR) << "No valid Chrome version found";
- return NULL;
- }
+ const base::string16 executable_dir(GetExecutablePath());
+ *out_file = executable_dir;
- *out_file = dir;
- *out_version = version_string;
- out_file->append(*out_version).append(1, L'\\');
- dll = LoadChromeWithDirectory(out_file);
+ const wchar_t* dll_name = metro_mode_ ?
+ installer::kChromeMetroDll :
+#if !defined(CHROME_MULTIPLE_DLL)
+ installer::kChromeDll;
+#else
+ (process_type_ == "service") || process_type_.empty() ?
+ installer::kChromeDll :
+ installer::kChromeChildDll;
+#endif
+ const bool pre_read = !metro_mode_;
+ HMODULE dll = LoadModuleWithDirectory(out_file, dll_name, pre_read);
+ if (!dll) {
+ *out_file = executable_dir;
+ out_file->append(version).append(1, L'\\');
+ dll = LoadModuleWithDirectory(out_file, dll_name, pre_read);
if (!dll) {
PLOG(ERROR) << "Failed to load Chrome DLL from " << *out_file;
return NULL;
@@ -248,43 +256,67 @@ HMODULE MainDllLoader::Load(base::string16* out_version,
}
DCHECK(dll);
-
return dll;
}
// Launching is a matter of loading the right dll, setting the CHROME_VERSION
// environment variable and just calling the entry point. Derived classes can
// add custom code in the OnBeforeLaunch callback.
-int MainDllLoader::Launch(HINSTANCE instance,
- sandbox::SandboxInterfaceInfo* sbox_info) {
- base::string16 version;
- base::string16 file;
- dll_ = Load(&version, &file);
- if (!dll_)
+int MainDllLoader::Launch(HINSTANCE instance) {
+ const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
+ process_type_ = cmd_line.GetSwitchValueASCII(switches::kProcessType);
+
+ base::string16 version(GetCurrentModuleVersion());
+ if (version.empty()) {
+ LOG(ERROR) << "No valid Chrome version found";
return chrome::RESULT_CODE_MISSING_DATA;
+ }
scoped_ptr<base::Environment> env(base::Environment::Create());
env->SetVar(chrome::kChromeVersionEnvVar, base::WideToUTF8(version));
- // TODO(erikwright): Remove this when http://crbug.com/174953 is fixed and
- // widely deployed.
- env->UnSetVar(env_vars::kGoogleUpdateIsMachineEnvVar);
+ base::string16 file;
- const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
- std::string process_type =
- cmd_line.GetSwitchValueASCII(switches::kProcessType);
- breakpad::InitCrashReporter(process_type);
- OnBeforeLaunch(file);
+ if (metro_mode_) {
+ HMODULE metro_dll = Load(version, &file);
+ if (!metro_dll)
+ return chrome::RESULT_CODE_MISSING_DATA;
- DLL_MAIN entry_point =
- reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll_, "ChromeMain"));
- if (!entry_point)
- return chrome::RESULT_CODE_BAD_PROCESS_TYPE;
+ InitMetro chrome_metro_main =
+ reinterpret_cast<InitMetro>(::GetProcAddress(metro_dll, "InitMetro"));
+ return chrome_metro_main();
+ }
- int rc = entry_point(instance, sbox_info);
+ // Initialize the sandbox services.
+ sandbox::SandboxInterfaceInfo sandbox_info = {0};
+ content::InitializeSandboxInfo(&sandbox_info);
+
+ breakpad::SetBreakpadClient(g_chrome_breakpad_client.Pointer());
+ bool exit_now = true;
+ if (process_type_.empty()) {
+ if (breakpad::ShowRestartDialogIfCrashed(&exit_now)) {
+ // We restarted because of a previous crash. Ask user if we should
+ // Relaunch. Only for the browser process. See crbug.com/132119.
+ if (exit_now)
+ return content::RESULT_CODE_NORMAL_EXIT;
+ }
+ }
+ breakpad::InitCrashReporter(process_type_);
+
+ dll_ = Load(version, &file);
+ if (!dll_)
+ return chrome::RESULT_CODE_MISSING_DATA;
+
+ OnBeforeLaunch(file);
+ DLL_MAIN chrome_main =
+ reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll_, "ChromeMain"));
+ int rc = chrome_main(instance, &sandbox_info);
return OnBeforeExit(rc, file);
}
void MainDllLoader::RelaunchChromeBrowserWithNewCommandLineIfNeeded() {
+ if (!dll_)
+ return;
+
RelaunchChromeBrowserWithNewCommandLineIfNeededFunc relaunch_function =
reinterpret_cast<RelaunchChromeBrowserWithNewCommandLineIfNeededFunc>(
::GetProcAddress(dll_,
@@ -300,14 +332,7 @@ void MainDllLoader::RelaunchChromeBrowserWithNewCommandLineIfNeeded() {
//=============================================================================
class ChromeDllLoader : public MainDllLoader {
- public:
- virtual base::string16 GetRegistryPath() {
- base::string16 key(google_update::kRegPathClients);
- BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- key.append(L"\\").append(dist->GetAppGuid());
- return key;
- }
-
+ protected:
virtual void OnBeforeLaunch(const base::string16& dll_path) {
RecordDidRun(dll_path);
}
@@ -326,10 +351,12 @@ class ChromeDllLoader : public MainDllLoader {
//=============================================================================
class ChromiumDllLoader : public MainDllLoader {
- public:
- virtual base::string16 GetRegistryPath() {
- BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- return dist->GetVersionKey();
+ protected:
+ virtual void OnBeforeLaunch(const base::string16& dll_path) OVERRIDE {
+ }
+ virtual int OnBeforeExit(int return_code,
+ const base::string16& dll_path) OVERRIDE {
+ return return_code;
}
};
diff --git a/chrome/app/client_util.h b/chrome/app/client_util.h
index 5b8ebf6..d84bddf 100644
--- a/chrome/app/client_util.h
+++ b/chrome/app/client_util.h
@@ -10,6 +10,7 @@
#include <windows.h>
+#include <string>
#include "base/strings/string16.h"
namespace sandbox {
@@ -23,7 +24,7 @@ base::string16 GetExecutablePath();
// string if none found.
base::string16 GetCurrentModuleVersion();
-// Implements the common aspects of loading chrome.dll for both chrome and
+// Implements the common aspects of loading the main dll for both chrome and
// chromium scenarios, which are in charge of implementing two abstract
// methods: GetRegistryPath() and OnBeforeLaunch().
class MainDllLoader {
@@ -32,38 +33,33 @@ class MainDllLoader {
virtual ~MainDllLoader();
// Loads and calls the entry point of chrome.dll. |instance| is the exe
- // instance retrieved from wWinMain and the |sbox_info| is the broker or
- // target services interface pointer.
+ // instance retrieved from wWinMain.
// The return value is what the main entry point of chrome.dll returns
// upon termination.
- int Launch(HINSTANCE instance, sandbox::SandboxInterfaceInfo* sbox_info);
+ int Launch(HINSTANCE instance);
// Launches a new instance of the browser if the current instance in
// persistent mode an upgrade is detected.
void RelaunchChromeBrowserWithNewCommandLineIfNeeded();
+ protected:
// Called after chrome.dll has been loaded but before the entry point
// is invoked. Derived classes can implement custom actions here.
// |dll_path| refers to the path of the Chrome dll being loaded.
- virtual void OnBeforeLaunch(const base::string16& dll_path) {}
+ virtual void OnBeforeLaunch(const base::string16& dll_path) = 0;
// Called after the chrome.dll entry point returns and before terminating
// this process. The return value will be used as the process return code.
// |dll_path| refers to the path of the Chrome dll being loaded.
- virtual int OnBeforeExit(int return_code, const base::string16& dll_path) {
- return return_code;
- }
-
- protected:
- // Derived classes must return the relative registry path that holds the
- // most current version of chrome.dll.
- virtual base::string16 GetRegistryPath() = 0;
+ virtual int OnBeforeExit(int return_code, const base::string16& dll_path) = 0;
- HMODULE Load(base::string16* out_version, base::string16* out_file);
+ private:
+ HMODULE Load(const base::string16& version, base::string16* out_file);
private:
- // Chrome.dll handle.
HMODULE dll_;
+ std::string process_type_;
+ const bool metro_mode_;
};
// Factory for the MainDllLoader. Caller owns the pointer and should call
diff --git a/chrome/app/metro_driver_win.cc b/chrome/app/metro_driver_win.cc
deleted file mode 100644
index faaff88..0000000
--- a/chrome/app/metro_driver_win.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// 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 "metro_driver_win.h"
-
-#include <string.h>
-
-#include "chrome/app/client_util.h"
-#include "chrome/common/chrome_constants.h"
-
-namespace {
-// This environment variable controls the loading of the metro driver DLL.
-const char* kMetroModeEnvVar = "CHROME_METRO_DLL";
-
-typedef int (*InitMetro)(LPTHREAD_START_ROUTINE thread_proc, void* context);
-
-struct Context {
- MetroDriver::MainFn fn;
- HINSTANCE instance;
-};
-
-DWORD WINAPI MainThread(void* param) {
- Context* context = reinterpret_cast<Context*>(param);
- int rv = context->fn(context->instance);
- delete context;
- return rv;
-}
-
-} // namespace
-
-MetroDriver::MetroDriver() : init_metro_fn_(NULL) {
- if (0 != ::GetEnvironmentVariableA(kMetroModeEnvVar, NULL, 0))
- return;
- // The metro activation always has the |ServerName| parameter. If we dont
- // see it, we are being launched in desktop mode.
- if (!wcsstr(::GetCommandLineW(), L" -ServerName:DefaultBrowserServer")) {
- ::SetEnvironmentVariableA(kMetroModeEnvVar, "0");
- return;
- }
- // We haven't tried to load the metro driver, this probably means we are the
- // browser. Find it or not we set the environment variable because we don't
- // want to keep trying in the child processes.
- HMODULE metro_dll = ::LoadLibraryW(chrome::kMetroDriverDll);
- if (!metro_dll) {
- // It is not next to the build output, so this must be an actual deployment
- // and in that case we need the mainloader to find the current version
- // directory.
- base::string16 version(GetCurrentModuleVersion());
- if (!version.empty()) {
- std::wstring exe_path(GetExecutablePath());
- exe_path.append(version).append(L"\\").append(chrome::kMetroDriverDll);
- metro_dll = ::LoadLibraryW(exe_path.c_str());
- }
- }
- // We set the environment variable always, so we don't keep trying in
- // the child processes.
- ::SetEnvironmentVariableA(kMetroModeEnvVar, metro_dll ? "1" : "0");
- if (!metro_dll)
- return;
- init_metro_fn_ = ::GetProcAddress(metro_dll, "InitMetro");
-}
-
-int MetroDriver::RunInMetro(HINSTANCE instance, MainFn main_fn) {
- Context* context = new Context;
- context->fn = main_fn;
- context->instance = instance;
-
- return reinterpret_cast<InitMetro>(init_metro_fn_)(&MainThread, context);
-}
diff --git a/chrome/app/metro_driver_win.h b/chrome/app/metro_driver_win.h
deleted file mode 100644
index b99a9af..0000000
--- a/chrome/app/metro_driver_win.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011 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.
-
-#ifndef CHROME_APP_METRO_DRIVER_WIN_H_
-#define CHROME_APP_METRO_DRIVER_WIN_H_
-
-#include <Windows.h>
-
-// Helper class to manage the metro driver dll. When present in the system,
-// the main process thread needs to call InitMetro(), normal execution of
-// chrome initialization will continue on a second thread while the main
-// thread will be servicing the metro message loop.
-class MetroDriver {
- public:
- typedef int (*MainFn)(HINSTANCE instance);
-
- MetroDriver();
- // returns true if chrome is being launched in metro. If so we should
- // call RunInMetro(). If not then we should just run chrome as usual.
- bool in_metro_mode() const { return (NULL != init_metro_fn_); }
-
- // Enter the metro main function, which will only return when chrome metro
- // is closed. Once metro has initialized, the dll creates a new thread
- // which runs |main_fn|. This method returns when the chrome metro session
- // is closed by the user.
- int RunInMetro(HINSTANCE instance, MainFn main_fn);
-
- private:
- void* init_metro_fn_;
-};
-
-#endif // CHROME_APP_METRO_DRIVER_WIN_H_
diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi
index d3e228b..e6a5b25 100644
--- a/chrome/chrome_exe.gypi
+++ b/chrome/chrome_exe.gypi
@@ -59,8 +59,6 @@
'app/chrome_exe_resource.h',
'app/client_util.cc',
'app/client_util.h',
- 'app/metro_driver_win.cc',
- 'app/metro_driver_win.h',
'app/signature_validator_win.cc',
'app/signature_validator_win.h',
'<(DEPTH)/content/app/startup_helper_win.cc',
diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc
index bd5e505..f19bc0a 100644
--- a/chrome/installer/util/util_constants.cc
+++ b/chrome/installer/util/util_constants.cc
@@ -218,6 +218,7 @@ const wchar_t kChromeFrameHelperDll[] = L"chrome_frame_helper.dll";
const wchar_t kChromeFrameHelperExe[] = L"chrome_frame_helper.exe";
const wchar_t kChromeFrameHelperWndClass[] = L"ChromeFrameHelperWindowClass";
const wchar_t kChromeLauncherExe[] = L"chrome_launcher.exe";
+const wchar_t kChromeMetroDll[] = L"metro_driver.dll";
const wchar_t kChromeNewExe[] = L"new_chrome.exe";
const wchar_t kChromeOldExe[] = L"old_chrome.exe";
const wchar_t kCmdInstallApp[] = L"install-application";
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index 8109b2b..dffd88cf 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -203,8 +203,9 @@ extern const wchar_t kChromeFrameHelperDll[];
extern const wchar_t kChromeFrameHelperExe[];
extern const wchar_t kChromeFrameHelperWndClass[];
extern const wchar_t kChromeLauncherExe[];
-extern const wchar_t kChromeOldExe[];
+extern const wchar_t kChromeMetroDll[];
extern const wchar_t kChromeNewExe[];
+extern const wchar_t kChromeOldExe[];
extern const wchar_t kCmdInstallApp[];
extern const wchar_t kCmdInstallExtension[];
extern const wchar_t kCmdOnOsUpgrade[];
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index af63093..1479a7c 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -1331,9 +1331,7 @@ HRESULT ChromeAppViewAsh::OnSizeChanged(winui::Core::ICoreWindow* sender,
///////////////////////////////////////////////////////////////////////////////
ChromeAppViewFactory::ChromeAppViewFactory(
- winapp::Core::ICoreApplication* icore_app,
- LPTHREAD_START_ROUTINE host_main,
- void* host_context) {
+ winapp::Core::ICoreApplication* icore_app) {
mswr::ComPtr<winapp::Core::ICoreApplication> core_app(icore_app);
mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit;
CheckHR(core_app.As(&app_exit));
diff --git a/win8/metro_driver/metro_driver.cc b/win8/metro_driver/metro_driver.cc
index 846a71f..eb87754 100644
--- a/win8/metro_driver/metro_driver.cc
+++ b/win8/metro_driver/metro_driver.cc
@@ -15,10 +15,6 @@
#include "base/win/scoped_comptr.h"
#include "win8/metro_driver/winrt_utils.h"
-#if !defined(USE_AURA)
-#include "win8/metro_driver/chrome_app_view.h"
-#endif
-
// TODO(siggi): Move this to GYP.
#pragma comment(lib, "runtimeobject.lib")
@@ -59,7 +55,7 @@ base::AtExitManager at_exit;
#endif
extern "C" __declspec(dllexport)
-int InitMetro(LPTHREAD_START_ROUTINE thread_proc, void* context) {
+int InitMetro() {
// Initialize the command line.
CommandLine::Init(0, NULL);
logging::LoggingSettings settings;
@@ -97,8 +93,7 @@ int InitMetro(LPTHREAD_START_ROUTINE thread_proc, void* context) {
if (FAILED(hr))
return 1;
- auto view_factory = mswr::Make<ChromeAppViewFactory>(
- core_app.Get(), thread_proc, context);
+ auto view_factory = mswr::Make<ChromeAppViewFactory>(core_app.Get());
hr = core_app->Run(view_factory.Get());
DVLOG(1) << "exiting InitMetro, hr=" << hr;
diff --git a/win8/metro_driver/metro_driver.h b/win8/metro_driver/metro_driver.h
index c4ea2ab..2b7d548 100644
--- a/win8/metro_driver/metro_driver.h
+++ b/win8/metro_driver/metro_driver.h
@@ -10,9 +10,7 @@
class ChromeAppViewFactory
: public mswr::RuntimeClass<winapp::Core::IFrameworkViewSource> {
public:
- ChromeAppViewFactory(winapp::Core::ICoreApplication* icore_app,
- LPTHREAD_START_ROUTINE host_main,
- void* host_context);
+ ChromeAppViewFactory(winapp::Core::ICoreApplication* icore_app);
IFACEMETHOD(CreateView)(winapp::Core::IFrameworkView** view);
};