From 563af33bc48281d19dce701398dbb88cb54fd7ec Mon Sep 17 00:00:00 2001 From: Cary Clark <> Date: Tue, 14 Apr 2009 06:33:00 -0700 Subject: AI 146110: add missing files to webkit brings it in sync with webkit svn cl 42046 Automated import of CL 146110 --- WebKit/mac/Misc/WebCache.mm | 6 ++++- WebKit/mac/Misc/WebCoreStatistics.mm | 2 +- WebKit/mac/Misc/WebIconDatabase.mm | 2 +- WebKit/mac/Misc/WebIconFetcher.mm | 6 +++-- WebKit/mac/Misc/WebKitNSStringExtras.m | 2 +- WebKit/mac/Misc/WebKitVersionChecks.h | 2 +- WebKit/mac/Misc/WebNSFileManagerExtras.m | 40 +++++++++++++++++++++++++++++++- WebKit/mac/Misc/WebNSURLExtras.h | 1 + WebKit/mac/Misc/WebNSURLExtras.mm | 1 + 9 files changed, 54 insertions(+), 8 deletions(-) (limited to 'WebKit/mac/Misc') diff --git a/WebKit/mac/Misc/WebCache.mm b/WebKit/mac/Misc/WebCache.mm index a60159f..46fb341 100644 --- a/WebKit/mac/Misc/WebCache.mm +++ b/WebKit/mac/Misc/WebCache.mm @@ -30,6 +30,7 @@ #import "WebViewInternal.h" #import #import +#import @implementation WebCache @@ -107,9 +108,12 @@ WebCacheModel cacheModel = [WebView _cacheModel]; [WebView _setCacheModel:WebCacheModelDocumentViewer]; [WebView _setCacheModel:cacheModel]; - + // Empty the application cache. WebCore::cacheStorage().empty(); + + // Empty the Cross-Origin Preflight cache + WebCore::CrossOriginPreflightResultCache::shared().empty(); } + (void)setDisabled:(BOOL)disabled diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm index 05c2659..2fe5710 100644 --- a/WebKit/mac/Misc/WebCoreStatistics.mm +++ b/WebKit/mac/Misc/WebCoreStatistics.mm @@ -95,7 +95,7 @@ using namespace WebCore; gcController().garbageCollectNow(); } -+ (void)garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:(BOOL)waitUntilDone; ++ (void)garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:(BOOL)waitUntilDone { gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone); } diff --git a/WebKit/mac/Misc/WebIconDatabase.mm b/WebKit/mac/Misc/WebIconDatabase.mm index 3b42406..d4df14b 100644 --- a/WebKit/mac/Misc/WebIconDatabase.mm +++ b/WebKit/mac/Misc/WebIconDatabase.mm @@ -94,7 +94,7 @@ static WebIconDatabaseClient* defaultClient() - init { [super init]; - WebCoreThreadViolationCheck(); + WebCoreThreadViolationCheckRoundOne(); _private = [[WebIconDatabasePrivate alloc] init]; diff --git a/WebKit/mac/Misc/WebIconFetcher.mm b/WebKit/mac/Misc/WebIconFetcher.mm index bec7c12..a31ab7d 100644 --- a/WebKit/mac/Misc/WebIconFetcher.mm +++ b/WebKit/mac/Misc/WebIconFetcher.mm @@ -71,14 +71,16 @@ private: - (void)dealloc { - reinterpret_cast(_private)->deref(); + if (_private) + reinterpret_cast(_private)->deref(); [super dealloc]; } - (void)finalize { - reinterpret_cast(_private)->deref(); + if (_private) + reinterpret_cast(_private)->deref(); [super finalize]; } diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.m b/WebKit/mac/Misc/WebKitNSStringExtras.m index 2e75e9e..f3077d3 100644 --- a/WebKit/mac/Misc/WebKitNSStringExtras.m +++ b/WebKit/mac/Misc/WebKitNSStringExtras.m @@ -50,7 +50,7 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length) return YES; } -- (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor; +- (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor { // FIXME: Would be more efficient to change this to C++ and use Vector. unsigned length = [self length]; diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h index 6c60d6a..169b4cf 100644 --- a/WebKit/mac/Misc/WebKitVersionChecks.h +++ b/WebKit/mac/Misc/WebKitVersionChecks.h @@ -49,8 +49,8 @@ #define WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES 0x020E0000 // 526.0.0 #define WEBKIT_FIRST_VERSION_WITH_MORE_STRICT_LOCAL_RESOURCE_SECURITY_RESTRICTION 0x02100200 // 528.2.0 #define WEBKIT_FIRST_VERSION_WITH_RELOAD_FROM_ORIGIN 0x02100700 // 528.7.0 -#define WEBKIT_FIRST_VERSION_WITHOUT_MAIL_THREAD_WORKAROUND 0x02100700 // 528.7.0 #define WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND 0x02100700 // 528.7.0 +#define WEBKIT_FIRST_VERSION_WITH_ROUND_TWO_MAIN_THREAD_EXCEPTIONS 0x02120400 // 530.4.0 #ifdef __cplusplus extern "C" { diff --git a/WebKit/mac/Misc/WebNSFileManagerExtras.m b/WebKit/mac/Misc/WebNSFileManagerExtras.m index 0c10725..f32b4c0 100644 --- a/WebKit/mac/Misc/WebNSFileManagerExtras.m +++ b/WebKit/mac/Misc/WebNSFileManagerExtras.m @@ -28,10 +28,12 @@ #import +#import #import #import #import +#import #import @implementation NSFileManager (WebNSFileManagerExtras) @@ -144,11 +146,47 @@ return [carbonPathPieces componentsJoinedByString:@":"]; } +typedef struct MetaDataInfo +{ + NSString *URLString; + NSString *referrer; + NSString *path; +} MetaDataInfo; + +static void *setMetaData(void* context) +{ + MetaDataInfo *info = (MetaDataInfo *)context; + WKSetMetadataURL(info->URLString, info->referrer, info->path); + + HardRelease(info->URLString); + HardRelease(info->referrer); + HardRelease(info->path); + + free(info); + return 0; +} + - (void)_webkit_setMetadataURL:(NSString *)URLString referrer:(NSString *)referrer atPath:(NSString *)path { ASSERT(URLString); ASSERT(path); - WKSetMetadataURL(URLString, referrer, path); + + // Spawn a background thread for WKSetMetadataURL because this function will not return until mds has + // journaled the data we're're trying to set. Depending on what other I/O is going on, it can take some + // time. + pthread_t tid; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + MetaDataInfo *info = malloc(sizeof(MetaDataInfo)); + + info->URLString = HardRetainWithNSRelease([URLString copy]); + info->referrer = HardRetainWithNSRelease([referrer copy]); + info->path = HardRetainWithNSRelease([path copy]); + + pthread_create(&tid, &attr, setMetaData, info); + pthread_attr_destroy(&attr); } - (NSString *)_webkit_startupVolumeName diff --git a/WebKit/mac/Misc/WebNSURLExtras.h b/WebKit/mac/Misc/WebNSURLExtras.h index f8823b9..40f7cf7 100644 --- a/WebKit/mac/Misc/WebNSURLExtras.h +++ b/WebKit/mac/Misc/WebNSURLExtras.h @@ -60,6 +60,7 @@ - (NSURL *)_webkit_URLByRemovingResourceSpecifier; - (BOOL)_webkit_isJavaScriptURL; +- (BOOL)_webkit_isFileURL; - (NSString *)_webkit_scriptIfJavaScriptURL; - (BOOL)_webkit_isFTPDirectoryURL; diff --git a/WebKit/mac/Misc/WebNSURLExtras.mm b/WebKit/mac/Misc/WebNSURLExtras.mm index b388c22..a081f1a 100644 --- a/WebKit/mac/Misc/WebNSURLExtras.mm +++ b/WebKit/mac/Misc/WebNSURLExtras.mm @@ -571,6 +571,7 @@ static CFStringRef createStringWithEscapedUnsafeCharacters(CFStringRef string) free(after); result = mapHostNames(result, !needsHostNameDecoding); + result = [result precomposedStringWithCanonicalMapping]; return WebCFAutorelease(createStringWithEscapedUnsafeCharacters((CFStringRef)result)); } -- cgit v1.1