Bug 66856

Summary: [EFL] Do not always return the cached frame name.
Product: WebKit Reporter: Raphael Kubo da Costa (:rakuco) <rakuco>
Component: New BugsAssignee: Raphael Kubo da Costa (:rakuco) <rakuco>
Status: RESOLVED FIXED    
Severity: Normal CC: kenneth, leandro, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Use operator== instead of strcmp none

Description Raphael Kubo da Costa (:rakuco) 2011-08-24 06:56:37 PDT
[EFL] Do not always return the cached frame name.
Comment 1 Raphael Kubo da Costa (:rakuco) 2011-08-24 06:57:43 PDT
Created attachment 104993 [details]
Patch
Comment 2 Ryuan Choi 2011-08-24 15:59:10 PDT
Comment on attachment 104993 [details]
Patch

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

> Source/WebKit/efl/ewk/ewk_frame.cpp:358
> +    const WTF::String s = sd->frame->tree()->uniqueName();
> +    const WTF::CString cs = s.utf8();

Informal r+.

But, how do you think about making above as one line and giving better name?
Comment 3 Raphael Kubo da Costa (:rakuco) 2011-08-25 10:27:02 PDT
It is possible, but I would rather not do that in this patch, as it is not strictly related to this change.
Comment 4 Kenneth Rohde Christiansen 2011-09-12 15:48:15 PDT
Comment on attachment 104993 [details]
Patch

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

> Source/WebKit/efl/ewk/ewk_frame.cpp:361
> +    if ((sd->name) && (!strcmp(sd->name, cs.data())))
> +        return sd->name;

WebKit's string classes can do comparison. Please avoid using pure C methods such as strcmp.
Comment 5 Raphael Kubo da Costa (:rakuco) 2011-09-13 08:53:24 PDT
Created attachment 107181 [details]
Use operator== instead of strcmp
Comment 6 Antonio Gomes 2011-09-13 09:46:14 PDT
Comment on attachment 107181 [details]
Use operator== instead of strcmp

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

> Source/WebKit/efl/ewk/ewk_frame.cpp:357
> +    const WTF::String frameName = sd->frame->tree()->uniqueName();

nit: const here seem unusual.

> Source/WebKit/efl/ewk/ewk_frame.cpp:359
> +    if ((sd->name) && (sd->name == frameName))

nit: extra ()'s
Comment 7 WebKit Review Bot 2011-09-13 10:53:20 PDT
Comment on attachment 107181 [details]
Use operator== instead of strcmp

Clearing flags on attachment: 107181

Committed r95033: <http://trac.webkit.org/changeset/95033>
Comment 8 WebKit Review Bot 2011-09-13 10:53:25 PDT
All reviewed patches have been landed.  Closing bug.