Bug 58128 - -[WebView setPreferences:] can take a lot of time if loading lots of webviews at once
Summary: -[WebView setPreferences:] can take a lot of time if loading lots of webviews...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-08 02:58 PDT by Maciej Stachowiak
Modified: 2011-04-08 12:33 PDT (History)
0 users

See Also:


Attachments
Patch (17.59 KB, patch)
2011-04-08 03:01 PDT, Maciej Stachowiak
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2011-04-08 02:58:08 PDT
-[WebView setPreferences:] can take a lot of time if loading lots of webviews at once
Comment 1 Maciej Stachowiak 2011-04-08 03:01:11 PDT
Created attachment 88788 [details]
Patch
Comment 2 Darin Adler 2011-04-08 10:17:45 PDT
Comment on attachment 88788 [details]
Patch

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

> Source/WebKit/mac/WebView/WebPreferences.mm:1189
> +    [[NSNotificationCenter defaultCenter]
> +        postNotificationName:WebPreferencesChangedInternalNotification object:self
> +                    userInfo:nil];
> +    [[NSNotificationCenter defaultCenter]
> +        postNotificationName:WebPreferencesChangedNotification object:self
> +                    userInfo:nil];

I don’t like lining these up. Probably would read better all on one line.

> Source/WebKit/mac/WebView/WebPreferencesPrivate.h:54
> +extern NSString *WebPreferencesChangedInternalNotification;

If this is an internal notification then it should probably be in an internal header, not a private header.

> Source/WebKit/mac/WebView/WebPreferencesPrivate.h:215
> -- (void)_postPreferencesChangesNotification;
> +- (void)_postPreferencesChangedNotification;
> +- (void)_postPreferencesChangedAPINotification;

If these are private methods they may be used in applications that make use of SPI. Can we really rename them safely?

If these are internal methods they should be in an internal header, not a private one.
Comment 3 Maciej Stachowiak 2011-04-08 11:46:14 PDT
(In reply to comment #2)
> (From update of attachment 88788 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=88788&action=review
> 
> > Source/WebKit/mac/WebView/WebPreferences.mm:1189
> > +    [[NSNotificationCenter defaultCenter]
> > +        postNotificationName:WebPreferencesChangedInternalNotification object:self
> > +                    userInfo:nil];
> > +    [[NSNotificationCenter defaultCenter]
> > +        postNotificationName:WebPreferencesChangedNotification object:self
> > +                    userInfo:nil];
> 
> I don’t like lining these up. Probably would read better all on one line.

I just copied what the code was already doing. But I agree, will make it one line.

> 
> > Source/WebKit/mac/WebView/WebPreferencesPrivate.h:54
> > +extern NSString *WebPreferencesChangedInternalNotification;
> 
> If this is an internal notification then it should probably be in an internal header, not a private header.
> 
> > Source/WebKit/mac/WebView/WebPreferencesPrivate.h:215
> > -- (void)_postPreferencesChangesNotification;
> > +- (void)_postPreferencesChangedNotification;
> > +- (void)_postPreferencesChangedAPINotification;
> 
> If these are private methods they may be used in applications that make use of SPI. Can we really rename them safely?
> 
> If these are internal methods they should be in an internal header, not a private one.

There isn't currently a WebPreferencesInternal.h header, and existing internal (rather than private) methods are in the private header. Should I factor out an Internal header as part of this change, or separately?
Comment 4 Maciej Stachowiak 2011-04-08 12:33:11 PDT
Committed r83324: <http://trac.webkit.org/changeset/83324>