Bug 45157 - [Qt] V8 port: Fix "WTF::String::utf8" returns incomplete type WTF::CString
Summary: [Qt] V8 port: Fix "WTF::String::utf8" returns incomplete type WTF::CString
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: QtWebKit Unassigned
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks: 45136
  Show dependency treegraph
 
Reported: 2010-09-02 18:47 PDT by Vlad
Modified: 2010-09-11 13:12 PDT (History)
7 users (show)

See Also:


Attachments
Eliminate ambiguous inclusion of animation.h and CString.h for Symbian (1.59 KB, patch)
2010-09-02 18:53 PDT, Vlad
darin: review-
Details | Formatted Diff | Diff
added CString.h to QT section of WTFString.h (1005 bytes, patch)
2010-09-03 19:16 PDT, Vlad
abarth: review-
Details | Formatted Diff | Diff
Proposed patch (2.38 KB, patch)
2010-09-11 11:23 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vlad 2010-09-02 18:47:56 PDT
Eliminate ambiguous inclusion of animation.h and CString.h
Comment 1 Vlad 2010-09-02 18:53:39 PDT
Created attachment 66453 [details]
Eliminate ambiguous inclusion of animation.h and CString.h for Symbian
Comment 2 Andreas Kling 2010-09-03 05:02:51 PDT
Comment on attachment 66453 [details]
Eliminate ambiguous inclusion of animation.h and CString.h for Symbian 

> +#if PLATFORM(QT)
> +#include <platform/animation/Animation.h>
> +#else
>  #include "Animation.h"
> +#endif

Does this really need to be Qt-specific?

> +#include <wtf/text/CString.h>

Why is this necessary? CString.h is always referenced by wtf/text/CString.h AFAIK.
Comment 3 Laszlo Gombos 2010-09-03 06:38:18 PDT
I agree with Andreas comments. Also I think these changes are not just for V8 but perhaps generally needed to make reliable builds on Symbian with JSC.
Comment 4 Darin Adler 2010-09-03 09:38:14 PDT
Comment on attachment 66453 [details]
Eliminate ambiguous inclusion of animation.h and CString.h for Symbian 

> +#if PLATFORM(QT)
> +#include <platform/animation/Animation.h>
> +#else
>  #include "Animation.h"
> +#endif

This is a bad direction -- it does not seem like a good long-term solution to have platform-specific different ways of including header files. Can we instead fix the paths passed in to the compiler so that WebCore compiles will find WebCore headers first, before system headers?

> +#include <wtf/text/CString.h>

We don't want every single file that includes PlatformString to also include CString. Why is this a good idea?
Comment 5 Vlad 2010-09-03 11:13:01 PDT
Animation.h and cstring.h files are present in Symbian system include folders as well. At the time of the port there was conflict between system includes and webkit.

It is fixed now by include order...
(In reply to comment #2)
> (From update of attachment 66453 [details])
> > +#if PLATFORM(QT)
> > +#include <platform/animation/Animation.h>
> > +#else
> >  #include "Animation.h"
> > +#endif
> 

This one prevents v8 binding compilation errors on symbian. 
 "WebCore\bindings\v8\V8Proxy.cpp", line 196: Error:  #409: function  "WTF::String::utf8" returns incomplete type "WTF::CString"
                                 targetDocument->url().string().utf8().data()
                                                                ^   
Otherwise I need to include #include <wtf/text/CString.h> in many v8 binding files
> Does this really need to be Qt-specific?
> 
> > +#include <wtf/text/CString.h>
> 
> Why is this necessary? CString.h is always referenced by wtf/text/CString.h AFAIK.
Comment 6 Vlad 2010-09-03 11:40:38 PDT
Tried #include <wtf/text/CString.h> in V8Proxy.h. Bindings compile fine, but generated files not :(
Comment 7 Vlad 2010-09-03 18:51:26 PDT
(In reply to comment #6)
RVCT complains about incomplete type:
FAILED compile  for armv5_urel:  generated\InspectorBackendDispatcher.cpp
 mmp: WebCore_0x200267C2.mmp
  "\webkit\WebCore\generated\InspectorBackendDispatcher.cpp", line 3688: Error:  #409: function "WTF::String::utf8" returns incomplete type
WTF::CString"
            reportProtocolError(callId, String::format("Protocol Error: Invalid command was received. '%s' wasn't found.", command.utf8().data()));
                                                                                                                                   ^
  X:\webkit.trunk1\WebCore\generated\InspectorBackendDispatcher.cpp: 0 warnings, 1 error
> Tried #include <wtf/text/CString.h> in V8Proxy.h. Bindings compile fine, but generated files not :(
Comment 8 Vlad 2010-09-03 19:16:42 PDT
Created attachment 66579 [details]
added CString.h to QT section of WTFString.h

I think I found compromise - added CString.h to QT section of WTFString.h
Comment 9 Andreas Kling 2010-09-05 17:55:23 PDT
(In reply to comment #6)
> Tried #include <wtf/text/CString.h> in V8Proxy.h. Bindings compile fine, but generated files not :(

If this is indeed the problem, it would be better to modify the code generator script(s) to include the necessary header instead of messing with WTFString.h
Comment 10 Adam Barth 2010-09-05 23:24:09 PDT
Comment on attachment 66579 [details]
added CString.h to QT section of WTFString.h

I agree with kling.  This doesn't seem like the right place to include the header.  If it were the right place, we should do so unconditionally anyway.
Comment 11 Andreas Kling 2010-09-11 11:23:10 PDT
Created attachment 67311 [details]
Proposed patch
Comment 12 Simon Hausmann 2010-09-11 11:24:21 PDT
Comment on attachment 67311 [details]
Proposed patch

r=me

Explicit inclusion is better than implicit :)
Comment 13 Andreas Kling 2010-09-11 11:28:58 PDT
Comment on attachment 67311 [details]
Proposed patch

Clearing flags on attachment: 67311

Committed r67308: <http://trac.webkit.org/changeset/67308>
Comment 14 Andreas Kling 2010-09-11 11:29:08 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 WebKit Review Bot 2010-09-11 13:12:14 PDT
http://trac.webkit.org/changeset/67308 might have broken GTK Linux 32-bit Debug