Bug 58128

Summary: -[WebView setPreferences:] can take a lot of time if loading lots of webviews at once
Product: WebKit Reporter: Maciej Stachowiak <mjs>
Component: New BugsAssignee: Maciej Stachowiak <mjs>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch darin: review+

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>