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

Unified Diff: chrome/plugin/plugin_main.cc

Issue 6551002: Preload IME for the flash sandbox plugin... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/plugin_main.cc
===================================================================
--- chrome/plugin/plugin_main.cc (revision 74231)
+++ chrome/plugin/plugin_main.cc (working copy)
@@ -68,6 +68,18 @@
return (path.BaseName() == FilePath(L"gcswf32.dll"));
}
+// Before we lock down the flash sandbox, we need to activate
+// the IME machinery. After lock down it seems it is unable
+// to start. Note that we leak the IME context on purpose.
+int PreloadIMEForFlash() {
+ HIMC imc = ::ImmCreateContext();
+ if (!imc)
+ return 0;
+ if (::ImmGetOpenStatus(imc))
+ return 1;
+ return 2;
+}
+
#endif
// main() routine for running as the plugin process.
@@ -133,6 +145,8 @@
// start elevated and it will call DelayedLowerToken(0) when it's ready.
if (IsPluginBuiltInFlash(parsed_command_line)) {
DVLOG(1) << "Sandboxing flash";
+ if (!PreloadIMEForFlash())
+ DVLOG(1) << "IME preload failed";
DelayedLowerToken(target_services);
} else {
target_services->LowerToken();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698