summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/Misc
diff options
context:
space:
mode:
authorCary Clark <>2009-04-14 06:33:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-14 06:33:00 -0700
commit563af33bc48281d19dce701398dbb88cb54fd7ec (patch)
tree395b4502f029dea8b25b342d66dc06b5d8f99985 /WebKit/mac/Misc
parent5cfedfef172691d0f4bcf2be5ca3cddd8c9a47f4 (diff)
downloadexternal_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.zip
external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.gz
external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.bz2
AI 146110: add missing files to webkit
brings it in sync with webkit svn cl 42046 Automated import of CL 146110
Diffstat (limited to 'WebKit/mac/Misc')
-rw-r--r--WebKit/mac/Misc/WebCache.mm6
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.mm2
-rw-r--r--WebKit/mac/Misc/WebIconDatabase.mm2
-rw-r--r--WebKit/mac/Misc/WebIconFetcher.mm6
-rw-r--r--WebKit/mac/Misc/WebKitNSStringExtras.m2
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.h2
-rw-r--r--WebKit/mac/Misc/WebNSFileManagerExtras.m40
-rw-r--r--WebKit/mac/Misc/WebNSURLExtras.h1
-rw-r--r--WebKit/mac/Misc/WebNSURLExtras.mm1
9 files changed, 54 insertions, 8 deletions
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 <WebCore/ApplicationCacheStorage.h>
#import <WebCore/Cache.h>
+#import <WebCore/CrossOriginPreflightResultCache.h>
@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<IconFetcher*>(_private)->deref();
+ if (_private)
+ reinterpret_cast<IconFetcher*>(_private)->deref();
[super dealloc];
}
- (void)finalize
{
- reinterpret_cast<IconFetcher*>(_private)->deref();
+ if (_private)
+ reinterpret_cast<IconFetcher*>(_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<UChar, 2048>.
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 <WebKit/WebNSFileManagerExtras.h>
+#import <WebCore/FoundationExtras.h>
#import <WebKit/WebKitNSStringExtras.h>
#import <WebKitSystemInterface.h>
#import <wtf/Assertions.h>
+#import <pthread.h>
#import <sys/mount.h>
@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));
}