Bug 74383 - Upstream PlatformMouseEvent and LocalizedStrings into WebCore/platform/blackberry
Summary: Upstream PlatformMouseEvent and LocalizedStrings into WebCore/platform/blackb...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 73144
  Show dependency treegraph
 
Reported: 2011-12-13 00:03 PST by Mary Wu
Modified: 2011-12-20 23:36 PST (History)
4 users (show)

See Also:


Attachments
Patch (16.80 KB, patch)
2011-12-13 00:31 PST, Mary Wu
no flags Details | Formatted Diff | Diff
Patch (16.86 KB, patch)
2011-12-13 18:02 PST, Mary Wu
no flags Details | Formatted Diff | Diff
Patch (16.85 KB, patch)
2011-12-14 00:20 PST, Mary Wu
no flags Details | Formatted Diff | Diff
Patch (16.84 KB, patch)
2011-12-14 22:44 PST, Mary Wu
no flags Details | Formatted Diff | Diff
Patch (15.58 KB, patch)
2011-12-20 19:15 PST, Mary Wu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mary Wu 2011-12-13 00:03:22 PST
Upstream PlatformMouseEvent and LocalizedString into WebCore/platform/blackberry: 
LocalizedStringsBlackBerry.cpp, PlatformMouseEventBlackBerry.cpp
Comment 1 Mary Wu 2011-12-13 00:31:03 PST
Created attachment 118968 [details]
Patch
Comment 2 Rob Buis 2011-12-13 05:20:58 PST
Comment on attachment 118968 [details]
Patch

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

> Source/WebCore/ChangeLog:10
> +        Rob Buis  <rbuis@rim.com>

I think there were more contributors, for instance I dont think I touched PlatformMouseEvent.

> Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp:72
> +    // however, WebCore wants a '-' (e.g. en_us should read en-us)

Comment should be a sentence.

> Source/WebCore/platform/blackberry/PlatformMouseEventBlackBerry.cpp:36
> +    , m_timestamp(WTF::currentTime())

Is the WTF prefix needed?
Comment 3 Rob Buis 2011-12-13 05:21:58 PST
Comment on attachment 118968 [details]
Patch

Clearing r? flag for now, see my comments.
Comment 4 Mary Wu 2011-12-13 18:02:43 PST
Created attachment 119125 [details]
Patch
Comment 5 Daniel Bates 2011-12-13 18:30:51 PST
Comment on attachment 119125 [details]
Patch

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

> Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp:24
> +

Nit: I suggest that we remove this empty line as I don't feel it improves the readability of this file.

> Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp:68
> +String platformDefaultLanguage()

Would it make sense to re-write this function using WTF::String functions instead of using the std::string routines? That is, can we just convert BlackBerry::Platform::Client::get()->getLocale() to a WTF::String then manipulate it as as such? I suggest taking this approach since the WTF::String functions tend to be a bit more concise and at the end of the day we want to return a WTF::String.

> Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp:71
> +    // getLocale() returns a POSIX lcoale which uses '_' to separate language and country

lcoale => locale.

country => country.

> Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp:72
> +    // however, we use '-' instead of '_' in WebCore (e.g. en_us should read en-us)

however => However

Missing period at the end of this line.
Comment 6 Mary Wu 2011-12-14 00:20:55 PST
Created attachment 119170 [details]
Patch
Comment 7 Mary Wu 2011-12-14 22:44:16 PST
Created attachment 119381 [details]
Patch
Comment 8 Daniel Bates 2011-12-15 19:18:20 PST
Comment on attachment 119381 [details]
Patch

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

Thanks Mary for updating the patch. Notice that most of these these methods build a WTF::String object from a C-string. We should probably leak the WTF::String objects if these methods are called frequently instead of building a WTF::String object on each method call.

> Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp:587
> +}

Do we need to use String::fromUTF8 here? It seems like it would be sufficient to write this as:

return String(", ...");
Comment 9 Daniel Bates 2011-12-15 19:20:13 PST
Comment on attachment 119381 [details]
Patch

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

> Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp:586
> +    return String::fromUTF8(", ...");

I meant to add the "return String(", ...");" remark to this line.
Comment 10 Mary Wu 2011-12-15 23:51:34 PST
(In reply to comment #8)
> (From update of attachment 119381 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=119381&action=review
> 
> Thanks Mary for updating the patch. Notice that most of these these methods build a WTF::String object from a C-string. We should probably leak the WTF::String objects if these methods are called frequently instead of building a WTF::String object on each method call.
> 


yes, thanks for the comments...those are used in file buttons and context menu which we seldom used, and looks other portings didn't leak WTF::String objects either. So I think maybe we could keep it is here for now.
Comment 11 Mary Wu 2011-12-20 19:15:40 PST
Created attachment 120135 [details]
Patch
Comment 12 Daniel Bates 2011-12-20 20:42:57 PST
Comment on attachment 120135 [details]
Patch

Thanks for the updated patch.
Comment 13 WebKit Review Bot 2011-12-20 23:36:44 PST
Comment on attachment 120135 [details]
Patch

Clearing flags on attachment: 120135

Committed r103391: <http://trac.webkit.org/changeset/103391>
Comment 14 WebKit Review Bot 2011-12-20 23:36:49 PST
All reviewed patches have been landed.  Closing bug.