Bug 66856 - [EFL] Do not always return the cached frame name.
Summary: [EFL] Do not always return the cached frame name.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Raphael Kubo da Costa (:rakuco)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 06:56 PDT by Raphael Kubo da Costa (:rakuco)
Modified: 2011-09-13 10:53 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.90 KB, patch)
2011-08-24 06:57 PDT, Raphael Kubo da Costa (:rakuco)
no flags Details | Formatted Diff | Diff
Use operator== instead of strcmp (1.88 KB, patch)
2011-09-13 08:53 PDT, Raphael Kubo da Costa (:rakuco)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.