Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1174)

Unified Diff: mojo/shell/runner/init.cc

Issue 1877753003: Move mojo\shell to services\shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@62scan
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/runner/init.h ('k') | mojo/shell/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/runner/init.cc
diff --git a/mojo/shell/runner/init.cc b/mojo/shell/runner/init.cc
deleted file mode 100644
index 57eb312392e02b534835b1c1201ba19255196c5d..0000000000000000000000000000000000000000
--- a/mojo/shell/runner/init.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2013 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 "mojo/shell/runner/init.h"
-
-#include <stdint.h>
-
-#include "base/base_switches.h"
-#include "base/command_line.h"
-#include "base/debug/debugger.h"
-#include "base/files/file_path.h"
-#include "base/i18n/icu_util.h"
-#include "base/logging.h"
-#include "base/stl_util.h"
-#include "base/strings/string_split.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-#include "mojo/shell/runner/common/switches.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#elif (OS_POSIX)
-#include <unistd.h>
-#endif
-
-namespace mojo {
-namespace shell {
-
-void InitializeLogging() {
- logging::LoggingSettings settings;
- settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
- logging::InitLogging(settings);
- // To view log output with IDs and timestamps use "adb logcat -v threadtime".
- logging::SetLogItems(true, // Process ID
- true, // Thread ID
- true, // Timestamp
- true); // Tick count
-}
-
-void WaitForDebuggerIfNecessary() {
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kWaitForDebugger)) {
- std::vector<std::string> apps_to_debug = base::SplitString(
- command_line->GetSwitchValueASCII(switches::kWaitForDebugger), ",",
- base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
- std::string app = "launcher";
- if (command_line->HasSwitch(switches::kChildProcess)) {
- app = command_line->GetSwitchValuePath(switches::kChildProcess)
- .BaseName()
- .RemoveExtension()
- .MaybeAsASCII();
- }
- if (apps_to_debug.empty() || ContainsValue(apps_to_debug, app)) {
-#if defined(OS_WIN)
- base::string16 appw = base::UTF8ToUTF16(app);
- base::string16 message = base::UTF8ToUTF16(
- base::StringPrintf("%s - %d", app.c_str(), GetCurrentProcessId()));
- MessageBox(NULL, message.c_str(), appw.c_str(), MB_OK | MB_SETFOREGROUND);
-#else
- LOG(ERROR) << app << " waiting for GDB. pid: " << getpid();
- base::debug::WaitForDebugger(60, true);
-#endif
- }
- }
-}
-
-void CallLibraryEarlyInitialization(base::NativeLibrary app_library) {
- // Do whatever warming that the mojo application wants.
- typedef void (*LibraryEarlyInitFunction)(const uint8_t*);
- LibraryEarlyInitFunction init_function =
- reinterpret_cast<LibraryEarlyInitFunction>(
- base::GetFunctionPointerFromNativeLibrary(app_library,
- "InitializeBase"));
- if (init_function) {
- // Get the ICU data that we prewarmed in the runner and then pass it to
- // the copy of icu in the mojo binary that we're running.
- const uint8_t* icu_data = base::i18n::GetRawIcuMemory();
- init_function(icu_data);
- }
-
- // TODO(erg): All chromium binaries load base. We might want to make a
- // general system for other people.
-}
-
-} // namespace shell
-} // namespace mojo
« no previous file with comments | « mojo/shell/runner/init.h ('k') | mojo/shell/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698