From 7c2d0327b7219e500586c680329db6afd5dfd08d Mon Sep 17 00:00:00 2001
From: Zoltan Arvai <zarvai@inf.u-szeged.hu>
Date: Mon, 13 Jan 2014 15:21:17 +0100
Subject: [PATCH] Fix WebEngineContext on Windows

AppendSwitchASCII won't accept WChars, it would need WideToASCII
conversion. But on OS_WIN AppendSwitchASCII method only wraps
parameters for AppendSwitchNative with ASCIIToWide.
Doing ASCIIToWide(WideToASCII()) not seems to be a useful idea,
so we should call directly AppendSwitchNative on Windows.
See chromium/base/command_line.cc.

Change-Id: I9733993840ddaef2dbb3176135977c39a967e381
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
---
 src/core/web_engine_context.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index adc7e7dac..28d336e9d 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -131,7 +131,11 @@ WebEngineContext::WebEngineContext(WebContentsAdapterClient::RenderingMode rende
 
     CommandLine* parsedCommandLine = CommandLine::ForCurrentProcess();
     parsedCommandLine->AppendSwitchASCII(switches::kUserAgent, webkit_glue::BuildUserAgentFromProduct("QtWebEngine/0.1"));
+#if defined(OS_WIN)
+    parsedCommandLine->AppendSwitchNative(switches::kBrowserSubprocessPath,WebEngineLibraryInfo::subProcessPath().value().c_str());
+#else
     parsedCommandLine->AppendSwitchASCII(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::subProcessPath().value().c_str());
+#endif
     parsedCommandLine->AppendSwitch(switches::kNoSandbox);
     parsedCommandLine->AppendSwitch(switches::kDisablePlugins);
 
-- 
GitLab