Bug 55719 - [Qt][WK2] Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1
Summary: [Qt][WK2] Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P3 Normal
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on: 55658
Blocks: 55659 57617 58223
  Show dependency treegraph
 
Reported: 2011-03-03 15:27 PST by Oleg Romashin (:romaxa)
Modified: 2011-04-14 15:17 PDT (History)
11 users (show)

See Also:


Attachments
Works fine with latest webkit, need to check other platforms WIP1 (45.44 KB, patch)
2011-03-04 00:24 PST, Oleg Romashin (:romaxa)
kenneth: review-
Details | Formatted Diff | Diff
WIP2 fixed style issues (32.63 KB, patch)
2011-03-04 12:17 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Part1, dummy Qt implementation, Makefiles (18.92 KB, patch)
2011-03-04 14:25 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Part1, dummy Qt implementation, Makefiles (18.97 KB, patch)
2011-03-04 14:27 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Fixed review comments (18.89 KB, patch)
2011-03-04 17:49 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Part2, fixed sendComplexInput (27.69 KB, patch)
2011-03-06 13:55 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Added dummy implementation for Gtk and Win port (30.03 KB, patch)
2011-03-06 14:57 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Added dummy implementation for Gtk and Win port + Fix 3 unresolved externals on win port (32.10 KB, patch)
2011-03-06 17:57 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Added dummy implementation for Gtk and Win port + Fix 3 unresolved externals on win port.v4 (32.08 KB, patch)
2011-03-06 18:55 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Fixed some review comments, (34.97 KB, patch)
2011-03-07 18:49 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Qt Xlib includes conflict fix, Fixed include order, QTBUG-54 (2.85 KB, patch)
2011-03-08 00:10 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Use runtime_internal.h to solve X/Qt conflicts (1.52 KB, patch)
2011-03-08 11:19 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Fixed according to recent NetscapePluginQt/Gtk -> NetscapePluginX11 changes (34.29 KB, patch)
2011-03-10 16:10 PST, Oleg Romashin (:romaxa)
kling: review-
Details | Formatted Diff | Diff
Fixed comments from 55719#c35 (34.29 KB, patch)
2011-03-10 16:36 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Fixed style nit from 55719#c37 (34.29 KB, patch)
2011-03-10 18:37 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Build log (9.03 KB, text/plain)
2011-03-10 23:55 PST, Oleg Romashin (:romaxa)
no flags Details
Same patch, but with complexTextPlugin disabled for non-Mac (11.61 KB, patch)
2011-03-12 22:03 PST, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Fixed patch apply to latest trunk (12.58 KB, patch)
2011-03-16 22:41 PDT, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Keep PluginProcess::createWebProcessConnection in PluginProcess.cpp (suggested by :andersca) (10.96 KB, patch)
2011-03-17 09:59 PDT, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
Previous version, added missing WebProcessConnection.h createWebProcessConnection platform specific method (12.67 KB, patch)
2011-03-17 10:59 PDT, Oleg Romashin (:romaxa)
no flags Details | Formatted Diff | Diff
patch (15.72 KB, patch)
2011-03-31 08:53 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff
Patch (14.24 KB, patch)
2011-04-08 17:20 PDT, Balazs Kelemen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Romashin (:romaxa) 2011-03-03 15:27:54 PST
It is a bit problematic to compile Qt port now with PLUGIN_PROCESS enabled, bunch of file contain not properly ifdefed CoreIPC::MachPort, .pro files don't compile some certain files et.c.
Some parts need dummy implementation with notImplemented() function in "qt" folders
Comment 1 Oleg Romashin (:romaxa) 2011-03-03 15:28:40 PST
Bug 55658 - is needed to ifdef MachPort related functionality in *.messages.in files
Comment 2 Oleg Romashin (:romaxa) 2011-03-04 00:24:31 PST
Created attachment 84703 [details]
Works fine with latest webkit, need to check other platforms WIP1
Comment 3 WebKit Review Bot 2011-03-04 00:27:50 PST
Attachment 84703 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit.pri', u'Source/WebKit2/Deriv..." exit_code: 1

Source/WebKit2/PluginProcess/qt/PluginProcessQt.cpp:34:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebKit2/WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp:27:  You should add a blank line after implementation file's own header.  [build/include_order] [4]
Source/WebKit2/WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp:38:  Use 0 instead of NULL.  [readability/null] [5]
Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp:38:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 4 in 24 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Kenneth Rohde Christiansen 2011-03-04 00:32:41 PST
Comment on attachment 84703 [details]
Works fine with latest webkit, need to check other platforms WIP1

View in context: https://bugs.webkit.org/attachment.cgi?id=84703&action=review

Where are the changelogs? Did you run check-webkit-style and prepare-ChangeLog? Please consult the wikipages on how to contribute to WebKit

> Source/WebKit.pri:76
> +webkit2:INCLUDEPATH *= $$OUTPUT_DIR/include/WebKit2 $$OUTPUT_DIR/WebKit2/generated

Don't we have these generated included somewhere else?

> Source/WebKit2/PluginProcess/PluginControllerProxy.cpp:258
> +#if PLATFORM(MAC)
>  void PluginControllerProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)

So we will not support input methods? Actuallu you are saying that no other platform that Mac will support this. I guess this should be #if !PLATFORM(QT) instead

> Source/WebKit2/PluginProcess/PluginProcess.cpp:133
>  
>  void PluginProcess::createWebProcessConnection()
>  {
> +#if PLATFORM(MAC)
>      // FIXME: This is platform specific!

Maybe this should be integrated into a PluginProcessMac instead?

> Source/WebKit2/Scripts/webkit2/messages.py:454
> +    headers = {
> +        '"%s"' % messages_header_filename(receiver): None,
> +        '"HandleMessage.h"': None,

This patch is very hard to review as there is no changelog explaining why you are making these changes...
Comment 5 Oleg Romashin (:romaxa) 2011-03-04 00:50:22 PST
> Where are the changelogs? Did you run check-webkit-style and prepare-ChangeLog? Please consult the wikipages on how to contribute to WebKit
> 
sorry, I'm just trying to check this patch on other platforms, so that is why it is marked as WIP

> > +webkit2:INCLUDEPATH *= $$OUTPUT_DIR/include/WebKit2 $$OUTPUT_DIR/WebKit2/generated
> 
> Don't we have these generated included somewhere else?

By some reason no, I did not get why it does not work, and found only this way to make it works, if you have any ideas what other place better for this include please share.

> > +#if PLATFORM(MAC)
> >  void PluginControllerProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
> 
> So we will not support input methods? Actuallu you are saying that no other platform that Mac will support this. I guess this should be #if !PLATFORM(QT) instead


Not sure, I can make Qt method with notImplemented  entry, probably it make more sense for future development

> > Source/WebKit2/PluginProcess/PluginProcess.cpp:133
> >  
> >  void PluginProcess::createWebProcessConnection()
> >  {
> > +#if PLATFORM(MAC)
> >      // FIXME: This is platform specific!
> 
> Maybe this should be integrated into a PluginProcessMac instead?

Not sure about this stuff yet, just got separate process create, but did not get where and how these specific things need to be initialized

> 
> > Source/WebKit2/Scripts/webkit2/messages.py:454
> > +    headers = {
> > +        '"%s"' % messages_header_filename(receiver): None,
> > +        '"HandleMessage.h"': None,
> 
> This patch is very hard to review as there is no changelog explaining why you are making these changes...

messages.py part already attached for review in separate dependent bug 55658 ....

that is about teaching IPC stub generator to use ifdefs for forward headers related to ifdef-ed methods
Comment 6 Oleg Romashin (:romaxa) 2011-03-04 00:50:46 PST
anyway thanks for WIP review
Comment 7 Oleg Romashin (:romaxa) 2011-03-04 12:17:09 PST
Created attachment 84790 [details]
WIP2 fixed style issues
Comment 8 Kenneth Rohde Christiansen 2011-03-04 12:21:55 PST
Comment on attachment 84790 [details]
WIP2 fixed style issues

Changelogs are mandatory, please use the Tools/Scripts/prepare-ChangeLog script
Comment 9 Oleg Romashin (:romaxa) 2011-03-04 14:25:48 PST
Created attachment 84796 [details]
Part1, dummy Qt implementation, Makefiles
Comment 10 Oleg Romashin (:romaxa) 2011-03-04 14:27:17 PST
Created attachment 84797 [details]
Part1, dummy Qt implementation, Makefiles
Comment 11 Kenneth Rohde Christiansen 2011-03-04 15:08:19 PST
Comment on attachment 84797 [details]
Part1, dummy Qt implementation, Makefiles

View in context: https://bugs.webkit.org/attachment.cgi?id=84797&action=review

Seems pretty OK to me as a start.

> Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp:47
> +    notImplemented();
> +

Things are implemented in this method

> Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp:52
> +    String localization = commandLine["localization"];

I do not see what that does here. It is not used anywhere
Comment 12 Oleg Romashin (:romaxa) 2011-03-04 17:49:49 PST
Created attachment 84835 [details]
Fixed review comments
Comment 13 Oleg Romashin (:romaxa) 2011-03-04 17:53:59 PST
I hope it was ok to move r+ to updated patch...
Comment 14 Kenneth Rohde Christiansen 2011-03-06 05:27:48 PST
(In reply to comment #13)
> I hope it was ok to move r+ to updated patch...

It is not. You can manually fill out the reviewer field and just add cq?
Comment 15 WebKit Commit Bot 2011-03-06 10:29:32 PST
Comment on attachment 84835 [details]
Fixed review comments

Clearing flags on attachment: 84835

Committed r80434: <http://trac.webkit.org/changeset/80434>
Comment 16 Oleg Romashin (:romaxa) 2011-03-06 13:55:27 PST
Created attachment 84899 [details]
Part2, fixed sendComplexInput
Comment 17 Build Bot 2011-03-06 14:29:57 PST
Attachment 84899 [details] did not build on win:
Build output: http://queues.webkit.org/results/8107161
Comment 18 Oleg Romashin (:romaxa) 2011-03-06 14:57:31 PST
Created attachment 84901 [details]
Added dummy implementation for Gtk and Win port
Comment 19 Oleg Romashin (:romaxa) 2011-03-06 14:58:42 PST
Comment on attachment 84790 [details]
WIP2 fixed style issues

this is obsolete now
Comment 20 Build Bot 2011-03-06 15:24:49 PST
Attachment 84901 [details] did not build on win:
Build output: http://queues.webkit.org/results/8105317
Comment 21 Oleg Romashin (:romaxa) 2011-03-06 17:57:12 PST
Created attachment 84904 [details]
Added dummy implementation for Gtk and Win port + Fix 3 unresolved externals on win port
Comment 22 Build Bot 2011-03-06 18:23:35 PST
Attachment 84904 [details] did not build on win:
Build output: http://queues.webkit.org/results/8103423
Comment 23 Oleg Romashin (:romaxa) 2011-03-06 18:55:21 PST
Created attachment 84907 [details]
Added dummy implementation for Gtk and Win port + Fix 3 unresolved externals on win port.v4
Comment 24 Oleg Romashin (:romaxa) 2011-03-06 23:07:10 PST
Comment on attachment 84907 [details]
Added dummy implementation for Gtk and Win port + Fix 3 unresolved externals on win port.v4

Ok, this version builds fine on win port now.
Comment 25 Balazs Kelemen 2011-03-07 02:13:02 PST
Comment on attachment 84907 [details]
Added dummy implementation for Gtk and Win port + Fix 3 unresolved externals on win port.v4

View in context: https://bugs.webkit.org/attachment.cgi?id=84907&action=review

Informal review from a non-reviewer.

Generally I thing we should first design how to make things more portable.
Btw, why do you think all platforms need the complex text stuff?
It seems to be pretty Mac specific.

> Source/WebKit2/PluginProcess/PluginProcess.cpp:135
> -    // FIXME: This is platform specific!
> -
> +#if PLATFORM(MAC)
>      // Create the listening port.
>      mach_port_t listeningPort;
>      mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);

This function should rather be factored to be a platform specific one that is implemented per platform...

> Source/WebKit2/PluginProcess/PluginProcess.cpp:148
> +#else
> +    ASSERT(false);
> +#endif

and than this should be removed.

> Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp:131
> +#else
> +        ASSERT(false);
> +#endif

Use ASSERT_NOT_REACHED(). It's an open question however how to abstract an empty message in a platform independent way.
Maybe we should solve this before actually adding even a stub implementation for plugin process.

> Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp:212
>      CoreIPC::ArgumentEncoder* reply = m_pendingConnectionReplies.first().second;
>      m_pendingConnectionReplies.removeFirst();
>  
> -    // FIXME: This is Mac specific.
>      reply->encode(CoreIPC::MachPort(machPort.port(), MACH_MSG_TYPE_MOVE_SEND));
> +
>      replyWebProcessProxy->connection()->sendSyncReply(reply);
>  }
> +#endif

Similar issue. It is not good having this to be implemented per platform just because of the MachPort argument.
Comment 26 Oleg Romashin (:romaxa) 2011-03-07 07:59:38 PST
(In reply to comment #25)
> (From update of attachment 84907 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=84907&action=review
> 
> Informal review from a non-reviewer.
> 
> Generally I thing we should first design how to make things more portable.
> Btw, why do you think all platforms need the complex text stuff?
> It seems to be pretty Mac specific.

Not sure about it in 55719#c4, I got suggestion about adding this for non-mac platforms (originally I just moved one entry under MAC define), I'm not mac developer, can we get some understanding is it pure mac specific stuff or is it possible to implement it for other platforms?


> Maybe we should solve this before actually adding even a stub implementation for plugin process.

Goal here is not to implement anything, but make this dummy stub compilable, with assert entries which should help us to not skip important implementations

> 
> Similar issue. It is not good having this to be implemented per platform just because of the MachPort argument.

Not sure what is the right way to fix this problem... do you have any suggestions? Wrap argument into platform-independent structure?
Comment 27 Oleg Romashin (:romaxa) 2011-03-07 18:49:09 PST
Created attachment 85008 [details]
Fixed some review comments,

moved createWebProcessConnection to platform specific implementation, fixed changed to assert_not_reached
asked kling about ComplexTextInput and he proposed to keep that Qt IME implementation.

m_connection->send(Messages::PluginProcessProxy::DidCreateWebProcessConnection(clientPort), 0); - is called only from PluginProcess::createWebProcessConnection, which is not implemented yet in Qt port.
lets keep DidCreateWebProcessConnection mac only for now, and change that when some implementation for Qt createWebProcessConnection is done.
Comment 28 Oleg Romashin (:romaxa) 2011-03-08 00:10:11 PST
Created attachment 85029 [details]
Qt Xlib includes conflict fix, Fixed include order, QTBUG-54

A bit hacky fix, against webkit style but according to 
http://bugreports.qt.nokia.com/browse/QTBUG-54
**************
Since X11 headers are not namespace safe, they have to be included after Qt headers. Generally, headers should always be included in the order from the most specialized to the most general one to prevent namespace pollution:

#include "myownheader.h"
#include <someQtHeader.h>
#include <X11/someXheader>
#include <string.h> // system header
**************

Another way to fix it is some magic with "Bool" "Status" defines, but that looks ugly.
Comment 29 WebKit Review Bot 2011-03-08 00:14:07 PST
Attachment 85029 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1

Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp:28:  Found other header before a header this file implements. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
Source/WebKit2/Shared/Plugins/NPIdentifierData.h:32:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebKit2/Shared/Plugins/NPObjectProxy.cpp:28:  Found other header before a header this file implements. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
Total errors found: 3 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 30 Balazs Kelemen 2011-03-08 06:02:07 PST
Comment on attachment 85029 [details]
Qt Xlib includes conflict fix, Fixed include order, QTBUG-54

View in context: https://bugs.webkit.org/attachment.cgi?id=85029&action=review

> Source/WebKit2/Shared/Plugins/NPIdentifierData.h:33
> -#include <WebCore/npruntime.h>
>  #include <wtf/text/CString.h>
> +#include <WebCore/npruntime.h>
>  

We have WebCore/bridge/npruntime_internal.h to solve this. Hopefully it can solve all these "evil defines" problems.
Comment 31 Oleg Romashin (:romaxa) 2011-03-08 11:19:50 PST
Created attachment 85064 [details]
Use runtime_internal.h to solve X/Qt conflicts

Thanks Balazs, this works fine
Comment 32 Andreas Kling 2011-03-10 15:58:33 PST
Comment on attachment 85064 [details]
Use runtime_internal.h to solve X/Qt conflicts

rs=me
Comment 33 Oleg Romashin (:romaxa) 2011-03-10 16:10:10 PST
Created attachment 85403 [details]
Fixed according to recent NetscapePluginQt/Gtk -> NetscapePluginX11 changes
Comment 34 WebKit Commit Bot 2011-03-10 16:17:20 PST
Comment on attachment 85064 [details]
Use runtime_internal.h to solve X/Qt conflicts

Clearing flags on attachment: 85064

Committed r80784: <http://trac.webkit.org/changeset/80784>
Comment 35 Andreas Kling 2011-03-10 16:21:26 PST
Comment on attachment 85403 [details]
Fixed according to recent NetscapePluginQt/Gtk -> NetscapePluginX11 changes

View in context: https://bugs.webkit.org/attachment.cgi?id=85403&action=review

> Source/WebKit2/UIProcess/API/qt/qwkpage.cpp:280
> +void
> +QWKPagePrivate::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier,
> +                                           bool complexTextInputEnabled)

Coding style, this should all be on one line.

> Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp:140
> -        // FIXME: This is Mac specific.
> +#if PLATFORM(MAC)
>          reply->encode(CoreIPC::MachPort(0, MACH_MSG_TYPE_MOVE_SEND));
> +#else
> +        ASSERT_NOT_REACHED();
> +#endif
>          replyWebProcessProxy->connection()->sendSyncReply(reply);

Why the ASSERT_NOT_REACHED()? It reads to me like we can indeed reach this code.

> Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp:217
> +

Unnecessary newline.

> Source/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.cpp:74
> +    connectionIdentifier = 0;
> +    ASSERT(connectionIdentifier);

What's going on here?
Comment 36 Oleg Romashin (:romaxa) 2011-03-10 16:36:37 PST
Created attachment 85408 [details]
Fixed comments from 55719#c35
Comment 37 Andreas Kling 2011-03-10 16:43:10 PST
Comment on attachment 85408 [details]
Fixed comments from 55719#c35

View in context: https://bugs.webkit.org/attachment.cgi?id=85408&action=review

As discussed on IRC, this is merely the first step (making it build) towards a proper implementation.

I like the intent of keeping patches incremental and readable, so I'll say r+ here.

> Source/WebKit2/UIProcess/API/qt/qwkpage.cpp:279
> +void
> +QWKPagePrivate::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)

Coding style, the function return type should not be on a line by itself.
Comment 38 Balazs Kelemen 2011-03-10 16:56:21 PST
The patch looks good to me but we should investigate in the complex 
text concept to understand it's role. I'm still unsure about that we
really need that. I will take a look into that tomorrow.
Comment 39 Oleg Romashin (:romaxa) 2011-03-10 18:37:49 PST
Created attachment 85419 [details]
Fixed style nit from 55719#c37
Comment 40 Oleg Romashin (:romaxa) 2011-03-10 23:55:02 PST
Created attachment 85440 [details]
Build log

Not sure where is exactly problem, but I found that when we compiling UIProcess or WebProcess stuff then WebKit2 includes are in first place, but when we compiling PluginProcess stuff then WebKit includes (as well config.h) are not available in first place and WebCore stuff overriding config.h from webkit2 subfolder...
as result we are getting build error in attachment...

Fast fix is to copy PLUGIN_ARCHITECTURE stuff to webcore/config.h but that is wrong because I don't understand why in pluginProcess includes order are different comparing to WebProcess or UIProcess 
..
I tried to compare .pri/pro files and did not found what is the difference...
any ideas what is wrong here?
Comment 41 Oleg Romashin (:romaxa) 2011-03-10 23:56:58 PST
kbalazs: do you know what is needed in order to have right include order for PluginProcess?
Comment 42 Balazs Kelemen 2011-03-11 04:56:01 PST
(In reply to comment #41)
> kbalazs: do you know what is needed in order to have right include order for PluginProcess?

Currently I have not idea.
Comment 43 Balazs Kelemen 2011-03-11 06:55:53 PST
Huhh, complex text handling is complex. I'm still unsure about the purpose of the whole logic i.e
I'm unsure about it is needed for supporting exotic languages or it is just an optimization for situations when
the simple code path can be used. Actually the plugin part is seems to be really needed for supporting non-regular
text with plugins (i.e. we need to wait for the whole string to arrive before sending it to the plugin).
However I hardly think that it is even possible for X based plugins.
The complex text is sent to the plugin here (on Mac):
-> NetscapePluginMac.cpp
void NetscapePlugin::sendComplexTextInput(const String& textInput)
{
    switch (m_eventModel) {
    case NPEventModelCocoa: {
        NPCocoaEvent event = initializeEvent(NPCocoaEventTextInput);
        event.data.text.text = reinterpret_cast<NPNSString*>(static_cast<NSString*>(textInput));
        NPP_HandleEvent(&event);
        break;
    }
...

But we have to work with XKeyEvent that cannot store a unicode string.
According to that I didn't see anything in the Qt and GTK WK1 plugin code that deals with complex text.

The complex text story exists on WK1 as well at the WebKit level but it is used by only Mac and Windows.
Here is some grep output:
./mac/WebKit.order:2464:+[WebView(WebPrivate) _setAlwaysUsesComplexTextCodePath:]
./mac/WebView/WebView.mm:1019:    [self _setAlwaysUsesComplexTextCodePath:f];
./mac/WebView/WebView.mm:1022:+ (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f
./mac/WebView/WebViewPrivate.h:340:+ (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f;
./win/Interfaces/IWebViewPrivate.idl:156:    HRESULT setAlwaysUsesComplexTextCodePath([in] BOOL complex);
./win/Interfaces/IWebViewPrivate.idl:157:    HRESULT alwaysUsesComplexTextCodePath([out, retval] BOOL* complex);
./win/WebView.h:750:    virtual HRESULT STDMETHODCALLTYPE setAlwaysUsesComplexTextCodePath(
./win/WebView.h:753:    virtual HRESULT STDMETHODCALLTYPE alwaysUsesComplexTextCodePath(
./win/WebView.cpp:5853:HRESULT STDMETHODCALLTYPE WebView::setAlwaysUsesComplexTextCodePath(BOOL complex)
./win/WebView.cpp:5855:    WebCoreSetAlwaysUsesComplexTextCodePath(complex);
./win/WebView.cpp:5860:HRESULT STDMETHODCALLTYPE WebView::alwaysUsesComplexTextCodePath(BOOL* complex)
./win/WebView.cpp:5865:    *complex = WebCoreAlwaysUsesComplexTextCodePath();

According to special circumstances they call WebCore::Font::setCodePath (static function) to statically
anchor the path to use. I guess it is about optimizing the simple case and avoid having to decide the path
for every text run.

In summary I think we should not deal with that now but leave it as a Mac specific thing.
This way we can set up the build with a less complex patch.
Comment 44 Oleg Romashin (:romaxa) 2011-03-12 22:03:11 PST
Created attachment 85607 [details]
Same patch, but with complexTextPlugin disabled for non-Mac

Here is another patch which does not contain complexTextPlugin stuff
From my point of view it worse to add InputText API for NON-Mac plugins, and should not be hard... also it will help for som different mobile platforms with different VKB IM...

but anyway patch above with ComplexTextInput, and current patch without it.
My point here is to get ENABLE_PLUGIN_PROCES define compiling.
Comment 45 Balazs Kelemen 2011-03-13 05:25:53 PDT
(In reply to comment #44)
> Created an attachment (id=85607) [details]
> Same patch, but with complexTextPlugin disabled for non-Mac
> 
> Here is another patch which does not contain complexTextPlugin stuff
> From my point of view it worse to add InputText API for NON-Mac plugins, and should not be hard... also it will help for som different mobile platforms with different VKB IM...

IMHO this can be handled in the future and not belongs strictly to
make Qt build with ENABLE(PLUGIN_PROCESS).
Comment 46 Andreas Kling 2011-03-16 19:28:45 PDT
Comment on attachment 85607 [details]
Same patch, but with complexTextPlugin disabled for non-Mac

OK
Comment 47 WebKit Commit Bot 2011-03-16 19:32:33 PDT
Comment on attachment 85607 [details]
Same patch, but with complexTextPlugin disabled for non-Mac

Rejecting attachment 85607 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=eseidel-cq-sf', 'ap..." exit_code: 2

Last 500 characters of output:

patching file Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
Hunk #1 succeeded at 80 (offset 3 lines).
patching file Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.messages.in
patching file Source/WebKit2/WebProcess/Plugins/PluginProcessConnectionManager.cpp
patching file Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Hunk #1 succeeded at 110 (offset 1 line).

Failed to run "[u'/Projects/CommitQueue/Tools/Scripts/svn-apply', u'--reviewer', u'Andreas Kling', u'--force']" exit_code: 1

Full output: http://queues.webkit.org/results/8193339
Comment 48 Oleg Romashin (:romaxa) 2011-03-16 22:41:17 PDT
Created attachment 86028 [details]
Fixed patch apply to latest trunk
Comment 49 Balazs Kelemen 2011-03-17 01:33:29 PDT
(In reply to comment #48)
> Created an attachment (id=86028) [details]
> Fixed patch apply to latest trunk

May I land it?
Comment 50 WebKit Commit Bot 2011-03-17 04:18:52 PDT
Comment on attachment 86028 [details]
Fixed patch apply to latest trunk

Rejecting attachment 86028 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-3', 'build'..." exit_code: 2

Last 500 characters of output:
 WebKit2 WITH CONFIGURATION Debug ===
Check dependencies

=== BUILD AGGREGATE TARGET All OF PROJECT WebKit2 WITH CONFIGURATION Debug ===
Check dependencies
** BUILD FAILED **


The following build commands failed:
WebKit2:
	CompileC /mnt/git/webkit-commit-queue/WebKitBuild/WebKit2.build/Debug/WebKit2.build/Objects-normal/x86_64/PluginProcessMac.o /mnt/git/webkit-commit-queue/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm normal x86_64 objective-c++ com.apple.compilers.gcc.4_2
(1 failure)


Full output: http://queues.webkit.org/results/8188670
Comment 51 Oleg Romashin (:romaxa) 2011-03-17 09:50:39 PDT
sounds like NetscapePluginModule.h missing in PluginProcessMac.mm, but not sure... is there are some way to get more dtailed info about mac failure?
Comment 52 Oleg Romashin (:romaxa) 2011-03-17 09:59:33 PDT
Created attachment 86064 [details]
Keep PluginProcess::createWebProcessConnection in PluginProcess.cpp (suggested by :andersca)
Comment 53 Balazs Kelemen 2011-03-17 10:04:52 PDT
(In reply to comment #52)
> Created an attachment (id=86064) [details]
> Keep PluginProcess::createWebProcessConnection in PluginProcess.cpp (suggested by :andersca)

It's there but hard to find. Search for "PluginProcessMac.mm" from the
start of the build log. ;)
Comment 54 Oleg Romashin (:romaxa) 2011-03-17 10:59:02 PDT
Created attachment 86070 [details]
Previous version, added missing WebProcessConnection.h  createWebProcessConnection platform specific method
Comment 55 Balazs Kelemen 2011-03-18 11:04:50 PDT
(In reply to comment #54)
> Created an attachment (id=86070) [details]
> Previous version, added missing WebProcessConnection.h  createWebProcessConnection platform specific method

So, which one do you like to be reviewed?
Comment 56 Oleg Romashin (:romaxa) 2011-03-18 11:35:31 PDT
> So, which one do you like to be reviewed?

createWebProcessConnection now contain also generic code, so I guess second one need to be reviewed.
https://bugs.webkit.org/attachment.cgi?id=86070
Comment 57 Andreas Kling 2011-03-18 11:44:29 PDT
CC'ing people who care about Qt + plugins.
Comment 58 Balazs Kelemen 2011-03-31 08:53:47 PDT
Created attachment 87734 [details]
patch

Updated patch. Handle some further build issues.
Comment 59 Eric Seidel (no email) 2011-04-06 10:43:41 PDT
Comment on attachment 85607 [details]
Same patch, but with complexTextPlugin disabled for non-Mac

Cleared Andreas Kling's review+ from obsolete attachment 85607 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Comment 60 Eric Seidel (no email) 2011-04-06 10:43:46 PDT
Comment on attachment 86028 [details]
Fixed patch apply to latest trunk

Cleared Andreas Kling's review+ from obsolete attachment 86028 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Comment 61 Balazs Kelemen 2011-04-08 17:20:07 PDT
Created attachment 88903 [details]
Patch
Comment 62 Balazs Kelemen 2011-04-08 17:24:47 PDT
Comment on attachment 88903 [details]
Patch

Changed my mind.
We don't need separate files for Qt and Gtk.
Comment 63 Balazs Kelemen 2011-04-08 17:29:23 PDT
Comment on attachment 88903 [details]
Patch

...but the renaming should be handled in a follow up patch
Comment 64 Balazs Kelemen 2011-04-14 02:13:33 PDT
ping
Comment 65 Balazs Kelemen 2011-04-14 05:38:57 PDT
Comment on attachment 88903 [details]
Patch

Clearing flags on attachment: 88903

Committed r83842: <http://trac.webkit.org/changeset/83842>
Comment 66 Balazs Kelemen 2011-04-14 05:39:08 PDT
All reviewed patches have been landed.  Closing bug.
Comment 67 Csaba Osztrogonác 2011-04-14 07:17:53 PDT
It broke the Symbian build: http://webkit.sed.hu/buildbot/builders/Qt%20Symbian%20ARMv5%20Release/builds/368

Could you fix it?
Comment 68 Balazs Kelemen 2011-04-14 07:53:59 PDT
(In reply to comment #67)
> It broke the Symbian build: http://webkit.sed.hu/buildbot/builders/Qt%20Symbian%20ARMv5%20Release/builds/368
> 
> Could you fix it?

I don't think so :(
This is the error:
Compile    : Source\WebKit2\Shared\Plugins\PluginProcessCreationParameters.cpp [armv5_urel.rvct4_0]
   /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
   /bin/sh: -c: line 1: syntax error: unexpected end of filef

This make me guess that this is either a compiler error or an error with the bot.
Actually my patch should not change anything without adding the -DDEFINES+=ENABLE_PLUGIN_PROCESS flag to the build.
Comment 69 jade han 2011-04-14 15:03:37 PDT
the build break on symbian builder is not related to code, but related to a raptor issue which siddharth.mathur@nokia.com will file a bug against.  By passing --no-depend-generate to sbs command, the build is passing now.
Comment 70 Balazs Kelemen 2011-04-14 15:17:58 PDT
(In reply to comment #69)
> the build break on symbian builder is not related to code, but related to a raptor issue which siddharth.mathur@nokia.com will file a bug against.  By passing --no-depend-generate to sbs command, the build is passing now.

Thanks for finding this out.