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

Unified Diff: mojo/runner/init.cc

Issue 1431133003: mandoline: Reland "Fix ICU initialization". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT and then fix compile. Created 5 years, 1 month 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
Index: mojo/runner/init.cc
diff --git a/mojo/runner/init.cc b/mojo/runner/init.cc
index a5cc9e1a63a121607c6512d96306066808c424db..b76dfc634efe9e5fa0e7e503ec50d0b299e19872 100644
--- a/mojo/runner/init.cc
+++ b/mojo/runner/init.cc
@@ -8,6 +8,7 @@
#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"
@@ -60,5 +61,23 @@ void WaitForDebuggerIfNecessary() {
}
}
+void CallLibraryEarlyInitialization(base::NativeLibrary app_library) {
+ // Do whatever warming that the mojo application wants.
+ typedef void (*LibraryEarlyInitFunction)(const uint8*);
+ 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* 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 runner
} // namespace mojo
« no previous file with comments | « mojo/runner/init.h ('k') | tools/telemetry/telemetry/internal/backends/mandoline/mandoline_browser_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698