Commit a1d52ddf authored by thatcher's avatar thatcher

WebCore:

        Reviewed by Darin.

        <rdar://problem/4900579> WebKit -finalize methods are not thread-safe; design change needed

        Call WebCoreObjCFinalizeOnMainThread from the initialize method of all the classes
        that have a finalizer that needs called on the main thread.

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/WebScriptObject.mm:
        (+[WebScriptObject initialize]):
        * bridge/mac/WebCoreScriptDebugger.mm:
        (+[WebCoreScriptDebugger initialize]):
        * platform/mac/SharedBufferMac.mm:
        (+[SharedBufferData initialize]):
        * platform/mac/WebCoreObjCExtras.c: Added.
        (WebCoreObjCFinalizeOnMainThread):
        * platform/mac/WebCoreObjCExtras.h: Added.

WebKit:

        Reviewed by Darin.

        <rdar://problem/4900579> WebKit -finalize methods are not thread-safe; design change needed

        Call WebCoreObjCFinalizeOnMainThread from the initialize method of all the classes
        that have a finalizer that needs called on the main thread. Assert in finalize that we
        are on the main thread.

        * Carbon/CarbonWindowAdapter.m:
        (+[CarbonWindowAdapter initialize]):
        (-[CarbonWindowAdapter finalize]):
        * History/WebBackForwardList.mm:
        (+[WebBackForwardList initialize]):
        (-[WebBackForwardList finalize]):
        * History/WebHistoryItem.mm:
        (+[WebHistoryItem initialize]):
        * Misc/WebElementDictionary.mm:
        (+[WebElementDictionary initialize]):
        (-[WebElementDictionary finalize]):
        * Plugins/WebBaseNetscapePluginStream.m:
        (+[WebBaseNetscapePluginStream initialize]):
        (-[WebBaseNetscapePluginStream finalize]):
        * Plugins/WebBaseNetscapePluginView.mm:
        (+[WebBaseNetscapePluginView initialize]):
        (-[WebBaseNetscapePluginView finalize]):
        * Plugins/WebBasePluginPackage.m:
        (+[WebBasePluginPackage initialize]):
        (-[WebBasePluginPackage finalize]):
        * Plugins/WebNetscapePluginStream.mm:
        (-[WebNetscapePluginStream finalize]):
        * WebCoreSupport/WebEditorClient.mm:
        (+[WebEditCommand initialize]):
        (-[WebEditCommand finalize]):
        * WebCoreSupport/WebFrameBridge.mm:
        (+[WebFrameBridge initialize]):
        (-[WebFrameBridge finalize]):
        * WebCoreSupport/WebFrameLoaderClient.mm:
        (+[WebFramePolicyListener initialize]):
        (-[WebFramePolicyListener finalize]):
        * WebView/WebHTMLView.mm:
        (+[WebHTMLView initialize]):
        (-[WebHTMLView finalize]):
        * WebView/WebView.mm:
        (+[WebViewPrivate initialize]):
        (-[WebViewPrivate finalize]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 11ee43cf
2007-02-20 Timothy Hatcher <timothy@apple.com>
Reviewed by Darin.
<rdar://problem/4900579> WebKit -finalize methods are not thread-safe; design change needed
Call WebCoreObjCFinalizeOnMainThread from the initialize method of all the classes
that have a finalizer that needs called on the main thread.
* WebCore.exp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/WebScriptObject.mm:
(+[WebScriptObject initialize]):
* bridge/mac/WebCoreScriptDebugger.mm:
(+[WebCoreScriptDebugger initialize]):
* platform/mac/SharedBufferMac.mm:
(+[SharedBufferData initialize]):
* platform/mac/WebCoreObjCExtras.c: Added.
(WebCoreObjCFinalizeOnMainThread):
* platform/mac/WebCoreObjCExtras.h: Added.
2007-02-20 Geoffrey Garen <ggaren@apple.com>
Not not reviewed by Mitz Pettel.
......
......@@ -118,6 +118,7 @@
.objc_class_name_WebUndefined
_WebCoreDrawTextAtPoint
_WebCoreFindFont
_WebCoreObjCFinalizeOnMainThread
_WebCorePageCacheStateKey
_WebCoreSetAlwaysUseATSU
_WebCoreSetShouldUseFontSmoothing
......
......@@ -2860,6 +2860,8 @@
D23CA56C0AB0EB8D005108A5 /* RangeException.h in Headers */ = {isa = PBXBuildFile; fileRef = D23CA56B0AB0EB8D005108A5 /* RangeException.h */; };
DB23C2CB0A508D29002489EB /* IndentOutdentCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DB23C2C90A508D29002489EB /* IndentOutdentCommand.cpp */; };
DB23C2CC0A508D29002489EB /* IndentOutdentCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = DB23C2CA0A508D29002489EB /* IndentOutdentCommand.h */; };
DD05FE0D0B8BA3C6009ACDFE /* WebCoreObjCExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = DD05FE0B0B8BA3C6009ACDFE /* WebCoreObjCExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
DD05FE0E0B8BA3C6009ACDFE /* WebCoreObjCExtras.c in Sources */ = {isa = PBXBuildFile; fileRef = DD05FE0C0B8BA3C6009ACDFE /* WebCoreObjCExtras.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
DD763BB20992C2C900740B8E /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DD763BB10992C2C900740B8E /* libxml2.dylib */; };
DD7CDF250A23CF9800069928 /* CSSUnknownRule.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CCE0A1989CA007FB8C5 /* CSSUnknownRule.h */; };
DDE63ED50B7D45A800226998 /* DOMTextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A14750B7D1BAF00A53FFD /* DOMTextEvent.h */; };
......@@ -6050,6 +6052,8 @@
D23CA56B0AB0EB8D005108A5 /* RangeException.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RangeException.h; sourceTree = "<group>"; };
DB23C2C90A508D29002489EB /* IndentOutdentCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IndentOutdentCommand.cpp; sourceTree = "<group>"; };
DB23C2CA0A508D29002489EB /* IndentOutdentCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IndentOutdentCommand.h; sourceTree = "<group>"; };
DD05FE0B0B8BA3C6009ACDFE /* WebCoreObjCExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreObjCExtras.h; sourceTree = "<group>"; };
DD05FE0C0B8BA3C6009ACDFE /* WebCoreObjCExtras.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = WebCoreObjCExtras.c; sourceTree = "<group>"; };
DD763BB10992C2C900740B8E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomXPathNSResolver.h; sourceTree = "<group>"; };
E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomXPathNSResolver.cpp; sourceTree = "<group>"; };
......@@ -6869,6 +6873,8 @@
F5517DC3031AB56301A80180 /* WebCoreHistory.m */,
84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */,
84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */,
DD05FE0B0B8BA3C6009ACDFE /* WebCoreObjCExtras.h */,
DD05FE0C0B8BA3C6009ACDFE /* WebCoreObjCExtras.c */,
93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */,
93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */,
BC066F6C09FEB2FA00C589A7 /* WebCoreTextRenderer.h */,
......@@ -11135,6 +11141,7 @@
933A14B90B7D1D5200A53FFD /* JSTextEvent.h in Headers */,
DDE63ED50B7D45A800226998 /* DOMTextEvent.h in Headers */,
37919C240B7D188600A56998 /* PositionIterator.h in Headers */,
DD05FE0D0B8BA3C6009ACDFE /* WebCoreObjCExtras.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -11172,6 +11179,7 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
......@@ -11186,6 +11194,7 @@
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
shouldCheckCompatibility = 1;
targets = (
93F198A508245E59001E9ABC /* WebCore */,
DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
......@@ -12497,6 +12506,7 @@
A7CFB3D10B7ED10A0070C32D /* DragImage.cpp in Sources */,
A7CFB3D50B7ED1180070C32D /* DragImageMac.mm in Sources */,
37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */,
DD05FE0E0B8BA3C6009ACDFE /* WebCoreObjCExtras.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -27,6 +27,7 @@
#import "WebScriptObjectPrivate.h"
#import "DOMInternal.h"
#import "WebCoreObjCExtras.h"
#import <JavaScriptCore/context.h>
#import <JavaScriptCore/objc_instance.h>
#import <JavaScriptCore/runtime_object.h>
......@@ -44,6 +45,13 @@ using namespace KJS::Bindings;
@implementation WebScriptObject
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
static void _didExecute(WebScriptObject *obj)
{
if (![obj _rootObject] || ![obj _rootObject]->isValid())
......
......@@ -32,6 +32,7 @@
#import "DeprecatedString.h"
#import "KURL.h"
#import "PlatformString.h"
#import "WebCoreObjCExtras.h"
#import "WebScriptObjectPrivate.h"
#import <JavaScriptCore/context.h>
#import <JavaScriptCore/debugger.h>
......@@ -145,6 +146,13 @@ class WebCoreScriptDebuggerImp : public KJS::Debugger {
@implementation WebCoreScriptDebugger
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
- (WebCoreScriptDebugger *)initWithDelegate:(id<WebScriptDebugger>)delegate
{
if ((self = [super init])) {
......
......@@ -25,6 +25,7 @@
#include "config.h"
#include "SharedBuffer.h"
#include "WebCoreObjCExtras.h"
#include <string.h>
#include <wtf/PassRefPtr.h>
......@@ -40,6 +41,13 @@ using namespace WebCore;
@implementation SharedBufferData
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
- (void)dealloc
{
sharedBuffer->deref();
......
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "WebCoreObjCExtras.h"
#include <objc/objc-auto.h>
void WebCoreObjCFinalizeOnMainThread(Class cls)
{
#if !defined(BUILDING_ON_TIGER) && !defined(DONT_FINALIZE_ON_MAIN_THREAD)
objc_finalizeOnMainThread(cls);
#endif
}
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <objc/objc.h>
#ifdef __cplusplus
extern "C" {
#endif
void WebCoreObjCFinalizeOnMainThread(Class cls);
#ifdef __cplusplus
}
#endif
......@@ -70,6 +70,9 @@
#import <HIToolbox/HIView.h>
#import <assert.h>
#import <WebCore/WebCoreObjCExtras.h>
#import "WebKitLogging.h"
#import "WebNSObjectExtras.h"
#import "WebTypesInternal.h"
......@@ -260,6 +263,13 @@ - (void)setViewsNeedDisplay:(BOOL)wellDoThey {
}
}
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
// Given a reference to a Carbon window that is to be encapsulated, and an indicator of whether or not this object should take responsibility for disposing of the Carbon window, initialize.
- (id)initWithCarbonWindowRef:(WindowRef)inWindowRef takingOwnership:(BOOL)inWindowRefIsOwned {
// for now, set disableOrdering to YES because that is what we've been doing and is therefore lower risk. However, I think it would be correct to set it to NO.
......@@ -280,6 +290,7 @@ - (void)dealloc {
}
- (void)finalize {
ASSERT_MAIN_THREAD();
if (_eventHandler) RemoveEventHandler(_eventHandler);
[super finalize];
}
......
2007-02-20 Timothy Hatcher <timothy@apple.com>
Reviewed by Darin.
<rdar://problem/4900579> WebKit -finalize methods are not thread-safe; design change needed
Call WebCoreObjCFinalizeOnMainThread from the initialize method of all the classes
that have a finalizer that needs called on the main thread. Assert in finalize that we
are on the main thread.
* Carbon/CarbonWindowAdapter.m:
(+[CarbonWindowAdapter initialize]):
(-[CarbonWindowAdapter finalize]):
* History/WebBackForwardList.mm:
(+[WebBackForwardList initialize]):
(-[WebBackForwardList finalize]):
* History/WebHistoryItem.mm:
(+[WebHistoryItem initialize]):
* Misc/WebElementDictionary.mm:
(+[WebElementDictionary initialize]):
(-[WebElementDictionary finalize]):
* Plugins/WebBaseNetscapePluginStream.m:
(+[WebBaseNetscapePluginStream initialize]):
(-[WebBaseNetscapePluginStream finalize]):
* Plugins/WebBaseNetscapePluginView.mm:
(+[WebBaseNetscapePluginView initialize]):
(-[WebBaseNetscapePluginView finalize]):
* Plugins/WebBasePluginPackage.m:
(+[WebBasePluginPackage initialize]):
(-[WebBasePluginPackage finalize]):
* Plugins/WebNetscapePluginStream.mm:
(-[WebNetscapePluginStream finalize]):
* WebCoreSupport/WebEditorClient.mm:
(+[WebEditCommand initialize]):
(-[WebEditCommand finalize]):
* WebCoreSupport/WebFrameBridge.mm:
(+[WebFrameBridge initialize]):
(-[WebFrameBridge finalize]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(+[WebFramePolicyListener initialize]):
(-[WebFramePolicyListener finalize]):
* WebView/WebHTMLView.mm:
(+[WebHTMLView initialize]):
(-[WebHTMLView finalize]):
* WebView/WebView.mm:
(+[WebViewPrivate initialize]):
(-[WebViewPrivate finalize]):
2007-02-20 Justin Garcia <justin.garcia@apple.com>
Reviewed by darin
......
......@@ -40,6 +40,7 @@
#import <WebCore/BackForwardList.h>
#import <WebCore/HistoryItem.h>
#import <WebCore/RetainPtr.h>
#import <WebCore/WebCoreObjCExtras.h>
#define COMPUTE_DEFAULT_PAGE_CACHE_SIZE UINT_MAX
......@@ -111,6 +112,13 @@ WebBackForwardList *kit(BackForwardList* list)
@implementation WebBackForwardList
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
- (id)init
{
self = [super init];
......@@ -139,6 +147,7 @@ WebBackForwardList *kit(BackForwardList* list)
- (void)finalize
{
ASSERT_MAIN_THREAD();
BackForwardList* coreList = core(_private);
ASSERT(coreList->closed());
backForwardListWrappers().remove(coreList);
......
......@@ -48,6 +48,7 @@
#import <WebCore/KURL.h>
#import <WebCore/PageState.h>
#import <WebCore/PlatformString.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebKitSystemInterface.h>
// Private keys used in the WebHistoryItem's dictionary representation.
......@@ -81,6 +82,13 @@ void WKNotifyHistoryItemChanged()
@implementation WebHistoryItem
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
- (id)init
{
return [self initWithWebCoreHistoryItem:(new HistoryItem)];
......
......@@ -32,6 +32,7 @@
#import "WebFrame.h"
#import "WebFrameBridge.h"
#import "WebFrameInternal.h"
#import "WebKitLogging.h"
#import "WebView.h"
#import "WebViewPrivate.h"
......@@ -41,6 +42,7 @@
#import <WebCore/HitTestResult.h>
#import <WebCore/Image.h>
#import <WebCore/KURL.h>
#import <WebCore/WebCoreObjCExtras.h>
using namespace WebCore;
......@@ -59,6 +61,13 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
@implementation WebElementDictionary
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
+ (void)initializeLookupTable
{
if (lookupTable)
......@@ -101,6 +110,7 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
- (void)finalize
{
ASSERT_MAIN_THREAD();
delete _result;
[super finalize];
}
......
......@@ -36,6 +36,8 @@
#import <WebKit/WebNSURLExtras.h>
#import <WebKitSystemInterface.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <Foundation/NSURLResponse.h>
static char *CarbonPathFromPOSIXPath(const char *posixPath);
......@@ -44,6 +46,13 @@
@implementation WebBaseNetscapePluginStream
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
+ (NPReason)reasonForError:(NSError *)error
{
if (error == nil) {
......@@ -125,6 +134,7 @@ - (void)dealloc
- (void)finalize
{
ASSERT_MAIN_THREAD();
ASSERT(isTerminated);
ASSERT(stream.ndata == nil);
......
......@@ -56,6 +56,7 @@
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameTree.h>
#import <WebCore/Page.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebKit/DOMPrivate.h>
#import <WebKit/WebUIDelegate.h>
#import <WebKitSystemInterface.h>
......@@ -149,6 +150,9 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
+ (void)initialize
{
#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
#endif
WKSendUserChangeNotifications();
}
......@@ -1530,6 +1534,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
- (void)finalize
{
ASSERT_MAIN_THREAD();
ASSERT(!isStarted);
[self freeAttributeKeysAndValues];
......
......@@ -33,9 +33,11 @@
#import <WebKit/WebNetscapePluginPackage.h>
#import <WebKit/WebNSObjectExtras.h>
#import <WebKit/WebPluginPackage.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebKitSystemInterface.h>
#import "WebKitLogging.h"
#import "WebTypesInternal.h"
#import <mach-o/arch.h>
......@@ -54,6 +56,13 @@ - (NSArray *)_web_lowercaseStrings;
@implementation WebBasePluginPackage
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
+ (WebBasePluginPackage *)pluginWithPath:(NSString *)pluginPath
{
WebBasePluginPackage *pluginPackage = [[WebPluginPackage alloc] initWithPath:pluginPath];
......@@ -248,6 +257,7 @@ - (void)dealloc
- (void)finalize
{
ASSERT_MAIN_THREAD();
ASSERT(!pluginDatabases || [pluginDatabases count] == 0);
[pluginDatabases release];
......
......@@ -42,12 +42,20 @@
#import <WebKit/WebNetscapePluginPackage.h>
#import <WebKit/WebViewInternal.h>
#import <WebCore/ResourceError.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <wtf/PassRefPtr.h>
using namespace WebCore;
@implementation WebNetscapePluginStream
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
- initWithRequest:(NSURLRequest *)theRequest
plugin:(NPP)thePlugin
notifyData:(void *)theNotifyData
......@@ -90,6 +98,7 @@ using namespace WebCore;
- (void)finalize
{
ASSERT_MAIN_THREAD();
if (_loader)
_loader->deref();
[super finalize];
......
......@@ -51,6 +51,7 @@
#import <WebCore/KeyboardEvent.h>
#import <WebCore/PlatformKeyboardEvent.h>
#import <WebCore/PlatformString.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <wtf/PassRefPtr.h>
using namespace WebCore;
......@@ -80,6 +81,13 @@ WebViewInsertAction kit(EditorInsertAction coreAction)
@implementation WebEditCommand
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
- (id)initWithEditCommand:(PassRefPtr<WebCore::EditCommand>)command
{
ASSERT(command);
......@@ -96,6 +104,7 @@ WebViewInsertAction kit(EditorInsertAction coreAction)
- (void)finalize
{
ASSERT_MAIN_THREAD();
m_command->deref();
[super finalize];
}
......
......@@ -91,6 +91,7 @@
#import <WebCore/Page.h>
#import <WebCore/ResourceLoader.h>
#import <WebCore/SubresourceLoader.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebKitSystemInterface.h>
#import <wtf/RefPtr.h>
#import <WebCore/MimeTypeRegistry.h>
......@@ -120,6 +121,13 @@ NSString *WebPluginContainerKey = @"WebPluginContainer";
@implementation WebFrameBridge
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
- (WebView *)webView
{
if (!m_frame)
......@@ -189,6 +197,7 @@ NSString *WebPluginContainerKey = @"WebPluginContainer";
- (void)finalize
{
ASSERT_MAIN_THREAD();
[self fini];
[super finalize];
}
......
......@@ -55,6 +55,7 @@
#import "WebHistoryPrivate.h"
#import "WebIconDatabaseInternal.h"
#import "WebKitErrorsPrivate.h"
#import "WebKitLogging.h"
#import "WebKitNSStringExtras.h"
#import "WebNSURLExtras.h"
#import "WebPanelAuthenticationHandler.h"
......@@ -91,6 +92,7 @@
#import <WebCore/ResourceLoader.h>
#import <WebCore/ResourceRequest.h>
#import <WebCore/WebCoreFrameBridge.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebCore/SharedBuffer.h>
#import <WebCore/Widget.h>
#import <WebKit/DOMElement.h>
......@@ -1129,6 +1131,13 @@ void WebFrameLoaderClient::windowObjectCleared() const
@implementation WebFramePolicyListener
#ifndef BUILDING_ON_TIGER
+ (void)initialize
{
WebCoreObjCFinalizeOnMainThread(self);
}
#endif
- (id)initWithWebCoreFrame:(Frame*)frame
{
self = [self init];
......@@ -1156,6 +1165,7 @@ void WebFrameLoaderClient::windowObjectCleared() const
- (void)finalize
{
ASSERT_MAIN_THREAD();
if (m_frame)
m_frame->deref();
[super finalize];
......
......@@ -1280,6 +1280,7 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
......@@ -1293,6 +1294,8 @@
mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
shouldCheckCompatibility = 1;
targets = (
9398100A0824BF01008DF038 /* WebKit */,
);
......
......@@ -88,6 +88,7 @@
#import <WebCore/PlatformMouseEvent.h>
#import <WebCore/Range.h>
#import <WebCore/SelectionController.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebCore/WebCoreTextRenderer.h>
#import <WebKit/DOM.h>
#import <WebKit/DOMExtensions.h>
......@@ -1962,6 +1963,9 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
[NSApp registerServicesMenuSendTypes:[[self class] _selectionPasteboardTypes]
returnTypes:[[self class] _insertablePasteboardTypes]];
_NSInitializeKillRing();
#ifndef BUILDING_ON_TIGER
WebCoreObjCFinalizeOnMainThread(self);
#endif
}