summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 02:33:58 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 02:33:58 +0000
commit5cb7e177ac5622d5923a092acb1758194b787543 (patch)
treeb52eb4d2dec1b8027669f7891b13a219fab61263 /chrome/plugin
parentc8f00433e7673fe6099b31bfc29906c22d9d8024 (diff)
downloadchromium_src-5cb7e177ac5622d5923a092acb1758194b787543.zip
chromium_src-5cb7e177ac5622d5923a092acb1758194b787543.tar.gz
chromium_src-5cb7e177ac5622d5923a092acb1758194b787543.tar.bz2
Preload IME for the flash sandbox plugin
Before we lock down (call LowerToken()) we force the IME subsystem to load, so the required resources are acquired. Typical sites that show the issue are weathernews.jp and www.nicovideo.jp BUG=66605 TEST=see bug Review URL: http://codereview.chromium.org/6551002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75568 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/plugin_main.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc
index 4268b0f..5c94e52 100644
--- a/chrome/plugin/plugin_main.cc
+++ b/chrome/plugin/plugin_main.cc
@@ -68,6 +68,18 @@ bool IsPluginBuiltInFlash(const CommandLine& cmd_line) {
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 @@ int PluginMain(const MainFunctionParams& parameters) {
// 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();