WebKit:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Dec 2008 21:40:36 +0000 (21:40 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Dec 2008 21:40:36 +0000 (21:40 +0000)
commit626adfb0ff68ae50400b96928d8dfef2d9f56172
tree1e04a14a4ffaad12d061387982802351b2c5301c
parenta2e0c7fa58d479b4ff9712d94f39d391d7c02752
WebKit:

2008-12-23  Darin Adler  <darin@apple.com>

        Reviewed by Alexey Proskuryakov.

        - fix https://bugs.webkit.org/show_bug.cgi?id=22976
          crash due to Mail's use of WebArchive and WebResource on non-main thread

        * StringsNotToBeLocalized.txt: Updated.

        * WebKit.xcodeproj/project.pbxproj: Added new file WebNSObjectExtras.mm and
        existing file WebResourceInternal.h.

WebKit/mac:

2008-12-23  Darin Adler  <darin@apple.com>

        Reviewed by Alexey Proskuryakov (a slightly earlier version).

        - fix https://bugs.webkit.org/show_bug.cgi?id=22976
          crash due to Mail's use of WebArchive and WebResource on non-main thread

        * Misc/WebKitLogging.h: Improved comments for ASSERT_MAIN_THREAD. Got rid of
        WebKitRunningOnMainThread function, which was just a cover for pthread_main_np.
        * Misc/WebKitLogging.m: Ditto.

        * Misc/WebKitVersionChecks.h: Added a version after which we won't do the
        main thread workaround.

        * Misc/WebNSObjectExtras.h: Added a new method, _webkit_getPropertyOnMainThread:,
        which performs a selector on the main thread, waits for it to complete, and then
        returns the value on the caller thread.
        * Misc/WebNSObjectExtras.mm: Added.

        * WebView/WebArchive.mm:
        (-[WebArchive init]): Added WebCoreThreadViolationCheck.
        (-[WebArchive initWithMainResource:subresources:subframeArchives:]): Perform
        initialization on main thread if needMailThreadWorkaround is true.
        Also added WebCoreThreadViolationCheck.
        (-[WebArchive initWithData:]): Added WebCoreThreadViolationCheck.
        (-[WebArchive mainResource]): Get property on main thread if
        needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck.
        (-[WebArchive subresources]): Ditto.
        (-[WebArchive subframeArchives]): Ditto.
        (-[WebArchive data]): Ditto.
        (-[WebArchive _initWithCoreLegacyWebArchive:]): Added WebCoreThreadViolationCheck.
        (-[WebArchive _coreLegacyWebArchive]): Ditto.
        (-[WebArchive _initWithArguments:]): Added. Used to implement the cross-thread
        version of initWithMainResource above.

        * WebView/WebResource.mm:
        (-[WebResource initWithCoder:]): Added WebCoreThreadViolationCheck.
        (-[WebResource data]): Get property on main thread if
        needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck.
        (-[WebResource URL]): Ditto.
        (-[WebResource MIMEType]): Ditto.
        (-[WebResource textEncodingName]): Ditto.
        (-[WebResource frameName]): Ditto.
        (-[WebResource _ignoreWhenUnarchiving]): Ditto.
        (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]):
        Perform initialization on main thread if needMailThreadWorkaround is true.
        Also added WebCoreThreadViolationCheck.
        (-[WebResource _suggestedFilename]): Added. Helper for _fileWrapperRepresentation.
        (-[WebResource _fileWrapperRepresentation]): Rewrote to use methods instead of
        getting at coreResource directly.
        (-[WebResource _response]): Get property on main thread if
        needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck.
        (-[WebResource _stringValue]): Ditto.
        (+[WebResource _needMailThreadWorkaroundIfCalledOffMainThread]): Added.
        (-[WebResource _initWithArguments:]): Added. Used to implement the cross-thread
        version of _initWithData above.

        * WebView/WebResourceInternal.h: Changed to include WebResourcePrivate.h since internal
        clients have access to the SPI as well as the API. Added definition of MAIL_THREAD_WORKAROUND
        and the needMainThreadWorkaround helper function.

        * Misc/WebIconDatabase.mm: Removed include of now-defunct FoundationExtras.h
        file. This probably fixes clean builds.
        * WebCoreSupport/WebIconDatabaseClient.mm: Ditto.

        * WebCoreSupport/WebFrameLoaderClient.mm: Removed include of WebResourcePrivate.h,
        since it's not actually used.
        * WebView/WebDataSource.mm: Ditto.
        * WebView/WebHTMLRepresentation.mm: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
WebKit/ChangeLog
WebKit/StringsNotToBeLocalized.txt
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/mac/ChangeLog
WebKit/mac/Misc/WebIconDatabase.mm
WebKit/mac/Misc/WebKitLogging.h
WebKit/mac/Misc/WebKitLogging.m
WebKit/mac/Misc/WebKitVersionChecks.h
WebKit/mac/Misc/WebNSObjectExtras.h
WebKit/mac/Misc/WebNSObjectExtras.mm [new file with mode: 0644]
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm
WebKit/mac/WebView/WebArchive.mm
WebKit/mac/WebView/WebDataSource.mm
WebKit/mac/WebView/WebHTMLRepresentation.mm
WebKit/mac/WebView/WebResource.mm
WebKit/mac/WebView/WebResourceInternal.h