2011-04-08 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2011 19:33:04 +0000 (19:33 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2011 19:33:04 +0000 (19:33 +0000)
commit604849399fffd21b8412d81a083ed22c3cdb4b69
tree98f4ffd22c87d63d3b474b8d34de9fb82af30601
parent13b2b056ab3712030a8ea255df3ac532c335ed09
2011-04-08  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin Adler.

        -[WebView setPreferences:] can take a lot of time if loading lots of webviews at once
        https://bugs.webkit.org/show_bug.cgi?id=58128
        <rdar://problem/9244553>

        The root of the problem here was an O(N^2) issue - each WebView,
        upon having its preferences initialized, would broadcast a
        notification that was listened to by all other WebViews sharing
        its preferences.

        To maintain the API contract, I split the notification into two,
        one that is for public API consumption, and the other which is for
        internal use only. Changes that don't need to be picked up by
        other WebViews broadcast the public notification only. And we
        avoid WebView broadcasting a notification just to get itself to
        update.

        * Misc/WebIconDatabase.mm:
        (-[WebIconDatabase _startUpIconDatabase]):
        (-[WebIconDatabase _shutDownIconDatabase]):
        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView viewWillMoveToWindow:]):
        (-[WebBaseNetscapePluginView viewWillMoveToSuperview:]):
        (-[WebBaseNetscapePluginView viewDidMoveToWindow]):
        (-[WebBaseNetscapePluginView viewWillMoveToHostWindow:]):
        * WebView/WebPreferences.mm:
        (-[WebPreferences initWithIdentifier:]):
        (-[WebPreferences _setStringValue:forKey:]):
        (-[WebPreferences _setIntegerValue:forKey:]):
        (-[WebPreferences _setFloatValue:forKey:]):
        (-[WebPreferences _setBoolValue:forKey:]):
        (-[WebPreferences _setLongLongValue:forKey:]):
        (-[WebPreferences _setUnsignedLongLongValue:forKey:]):
        (-[WebPreferences _postPreferencesChangedNotification]):
        (-[WebPreferences _postPreferencesChangedAPINotification]):
        * WebView/WebPreferencesPrivate.h:
        * WebView/WebView.mm:
        (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
        (-[WebView _preferencesChangedNotification:]):
        (-[WebView _preferencesChanged:]):
        (-[WebView setUsesPageCache:]):
        (+[WebView initialize]):
        (-[WebView setPreferences:]):
        (-[WebView _keyboardUIMode]):
        * WebView/WebViewInternal.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebIconDatabase.mm
Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewInternal.h