adium-1.4 2900:6bec77d21c3f: Remove cookie handling from our mes...

commits at adium.im commits at adium.im
Mon Mar 1 16:54:29 UTC 2010


details:	http://hg.adium.im/adium-1.4/rev/6bec77d21c3f
revision:	2900:6bec77d21c3f
author:		Stephen Holt <sholt at adium.im>
date:		Mon Mar 01 11:06:59 2010 -0500

Remove cookie handling from our message views.

This results in about a 10% savings in memory usage, according to ObjectAlloc, with about 5 IRC windows open.  YMMV.
(transplanted from ce4a2a182037e907d9098466e7c96daa43571abd)

diffs (31 lines):

diff -r 9360ad095234 -r 6bec77d21c3f Plugins/WebKit Message View/AIWebKitDelegate.m
--- a/Plugins/WebKit Message View/AIWebKitDelegate.m	Mon Feb 08 15:58:53 2010 -0800
+++ b/Plugins/WebKit Message View/AIWebKitDelegate.m	Mon Mar 01 11:06:59 2010 -0500
@@ -45,6 +45,7 @@
 	[webView setUIDelegate:self];
 	[webView setDraggingDelegate:self];
 	[webView setEditingDelegate:self];
+	[webView setResourceLoadDelegate:self];
 	
 //	[[webView windowScriptObject] setValue:self forKey:@"client"];
 }
@@ -56,6 +57,8 @@
 	[webView setPolicyDelegate:nil];
 	[webView setUIDelegate:nil];
 	[webView setDraggingDelegate:nil];
+	[webView setEditingDelegate:nil];
+	[webView setResourceLoadDelegate:nil];
 	
 	[mapping removeObjectForKey:[NSValue valueWithPointer:webView]];
 }
@@ -205,4 +208,10 @@
 	return YES;
 }
 
+- (NSURLRequest *)webView:(WebView *)sender resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource
+{
+	NSMutableURLRequest *newRequest = [request mutableCopy];
+	[newRequest setHTTPShouldHandleCookies:NO];
+	return [newRequest autorelease];
+}
 @end




More information about the commits mailing list