Bug 91511 - [Mac] Make WebDataSourcePrivate lighter
Summary: [Mac] Make WebDataSourcePrivate lighter
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-07-17 10:00 PDT by Benjamin Poulain
Modified: 2012-08-05 21:18 PDT (History)
0 users

See Also:


Attachments
Patch (8.72 KB, patch)
2012-07-17 10:24 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (10.00 KB, patch)
2012-07-17 15:40 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (10.00 KB, patch)
2012-07-17 16:32 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (10.07 KB, patch)
2012-07-17 18:41 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (16.60 KB, patch)
2012-07-18 16:37 PDT, Benjamin Poulain
andersca: 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-07-17 10:00:34 PDT
Improving WebPreferencesPrivate initialization had a nice outcome.
Should WebDataSourcePrivate follow the same path?
Comment 1 Benjamin Poulain 2012-07-17 10:24:17 PDT
Created attachment 152778 [details]
Patch
Comment 2 Benjamin Poulain 2012-07-17 15:40:22 PDT
Created attachment 152853 [details]
Patch
Comment 3 Build Bot 2012-07-17 15:49:30 PDT
Comment on attachment 152853 [details]
Patch

Attachment 152853 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13280277
Comment 4 Benjamin Poulain 2012-07-17 16:32:03 PDT
Created attachment 152871 [details]
Patch
Comment 5 Build Bot 2012-07-17 17:00:34 PDT
Comment on attachment 152871 [details]
Patch

Attachment 152871 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13282294
Comment 6 Benjamin Poulain 2012-07-17 18:41:29 PDT
Created attachment 152899 [details]
Patch
Comment 7 Benjamin Poulain 2012-07-17 22:47:46 PDT
Comment on attachment 152899 [details]
Patch

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

> Source/WebKit/mac/WebView/WebDataSource.mm:129
> +    JSC::initializeThreading();
> +    WTF::initializeMainThreadToProcessMainThread();
> +    WebCore::RunLoop::initializeMainRunLoop();
> +    WebCoreObjCFinalizeOnMainThread(self);

Joe:

if (self != [XXX class])
    return;
Comment 8 Anders Carlsson 2012-07-18 13:43:33 PDT
Comment on attachment 152899 [details]
Patch

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

> Source/WebKit/mac/WebView/WebDataSource.h:40
> +typedef struct WebDataSourcePrivate WebDataSourcePrivate;

I think other classes (in other frameworks) just use void * for internal classes. I like that better.

> Source/WebKit/mac/WebView/WebDataSource.mm:70
> +struct WebDataSourcePrivate

And then you could make this a proper class which is nicer :)
Comment 9 Benjamin Poulain 2012-07-18 16:37:01 PDT
Created attachment 153139 [details]
Patch
Comment 10 Anders Carlsson 2012-07-18 16:54:29 PDT
Comment on attachment 153139 [details]
Patch

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

> Source/WebKit/mac/WebView/WebDataSource.mm:93
> +static inline WebDataSourcePrivate* castPrivate(void* privateAttribute)
>  {

We usually call these cast functions "toFoo" so toPrivate(void* ptr) would be better here.
Comment 11 Benjamin Poulain 2012-07-18 18:19:56 PDT
Committed r123057: <http://trac.webkit.org/changeset/123057>
Comment 12 Benjamin Poulain 2012-07-18 22:21:33 PDT
<rdar://problem/11909640>
Comment 13 Joseph Pecoraro 2012-08-05 21:18:34 PDT
Comment on attachment 153139 [details]
Patch

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

> Source/WebKit/mac/WebView/WebDataSource.mm:77
> +    WebDataSourcePrivate(PassRefPtr<WebDocumentLoaderMac> loader)
> +        : loader(loader)
> +    {
> +        ASSERT(this->loader);
> +    }

Looks like this missed initializing the BOOL members.