Bug 79600 - Implement the basis of KURLWTFURL
Summary: Implement the basis of KURLWTFURL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-25 23:42 PST by Benjamin Poulain
Modified: 2012-03-03 19:49 PST (History)
1 user (show)

See Also:


Attachments
Patch (10.65 KB, patch)
2012-02-25 23:52 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (15.17 KB, patch)
2012-03-03 16:37 PST, Benjamin Poulain
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2012-02-25 23:42:51 PST
Make a not-optimized, working KURL based on WTFURL.
Comment 1 Benjamin Poulain 2012-02-25 23:52:17 PST
Created attachment 128907 [details]
Patch

Partial Implementation, no time to finish today
Comment 2 Benjamin Poulain 2012-03-03 16:37:00 PST
Created attachment 130010 [details]
Patch
Comment 3 Adam Barth 2012-03-03 17:05:48 PST
Comment on attachment 130010 [details]
Patch

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

> Source/WebCore/platform/KURLWTFURL.cpp:103
> +        DEFINE_STATIC_LOCAL(const String, nullString, ());

This shouldn't really be needed.  A null string is just a value type anyway.

> Source/WebCore/platform/KURLWTFURL.cpp:219
> +    return WebCore::protocolIs(protocol(), testProtocol);

Part of the point of this function is to avoid the malloc.  This implementation keeps the malloc...
Comment 4 Benjamin Poulain 2012-03-03 17:13:33 PST
> > Source/WebCore/platform/KURLWTFURL.cpp:103
> > +        DEFINE_STATIC_LOCAL(const String, nullString, ());
> 
> This shouldn't really be needed.  A null string is just a value type anyway.

The trouble is this function return a reference (for now) :(

> > Source/WebCore/platform/KURLWTFURL.cpp:219
> > +    return WebCore::protocolIs(protocol(), testProtocol);
> 
> Part of the point of this function is to avoid the malloc.  This implementation keeps the malloc...

This is the case for many functions here (all the hasFooBar() for example). I just went for the easiest implementation and will optimize later.

Thanks for the review Adam.
Comment 5 Benjamin Poulain 2012-03-03 19:49:30 PST
Committed r109671: <http://trac.webkit.org/changeset/109671>