Bug 92857 - [BlackBerry] Favicon should be Base64 encoded for cross-process passing
Summary: [BlackBerry] Favicon should be Base64 encoded for cross-process passing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Charles Wei
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-01 02:34 PDT by Charles Wei
Modified: 2012-08-01 20:56 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.10 KB, patch)
2012-08-01 04:44 PDT, Charles Wei
no flags Details | Formatted Diff | Diff
Patch (4.04 KB, patch)
2012-08-01 20:11 PDT, Charles Wei
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Wei 2012-08-01 02:34:08 PDT
Internal tracking No. 186242

Favicon should be Base64 encoded for cross-process passing to Chrome which is in another process.
Comment 1 Charles Wei 2012-08-01 04:44:25 PDT
Created attachment 155780 [details]
Patch
Comment 2 Yong Li 2012-08-01 07:13:03 PDT
Comment on attachment 155780 [details]
Patch

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

r+ otherwise

> Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp:1193
> +    if (!bitmap->bitmap().empty()) {

early return looks better.

> Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp:1205
> +        Vector<char> out;
> +        base64Encode(static_cast<const char*>(data->data()), data->size(), out);
> +        char* buffer = new char[out.size() + 1];
> +        memcpy(buffer, out.data(), out.size());
> +        buffer[out.size()] = '\0';

out.append('\0') should work, so no need to create a new buffer and memcpy?

> Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp:1208
> +        delete []buffer;

"delete[] buffer;" is more clear, if we do need this buffer. From my point of view, Vector<char> always beats new[]/delete[]
Comment 3 George Staikos 2012-08-01 08:02:03 PDT
Comment on attachment 155780 [details]
Patch

I agree with your comments on the buffer and had this chat with Charles earlier today.  r- for these comments in fact.
Comment 4 Charles Wei 2012-08-01 20:11:27 PDT
Created attachment 155957 [details]
Patch
Comment 5 George Staikos 2012-08-01 20:19:06 PDT
Comment on attachment 155957 [details]
Patch

Better
Comment 6 Charles Wei 2012-08-01 20:47:08 PDT
Comment on attachment 155957 [details]
Patch

Thanks, George and Yong, for the comments.
Comment 7 WebKit Review Bot 2012-08-01 20:55:57 PDT
Comment on attachment 155957 [details]
Patch

Clearing flags on attachment: 155957

Committed r124403: <http://trac.webkit.org/changeset/124403>
Comment 8 WebKit Review Bot 2012-08-01 20:56:01 PDT
All reviewed patches have been landed.  Closing bug.