[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:38:06 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 4af87c97bd394a4859569e3fb5ccd01f134a6f98
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 11 18:14:16 2002 +0000
WebFoundation:
Major change to the API and design of WebFoundation.
Attributes, as a design concept, are now completely gone. The old usages of
attributes have been replaced with new API on the WebResourceRequest
and WebResourceResponse classes.
* CacheLoader.subproj/IFHTTPURLHandleC.m:
(IFHTTPURLHandleGetRequestMethod): Removed attribute usage. Replace with calls to new API.
(IFHTTPURLHandleGetRequestHeaders): Ditto.
* CacheLoader.subproj/WebCFNetworkHTTPProtocolHandler.m:
(-[WebCFNetworkHTTPProtocolHandler addUserRequestHeaders:]): Ditto.
(-[WebCFNetworkHTTPProtocolHandler addUnconditionalUserRequestHeaders:]): Ditto.
(-[WebCFNetworkHTTPProtocolHandler addAcceptHeaders:]): Ditto.
(-[WebCFNetworkHTTPProtocolHandler addCookieHeaders:]): Ditto.
(-[WebCFNetworkHTTPProtocolHandler hasConditionalCustomHeaders]): Ditto.
* CacheLoader.subproj/WebCacheLoaderConstants.h: Removed newly obsoleted attributes.
* CacheLoader.subproj/WebCacheLoaderConstants.m: Ditto.
* CacheLoader.subproj/WebHTTPProtocolHandler.m:
(-[WebHTTPProtocolHandler shouldAttemptOriginLoad]): Removed attribute usage. Replace with calls to new API.
(-[WebHTTPProtocolHandler shouldCacheResourceData]): Ditto.
(-[WebHTTPProtocolHandler requestMethod]): Ditto.
(-[WebHTTPProtocolHandler requestData]): Ditto.
(-[WebHTTPProtocolHandler retryWithRedirectedURLAndResultCode:]): Ditto.
(-[WebHTTPProtocolHandler testAndSetCacheObjectState:]): Ditto.
* CacheLoader.subproj/WebResourceHandle.h: Removed attributeForKey method.
* CacheLoader.subproj/WebResourceHandle.m:
(-[WebResourceHandle description]): Removed attribute usage. Replace with calls to new API.
(-[WebResourceHandle initWithRequest:client:]): WebResourceRequest no longer requires explicit validation.
* CacheLoader.subproj/WebResourceHandleInternal.h: Removed processedAttributes.
* CacheLoader.subproj/WebResourceHandleInternal.m:
(-[WebResourceHandleInstanceVariables dealloc]): Ditto.
* CacheLoader.subproj/WebResourceHandlePrivate.h: Removed _setAttribute method.
* CacheLoader.subproj/WebResourceHandlePrivate.m: Ditto.
* CacheLoader.subproj/WebResourceLoad.h: Removed processedAttributes ivar. Removed attributeForKey and setAttribute:forKey: methods.
* CacheLoader.subproj/WebResourceLoad.m:
(-[WebResourceLoad initWithRequest:]): Ditto.
(-[WebResourceLoad description]): Ditto.
(-[WebResourceLoad dealloc]): Ditto.
* CacheLoader.subproj/WebResourceLoadManager.m:
(+[WebResourceLoadKey keyWithHandle:]): Removed attributes from cache key. Need to put back some request info soon.
(+[WebResourceLoadKey keyWithLoad:]): Ditto.
* CacheLoader.subproj/WebResourceRequest.h: Removed attributes ivar. Added method, headers, extraCookies and data ivars. Added getter and setter methods for each of the new ivars.
* CacheLoader.subproj/WebResourceRequest.m:
(-[WebResourceRequest initWithURL:]): API and implementation rejiggering to deal with removing attributes from the init methods.
(-[WebResourceRequest initWithURL:flags:]): Ditto.
(-[WebResourceRequest initWithURL:userAgent:flags:]): Ditto.
(-[WebResourceRequest method]): Added.
(-[WebResourceRequest setMethod:]): Added.
(-[WebResourceRequest headers]): Added.
(-[WebResourceRequest setHeaders:]): Added.
(-[WebResourceRequest referrer]): Added.
(-[WebResourceRequest setReferrer:]): Added.
(-[WebResourceRequest extraCookies]): Added.
(-[WebResourceRequest setExtraCookies:]): Added.
(-[WebResourceRequest data]): Added.
(-[WebResourceRequest setData:]): Added.
(-[WebResourceRequest flags]): Just moved method in the file. No changes.
(-[WebResourceRequest protocolHandlerClass]): Ditto.
(-[WebResourceRequest copyWithZone:]): Made sure new ivars get copied.
(-[WebResourceRequest dealloc]): Added new ivars.
* CacheLoader.subproj/WebSimpleHTTPProtocolHandler.m:
(-[WebSimpleHTTPProtocolHandler createHTTPRequest]): Removed attribute usage. Replace with calls to new API.
* WebFoundation.exp: Removed attribute key exports.
WebKit:
Major change to the API and design of WebFoundation. WebKit has been modified
to use the new API.
WebFoundation attributes, as a design concept, are now completely gone. The old usages of
attributes have been replaced with new API on the WebResourceRequest
and WebResourceResponse classes.
* Plugins.subproj/WebPluginStream.h: Removed attribute usage in init API. No need for replacement.
* Plugins.subproj/WebPluginStream.m:
(-[WebNetscapePluginStream initWithURL:pluginPointer:]): Removed attribute usage in init API.
(-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]): Ditto.
(-[WebNetscapePluginStream dealloc]): Remove attribute release.
(-[WebNetscapePluginStream startLoad]): Removed attribute usage. Replace with calls to new API.
(-[WebNetscapePluginStream receivedData:withHandle:]): Ditto.
* Plugins.subproj/WebPluginView.m:
(-[WebNetscapePluginView pluginURLFromCString:]): Added this helper method.
(-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:]): Added.
(-[WebNetscapePluginView getURLNotify:target:notifyData:]): Modified to call new loadRequest:inTarget:withNotifyData: method.
(-[WebNetscapePluginView getURL:target:]): Ditto.
(-[WebNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): Ditto.
* WebCoreSupport.subproj/WebBridge.h: Removed attribute usage in loadURL API. No need for replacement.
* WebCoreSupport.subproj/WebBridge.m: Added loadRequest:withParent:
(-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]):
(-[WebBridge startLoadingResource:withURL:referrer:]): Removed attribute usage. Replace with calls to new API.
(-[WebBridge isReloading]): Ditto.
(-[WebBridge loadRequest:withParent:]): Added.
(-[WebBridge loadURL:]): Modified to use new loadRequest:withParent: API
(-[WebBridge loadURL:referrer:]): Ditto.
(-[WebBridge loadURL:flags:withParent:]): Ditto.
(-[WebBridge postWithURL:data:]): Ditto.
* WebCoreSupport.subproj/WebSubresourceClient.h: Changed API to use an NSString referrer instead of an attributes dictionary.
* WebCoreSupport.subproj/WebSubresourceClient.m:
(+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Removed attribute usage. Replace with calls to new API.
* WebView.subproj/WebDataSource.h: Added initWithRequest: method.
* WebView.subproj/WebDataSource.m:
(-[WebDataSource initWithURL:]): Removed attribute usage in init API.
(-[WebDataSource initWithURL:flags:]): Ditto.
(-[WebDataSource initWithRequest:]): Added.
(-[WebDataSource request]): Added.
* WebView.subproj/WebDataSourcePrivate.h: Added WebResourceRequest ivar.
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSourcePrivate dealloc]): Added WebResourceRequest ivar.
(-[WebDataSource _startLoading:]): Removed attribute usage. Replace with calls to new API.
* WebView.subproj/WebFrame.m:
(-[WebFrame reload:]): Removed attribute usage. Replace with calls to new API.
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _goToItem:withFrameLoadType:]): Use new WebDataSource init API.
WebBrowser:
Updated to use new referrer ivar and accessor methods on WebResourceRequest, instead
of using attributes.
* BrowserDocument.m:
(-[BrowserDocument _goToURL:referrer:withFallbackURLs:])
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index aacfbc1..9dfa942 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,53 @@
+2002-09-11 Ken Kocienda <kocienda at apple.com>
+
+ Major change to the API and design of WebFoundation. WebKit has been modified
+ to use the new API.
+
+ WebFoundation attributes, as a design concept, are now completely gone. The old usages of
+ attributes have been replaced with new API on the WebResourceRequest
+ and WebResourceResponse classes.
+
+ * Plugins.subproj/WebPluginStream.h: Removed attribute usage in init API. No need for replacement.
+ * Plugins.subproj/WebPluginStream.m:
+ (-[WebNetscapePluginStream initWithURL:pluginPointer:]): Removed attribute usage in init API.
+ (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]): Ditto.
+ (-[WebNetscapePluginStream dealloc]): Remove attribute release.
+ (-[WebNetscapePluginStream startLoad]): Removed attribute usage. Replace with calls to new API.
+ (-[WebNetscapePluginStream receivedData:withHandle:]): Ditto.
+ * Plugins.subproj/WebPluginView.m:
+ (-[WebNetscapePluginView pluginURLFromCString:]): Added this helper method.
+ (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:]): Added.
+ (-[WebNetscapePluginView getURLNotify:target:notifyData:]): Modified to call new loadRequest:inTarget:withNotifyData: method.
+ (-[WebNetscapePluginView getURL:target:]): Ditto.
+ (-[WebNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): Ditto.
+ * WebCoreSupport.subproj/WebBridge.h: Removed attribute usage in loadURL API. No need for replacement.
+ * WebCoreSupport.subproj/WebBridge.m: Added loadRequest:withParent:
+ (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]):
+ (-[WebBridge startLoadingResource:withURL:referrer:]): Removed attribute usage. Replace with calls to new API.
+ (-[WebBridge isReloading]): Ditto.
+ (-[WebBridge loadRequest:withParent:]): Added.
+ (-[WebBridge loadURL:]): Modified to use new loadRequest:withParent: API
+ (-[WebBridge loadURL:referrer:]): Ditto.
+ (-[WebBridge loadURL:flags:withParent:]): Ditto.
+ (-[WebBridge postWithURL:data:]): Ditto.
+ * WebCoreSupport.subproj/WebSubresourceClient.h: Changed API to use an NSString referrer instead of an attributes dictionary.
+ * WebCoreSupport.subproj/WebSubresourceClient.m:
+ (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Removed attribute usage. Replace with calls to new API.
+ * WebView.subproj/WebDataSource.h: Added initWithRequest: method.
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource initWithURL:]): Removed attribute usage in init API.
+ (-[WebDataSource initWithURL:flags:]): Ditto.
+ (-[WebDataSource initWithRequest:]): Added.
+ (-[WebDataSource request]): Added.
+ * WebView.subproj/WebDataSourcePrivate.h: Added WebResourceRequest ivar.
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSourcePrivate dealloc]): Added WebResourceRequest ivar.
+ (-[WebDataSource _startLoading:]): Removed attribute usage. Replace with calls to new API.
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame reload:]): Removed attribute usage. Replace with calls to new API.
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _goToItem:withFrameLoadType:]): Use new WebDataSource init API.
+
2002-09-10 Darin Adler <darin at apple.com>
WebKit part of support for the "Referer" header.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index aacfbc1..9dfa942 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,53 @@
+2002-09-11 Ken Kocienda <kocienda at apple.com>
+
+ Major change to the API and design of WebFoundation. WebKit has been modified
+ to use the new API.
+
+ WebFoundation attributes, as a design concept, are now completely gone. The old usages of
+ attributes have been replaced with new API on the WebResourceRequest
+ and WebResourceResponse classes.
+
+ * Plugins.subproj/WebPluginStream.h: Removed attribute usage in init API. No need for replacement.
+ * Plugins.subproj/WebPluginStream.m:
+ (-[WebNetscapePluginStream initWithURL:pluginPointer:]): Removed attribute usage in init API.
+ (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]): Ditto.
+ (-[WebNetscapePluginStream dealloc]): Remove attribute release.
+ (-[WebNetscapePluginStream startLoad]): Removed attribute usage. Replace with calls to new API.
+ (-[WebNetscapePluginStream receivedData:withHandle:]): Ditto.
+ * Plugins.subproj/WebPluginView.m:
+ (-[WebNetscapePluginView pluginURLFromCString:]): Added this helper method.
+ (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:]): Added.
+ (-[WebNetscapePluginView getURLNotify:target:notifyData:]): Modified to call new loadRequest:inTarget:withNotifyData: method.
+ (-[WebNetscapePluginView getURL:target:]): Ditto.
+ (-[WebNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): Ditto.
+ * WebCoreSupport.subproj/WebBridge.h: Removed attribute usage in loadURL API. No need for replacement.
+ * WebCoreSupport.subproj/WebBridge.m: Added loadRequest:withParent:
+ (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]):
+ (-[WebBridge startLoadingResource:withURL:referrer:]): Removed attribute usage. Replace with calls to new API.
+ (-[WebBridge isReloading]): Ditto.
+ (-[WebBridge loadRequest:withParent:]): Added.
+ (-[WebBridge loadURL:]): Modified to use new loadRequest:withParent: API
+ (-[WebBridge loadURL:referrer:]): Ditto.
+ (-[WebBridge loadURL:flags:withParent:]): Ditto.
+ (-[WebBridge postWithURL:data:]): Ditto.
+ * WebCoreSupport.subproj/WebSubresourceClient.h: Changed API to use an NSString referrer instead of an attributes dictionary.
+ * WebCoreSupport.subproj/WebSubresourceClient.m:
+ (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Removed attribute usage. Replace with calls to new API.
+ * WebView.subproj/WebDataSource.h: Added initWithRequest: method.
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource initWithURL:]): Removed attribute usage in init API.
+ (-[WebDataSource initWithURL:flags:]): Ditto.
+ (-[WebDataSource initWithRequest:]): Added.
+ (-[WebDataSource request]): Added.
+ * WebView.subproj/WebDataSourcePrivate.h: Added WebResourceRequest ivar.
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSourcePrivate dealloc]): Added WebResourceRequest ivar.
+ (-[WebDataSource _startLoading:]): Removed attribute usage. Replace with calls to new API.
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame reload:]): Removed attribute usage. Replace with calls to new API.
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _goToItem:withFrameLoadType:]): Use new WebDataSource init API.
+
2002-09-10 Darin Adler <darin at apple.com>
WebKit part of support for the "Referer" header.
diff --git a/WebKit/Plugins.subproj/WebPluginStream.h b/WebKit/Plugins.subproj/WebPluginStream.h
index 78f75be..2c425fc 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.h
+++ b/WebKit/Plugins.subproj/WebPluginStream.h
@@ -21,7 +21,6 @@
int32 offset;
NPStream npStream;
NSString *path;
- NSDictionary *attributes;
void *notifyData;
@@ -40,7 +39,6 @@
- initWithURL:(NSURL *)theURL pluginPointer:(NPP)thePluginPointer;
- initWithURL:(NSURL *)theURL pluginPointer:(NPP)thePluginPointer notifyData:(void *)theNotifyData;
-- initWithURL:(NSURL *)theURL pluginPointer:(NPP)thePluginPointer notifyData:(void *)theNotifyData attributes:(NSDictionary *)theAttributes;
- (void)startLoad;
- (void)stop;
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index 9370064..6e56bdb 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -50,16 +50,11 @@
- initWithURL:(NSURL *)theURL pluginPointer:(NPP)thePluginPointer
{
- return [self initWithURL:theURL pluginPointer:thePluginPointer notifyData:nil attributes:nil];
+ return [self initWithURL:theURL pluginPointer:thePluginPointer notifyData:nil];
}
- initWithURL:(NSURL *)theURL pluginPointer:(NPP)thePluginPointer notifyData:(void *)theNotifyData
{
- return [self initWithURL:theURL pluginPointer:thePluginPointer notifyData:theNotifyData attributes:nil];
-}
-
-- initWithURL:(NSURL *)theURL pluginPointer:(NPP)thePluginPointer notifyData:(void *)theNotifyData attributes:(NSDictionary *)theAttributes
-{
[super init];
if(!theURL)
@@ -70,7 +65,6 @@
view = [(WebNetscapePluginView *)thePluginPointer->ndata retain];
URL = [theURL retain];
- attributes = [theAttributes retain];
instance = thePluginPointer;
notifyData = theNotifyData;
resourceData = [[NSMutableData alloc] init];
@@ -93,14 +87,13 @@
}
free((void *)npStream.URL);
[URL release];
- [attributes release];
[resourceData release];
[super dealloc];
}
- (void)startLoad
{
- WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL attributes:attributes flags:0];
+ WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
resource = [[WebResourceHandle alloc] initWithRequest:request client:self];
[resource loadInBackground];
[request release];
@@ -125,7 +118,7 @@
char *cURL = (char *)malloc([URLString cStringLength]+1);
[URLString getCString:cURL];
- NSNumber *timeInterval = [handle attributeForKey:@"Last-Modified"];
+ NSNumber *timeInterval = [[[handle response] headers] objectForKey:@"Last-Modified"];
uint32 lastModified;
if(timeInterval){
diff --git a/WebKit/Plugins.subproj/WebPluginView.m b/WebKit/Plugins.subproj/WebPluginView.m
index e5a0329..b881e30 100644
--- a/WebKit/Plugins.subproj/WebPluginView.m
+++ b/WebKit/Plugins.subproj/WebPluginView.m
@@ -24,6 +24,7 @@
#import <WebFoundation/WebError.h>
#import <WebFoundation/WebNSStringExtras.h>
#import <WebFoundation/WebNSURLExtras.h>
+#import <WebFoundation/WebResourceRequest.h>
#import <AppKit/NSEvent_Private.h>
#import <AppKit/NSWindow_Private.h>
@@ -837,23 +838,34 @@
@implementation WebNetscapePluginView (WebNPPCallbacks)
-- (NPError)loadURL:(NSString *)URLString inTarget:(NSString *)target withNotifyData:(void *)notifyData andHandleAttributes:(NSDictionary *)attributes
+- (NSURL *)pluginURLFromCString:(const char *)URLCString
+{
+ NSString *URLString;
+ NSURL *URL;
+
+ URLString = [NSString stringWithCString:URLCString];
+
+ if ([URLString _web_looksLikeAbsoluteURL]) {
+ URL = [NSURL _web_URLWithString:URLString];
+ }
+ else {
+ URL = [NSURL _web_URLWithString:URLString relativeToURL:baseURL];
+ }
+
+ return URL;
+}
+
+- (NPError) loadRequest:(WebResourceRequest *)request inTarget:(NSString *)target withNotifyData:(void *)notifyData
{
WebNetscapePluginStream *stream;
WebDataSource *dataSource;
WebFrame *frame;
NSURL *URL;
- if([URLString _web_looksLikeAbsoluteURL])
- URL = [NSURL _web_URLWithString:URLString];
- else
- URL = [NSURL _web_URLWithString:URLString relativeToURL:baseURL];
-
- if(!URL)
- return NPERR_INVALID_URL;
+ URL = [request URL];
if(!target){
- stream = [[WebNetscapePluginStream alloc] initWithURL:URL pluginPointer:instance notifyData:notifyData attributes:attributes];
+ stream = [[WebNetscapePluginStream alloc] initWithURL:URL pluginPointer:instance notifyData:notifyData];
if(stream){
[stream startLoad];
[streams addObject:stream];
@@ -883,7 +895,7 @@
// but IE allows an NPP_*URLNotify when the target is _self, _current, _parent or _top
// so we have to allow this as well. Needed for iTools.
}
- dataSource = [[WebDataSource alloc] initWithURL:URL attributes:attributes];
+ dataSource = [[WebDataSource alloc] initWithRequest:request];
if ([frame setProvisionalDataSource:dataSource]) {
[frame startLoading];
}
@@ -896,6 +908,8 @@
-(NPError)getURLNotify:(const char *)URL target:(const char *)target notifyData:(void *)notifyData
{
NSString *theTarget = nil;
+ NSURL *pluginURL;
+ WebResourceRequest *request;
LOG(Plugins, "NPN_GetURLNotify: %s target: %s", URL, target);
@@ -904,13 +918,22 @@
if(target)
theTarget = [NSString stringWithCString:target];
+
+ pluginURL = [self pluginURLFromCString:URL];
+
+ if(!pluginURL)
+ return NPERR_INVALID_URL;
+
+ request = [[[WebResourceRequest alloc] initWithURL:pluginURL] autorelease];
- return [self loadURL:[NSString stringWithCString:URL] inTarget:theTarget withNotifyData:notifyData andHandleAttributes:nil];
+ return [self loadRequest:request inTarget:theTarget withNotifyData:notifyData];
}
-(NPError)getURL:(const char *)URL target:(const char *)target
{
NSString *theTarget = nil;
+ NSURL *pluginURL;
+ WebResourceRequest *request;
LOG(Plugins, "NPN_GetURL: %s target: %s", URL, target);
@@ -919,16 +942,24 @@
if(target)
theTarget = [NSString stringWithCString:target];
+
+ pluginURL = [self pluginURLFromCString:URL];
+
+ if(!pluginURL)
+ return NPERR_INVALID_URL;
+
+ request = [[[WebResourceRequest alloc] initWithURL:pluginURL] autorelease];
- return [self loadURL:[NSString stringWithCString:URL] inTarget:theTarget withNotifyData:NULL andHandleAttributes:nil];
+ return [self loadRequest:request inTarget:theTarget withNotifyData:NULL];
}
-(NPError)postURLNotify:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file notifyData:(void *)notifyData
{
- NSDictionary *attributes=nil;
NSData *postData;
NSURL *tempURL;
NSString *path, *theTarget = nil;
+ NSURL *pluginURL;
+ WebResourceRequest *request;
LOG(Plugins, "NPN_PostURLNotify: %s", URL);
@@ -949,13 +980,17 @@
}else{
postData = [NSData dataWithBytes:buf length:len];
}
+
+ pluginURL = [self pluginURLFromCString:URL];
+
+ if(!pluginURL)
+ return NPERR_INVALID_URL;
+
+ request = [[[WebResourceRequest alloc] initWithURL:pluginURL] autorelease];
+ [request setMethod:@"POST"];
+ [request setData:postData];
- attributes = [NSDictionary dictionaryWithObjectsAndKeys:
- postData, WebHTTPResourceHandleRequestData,
- @"POST", WebHTTPResourceHandleRequestMethod, nil];
-
- return [self loadURL:[NSString stringWithCString:URL] inTarget:theTarget
- withNotifyData:notifyData andHandleAttributes:attributes];
+ return [self loadRequest:request inTarget:theTarget withNotifyData:notifyData];
}
-(NPError)postURL:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.h b/WebKit/WebCoreSupport.subproj/WebBridge.h
index bbdeed0..d546365 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.h
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.h
@@ -21,7 +21,7 @@
- (void)dataSourceChanged;
- (WebDataSource *)dataSource;
-- (void)loadURL:(NSURL *)URL attributes:(NSDictionary *)attributes flags:(unsigned)flags withParent:(WebDataSource *)parent;
+- (void)loadURL:(NSURL *)URL flags:(unsigned)flags withParent:(WebDataSource *)parent;
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 759feeb..970631a 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -78,7 +78,7 @@
[[newFrame webView] _setMarginWidth:width];
[[newFrame webView] _setMarginHeight:height];
- [[newFrame _bridge] loadURL:URL attributes:nil flags:0 withParent:[self dataSource]];
+ [[newFrame _bridge] loadURL:URL flags:0 withParent:[self dataSource]];
// Set the load type so this load doesn't end up in the back
// forward list.
@@ -179,29 +179,9 @@
}
}
-- (void)addAttributeForReferrer:(NSString *)referrer toDictionary:(NSMutableDictionary *)attributes
-{
- if ([referrer length] == 0) {
- return;
- }
- NSDictionary *headers = [NSDictionary dictionaryWithObject:[[referrer copy] autorelease] forKey:@"Referer"]; // note the misspelling
- [attributes setObject:headers forKey:WebHTTPResourceHandleRequestHeaders];
-}
-
-- (NSDictionary *)attributesForReferrer:(NSString *)referrer
-{
- if ([referrer length] == 0) {
- return nil;
- }
- NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
- [self addAttributeForReferrer:referrer toDictionary:attributes];
- return attributes;
-}
-
- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withURL:(NSURL *)URL referrer:(NSString *)referrer
{
- return [WebSubresourceClient startLoadingResource:resourceLoader withURL:URL
- attributes:[self attributesForReferrer:referrer] forDataSource:[self dataSource]];
+ return [WebSubresourceClient startLoadingResource:resourceLoader withURL:URL referrer:referrer forDataSource:[self dataSource]];
}
- (void)objectLoadedFromCache:(NSURL *)URL size:(unsigned)bytes
@@ -219,7 +199,7 @@
- (BOOL)isReloading
{
- return ([[self dataSource] flags] & WebResourceHandleFlagLoadFromOrigin);
+ return ([[[self dataSource] request] flags] & WebResourceHandleFlagLoadFromOrigin);
}
- (void)reportClientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date
@@ -284,9 +264,9 @@
[[self dataSource] _setIconURL:URL withType:type];
}
-- (void)loadURL:(NSURL *)URL attributes:(NSDictionary *)attributes flags:(unsigned)flags withParent:(WebDataSource *)parent
+- (void)loadRequest:(WebResourceRequest *)request withParent:(WebDataSource *)parent
{
- WebDataSource *newDataSource = [[WebDataSource alloc] initWithURL:URL attributes:attributes flags:flags];
+ WebDataSource *newDataSource = [[WebDataSource alloc] initWithRequest:request];
[newDataSource _setParent:parent];
if ([frame setProvisionalDataSource:newDataSource]) {
[frame startLoading];
@@ -296,7 +276,17 @@
- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer
{
- [self loadURL:URL attributes:[self attributesForReferrer:referrer] flags:0 withParent:[[frame dataSource] parent]];
+ WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL flags:0];
+ [request setReferrer:referrer];
+ [self loadRequest:request withParent:[[frame dataSource] parent]];
+ [request release];
+}
+
+- (void)loadURL:(NSURL *)URL flags:(unsigned)flags withParent:(WebDataSource *)parent
+{
+ WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL flags:flags];
+ [self loadRequest:request withParent:parent];
+ [request release];
}
- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer data:(NSData *)data
@@ -305,23 +295,22 @@
// This prevents a potential bug which may cause a page
// with a form that uses itself as an action to be returned
// from the cache without submitting.
- NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
- data, WebHTTPResourceHandleRequestData,
- @"POST", WebHTTPResourceHandleRequestMethod,
- nil];
- [self addAttributeForReferrer:referrer toDictionary:attributes];
- [self loadURL:URL attributes:attributes flags:WebResourceHandleFlagLoadFromOrigin withParent:[[frame dataSource] parent]];
- [attributes release];
+ WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL flags:WebResourceHandleFlagLoadFromOrigin];
+ [request setMethod:@"POST"];
+ [request setData:data];
+ [request setReferrer:referrer];
+ [self loadRequest:request withParent:[[frame dataSource] parent]];
+ [request release];
}
- (void)reportBadURL:(NSString *)badURL
{
WebError *badURLError = [[WebError alloc] initWithErrorCode:WebResultBadURLError
- inDomain:WebErrorDomainWebFoundation
- failingURL:badURL];
+ inDomain:WebErrorDomainWebFoundation
+ failingURL:badURL];
[[frame controller] _receivedError:badURLError
- forResourceHandle:nil
- partialProgress:nil
+ forResourceHandle:nil
+ partialProgress:nil
fromDataSource:[self dataSource]];
[badURLError release];
}
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.h b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.h
index bcbdde8..f36748b 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.h
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.h
@@ -20,8 +20,8 @@
WebResourceHandle *handle;
}
-+ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader
- withURL:(NSURL *)URL attributes:(NSDictionary *)attributes forDataSource:(WebDataSource *)dataSource;
++ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
+ withURL:(NSURL *)URL referrer:(NSString *)referrer forDataSource:(WebDataSource *)source;
- (WebResourceHandle *)handle;
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index d1ca3fd..2da4e80 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -66,10 +66,11 @@
}
+ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
- withURL:(NSURL *)URL attributes:(NSDictionary *)attributes forDataSource:(WebDataSource *)source
+ withURL:(NSURL *)URL referrer:(NSString *)referrer forDataSource:(WebDataSource *)source
{
WebSubresourceClient *client = [[self alloc] initWithLoader:rLoader dataSource:source];
- WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL attributes:attributes flags:[source flags]];
+ WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL flags:[[source request] flags]];
+ [request setReferrer:referrer];
WebResourceHandle *h = [[[WebResourceHandle alloc] initWithRequest:request client:client] autorelease];
[request release];
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h
index bcbdde8..f36748b 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h
@@ -20,8 +20,8 @@
WebResourceHandle *handle;
}
-+ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader
- withURL:(NSURL *)URL attributes:(NSDictionary *)attributes forDataSource:(WebDataSource *)dataSource;
++ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
+ withURL:(NSURL *)URL referrer:(NSString *)referrer forDataSource:(WebDataSource *)source;
- (WebResourceHandle *)handle;
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index d1ca3fd..2da4e80 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -66,10 +66,11 @@
}
+ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
- withURL:(NSURL *)URL attributes:(NSDictionary *)attributes forDataSource:(WebDataSource *)source
+ withURL:(NSURL *)URL referrer:(NSString *)referrer forDataSource:(WebDataSource *)source
{
WebSubresourceClient *client = [[self alloc] initWithLoader:rLoader dataSource:source];
- WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL attributes:attributes flags:[source flags]];
+ WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL flags:[[source request] flags]];
+ [request setReferrer:referrer];
WebResourceHandle *h = [[[WebResourceHandle alloc] initWithRequest:request client:client] autorelease];
[request release];
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index d825934..e2eae05 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -21,6 +21,7 @@
@class WebController;
@class WebDataSourcePrivate;
+ at class WebResourceRequest;
@protocol WebDocumentRepresentation;
@interface WebDataSource : NSObject
@@ -31,8 +32,8 @@
// Returns nil if object cannot be initialized due to a malformed URL (RFC 1808).
-(id)initWithURL:(NSURL *)URL;
--(id)initWithURL:(NSURL *)URL attributes:(NSDictionary *)theAttributes;
--(id)initWithURL:(NSURL *)URL attributes:(NSDictionary *)theAttributes flags:(unsigned)theFlags;
+-(id)initWithURL:(NSURL *)URL flags:(unsigned)theFlags;
+-(id)initWithRequest:(WebResourceRequest *)request;
#ifdef TENTATIVE_API
- initWithData: (NSData *)data;
@@ -40,9 +41,6 @@
- initWithLoader: (WebLoader *)loader;
#endif
--(NSDictionary *)attributes;
--(unsigned)flags;
-
- (NSData *)data;
- (id <WebDocumentRepresentation>)representation;
@@ -89,6 +87,8 @@
//- (void)setController: (WebController *)controller;
- (WebController *)controller;
+-(WebResourceRequest *)request;
+
// May return nil if not initialized with a URL.
// The value of URL will change if a redirect occurs.
// To monitor change in the URL, override the <WebLocationChangeHandler>
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 7e6fd7d..b9a5ff4 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -18,21 +18,33 @@
#import <WebFoundation/WebFoundation.h>
#import <WebFoundation/WebFileTypeMappings.h>
+#import <WebFoundation/WebResourceRequest.h>
#import <WebFoundation/WebNSDictionaryExtras.h>
@implementation WebDataSource
-(id)initWithURL:(NSURL *)URL
{
- return [self initWithURL:URL attributes:nil flags:0];
+ return [self initWithURL:URL flags:0];
}
--(id)initWithURL:(NSURL *)URL attributes:(NSDictionary *)theAttributes
+-(id)initWithURL:(NSURL *)URL flags:(unsigned)theFlags
{
- return [self initWithURL:URL attributes:theAttributes flags:0];
+ id result = nil;
+
+ WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL flags:theFlags];
+ if (request) {
+ result = [self initWithRequest:request];
+ [request release];
+ }
+ else {
+ [self release];
+ }
+
+ return result;
}
--(id)initWithURL:(NSURL *)URL attributes:(NSDictionary *)theAttributes flags:(unsigned)theFlags
+-(id)initWithRequest:(WebResourceRequest *)request
{
self = [super init];
if (!self) {
@@ -40,10 +52,11 @@
}
_private = [[WebDataSourcePrivate alloc] init];
- _private->inputURL = [URL retain];
- _private->flags = theFlags;
- _private->attributes = [theAttributes retain];
-
+ _private->request = [request retain];
+ _private->inputURL = [[request canonicalURL] retain];
+ _private->attributes = nil;
+ _private->flags = [request flags];
+
++WebDataSourceCount;
return self;
@@ -58,16 +71,6 @@
[super dealloc];
}
--(NSDictionary *)attributes
-{
- return _private->attributes;
-}
-
--(unsigned)flags;
-{
- return _private->flags;
-}
-
- (NSData *)data
{
if(!_private->resourceData){
@@ -172,6 +175,10 @@
return _private->controller;
}
+-(WebResourceRequest *)request
+{
+ return _private->request;
+}
// May return nil if not initialized with a URL.
- (NSURL *)URL
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 8fa2fec..6dd3a65 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -11,6 +11,7 @@
@class WebIconLoader;
@class WebResourceHandle;
+ at class WebResourceRequest;
@class WebMainResourceClient;
@class WebSubresourceClient;
@protocol WebDocumentRepresentation;
@@ -30,6 +31,7 @@
NSURL *inputURL;
NSDictionary *attributes;
unsigned flags;
+ WebResourceRequest *request;
// The original URL we may have been redirected to.
NSURL *finalURL;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index e4c6c6b..97c159b 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -64,6 +64,7 @@
[representation release];
[inputURL release];
[attributes release];
+ [request release];
[finalURL release];
[frames release];
[mainClient release];
@@ -181,9 +182,7 @@
// Fire this guy up.
if (!_private->mainHandle) {
_private->mainClient = [[WebMainResourceClient alloc] initWithDataSource: self];
- WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:_private->inputURL attributes:_private->attributes flags:_private->flags];
- _private->mainHandle = [[WebResourceHandle alloc] initWithRequest:request client:_private->mainClient];
- [request release];
+ _private->mainHandle = [[WebResourceHandle alloc] initWithRequest:_private->request client:_private->mainClient];
}
[_private->mainClient didStartLoadingWithURL:[_private->mainHandle URL]];
[_private->mainHandle loadInBackground];
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index ce99d5e..f923cee 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -22,6 +22,7 @@
#import <WebFoundation/WebFoundation.h>
#import <WebFoundation/WebNSURLExtras.h>
+#import <WebFoundation/WebResourceRequest.h>
@implementation WebFrame
@@ -195,9 +196,9 @@
return;
}
- flags = [dataSource flags] | WebResourceHandleFlagLoadFromOrigin;
+ flags = [[dataSource request] flags] | WebResourceHandleFlagLoadFromOrigin;
- WebDataSource *newDataSource = [[WebDataSource alloc] initWithURL:[dataSource originalURL] attributes:[dataSource attributes] flags:flags];
+ WebDataSource *newDataSource = [[WebDataSource alloc] initWithURL:[dataSource originalURL] flags:flags];
[newDataSource _setParent:[dataSource parent]];
if ([self setProvisionalDataSource:newDataSource]) {
[self _setLoadType:WebFrameLoadTypeRefresh];
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 0dbbbe8..3dbcfc6 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -666,7 +666,7 @@ static const char * const stateNames[] = {
if (type == WebFrameLoadTypeBack || type == WebFrameLoadTypeForward) {
flags = WebResourceHandleUseCachedObjectIfPresent;
}
- dataSource = [[WebDataSource alloc] initWithURL:itemURL attributes:nil flags:flags];
+ dataSource = [[WebDataSource alloc] initWithURL:itemURL flags:flags];
[self setProvisionalDataSource: dataSource];
[self _setLoadType: type];
[self startLoading];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list