[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:01:01 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 62074c916ef945a3de13cefe02bdd5147f00fc5c
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 15 13:40:36 2002 +0000
WebKit:
Make navigation policy asynchronous for real.
* WebKit.pbproj/project.pbxproj:
* WebView.subproj/WebControllerPolicyDelegate.h:
* WebView.subproj/WebControllerPolicyDelegate.m:
(-[WebPolicyDecisionListenerPrivate initWithTarget:action:]):
(-[WebPolicyDecisionListenerPrivate dealloc]):
(-[WebPolicyDecisionListener usePolicy:]):
(-[WebPolicyDecisionListener _initWithTarget:action:]):
(-[WebPolicyDecisionListener dealloc]):
(-[WebPolicyDecisionListener _invalidate]):
* WebView.subproj/WebControllerPolicyDelegatePrivate.h: Added.
* WebView.subproj/WebDefaultPolicyDelegate.m:
(-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
* WebView.subproj/WebFrame.m:
(-[WebFrame stopLoading]):
* WebView.subproj/WebFramePrivate.h:
* WebView.subproj/WebFramePrivate.m:
(-[WebFramePrivate dealloc]):
(-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]):
(-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]):
(-[WebFrame _continueAfterNavigationPolicy:]):
(-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
(-[WebFrame _loadDataSource:withLoadType:]):
WebBrowser:
Make navigation policy asynchronous.
* BrowserWebController.m:
(-[BrowserWebController decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 07bc112..d09975c 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,32 @@
2002-11-15 Maciej Stachowiak <mjs at apple.com>
+ Make navigation policy asynchronous for real.
+
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebControllerPolicyDelegate.h:
+ * WebView.subproj/WebControllerPolicyDelegate.m:
+ (-[WebPolicyDecisionListenerPrivate initWithTarget:action:]):
+ (-[WebPolicyDecisionListenerPrivate dealloc]):
+ (-[WebPolicyDecisionListener usePolicy:]):
+ (-[WebPolicyDecisionListener _initWithTarget:action:]):
+ (-[WebPolicyDecisionListener dealloc]):
+ (-[WebPolicyDecisionListener _invalidate]):
+ * WebView.subproj/WebControllerPolicyDelegatePrivate.h: Added.
+ * WebView.subproj/WebDefaultPolicyDelegate.m:
+ (-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame stopLoading]):
+ * WebView.subproj/WebFramePrivate.h:
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFramePrivate dealloc]):
+ (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]):
+ (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]):
+ (-[WebFrame _continueAfterNavigationPolicy:]):
+ (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
+ (-[WebFrame _loadDataSource:withLoadType:]):
+
+2002-11-15 Maciej Stachowiak <mjs at apple.com>
+
Wrap content policy invocation to look asynchronous.
* WebView.subproj/WebBaseResourceHandleDelegate.h:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 07bc112..d09975c 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,32 @@
2002-11-15 Maciej Stachowiak <mjs at apple.com>
+ Make navigation policy asynchronous for real.
+
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebControllerPolicyDelegate.h:
+ * WebView.subproj/WebControllerPolicyDelegate.m:
+ (-[WebPolicyDecisionListenerPrivate initWithTarget:action:]):
+ (-[WebPolicyDecisionListenerPrivate dealloc]):
+ (-[WebPolicyDecisionListener usePolicy:]):
+ (-[WebPolicyDecisionListener _initWithTarget:action:]):
+ (-[WebPolicyDecisionListener dealloc]):
+ (-[WebPolicyDecisionListener _invalidate]):
+ * WebView.subproj/WebControllerPolicyDelegatePrivate.h: Added.
+ * WebView.subproj/WebDefaultPolicyDelegate.m:
+ (-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]):
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame stopLoading]):
+ * WebView.subproj/WebFramePrivate.h:
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFramePrivate dealloc]):
+ (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]):
+ (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]):
+ (-[WebFrame _continueAfterNavigationPolicy:]):
+ (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]):
+ (-[WebFrame _loadDataSource:withLoadType:]):
+
+2002-11-15 Maciej Stachowiak <mjs at apple.com>
+
Wrap content policy invocation to look asynchronous.
* WebView.subproj/WebBaseResourceHandleDelegate.h:
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index bbba680..1fd8ee0 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -301,6 +301,7 @@
83413E8E0375BCD3004719BE,
83413E8F0375BCD3004719BE,
9316400E0379832D008635CE,
+ 658CF8C103851FB5008C2A4B,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -1476,6 +1477,18 @@
settings = {
};
};
+ 658CF8C003851FB5008C2A4B = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = WebControllerPolicyDelegatePrivate.h;
+ refType = 4;
+ };
+ 658CF8C103851FB5008C2A4B = {
+ fileRef = 658CF8C003851FB5008C2A4B;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
//650
//651
//652
@@ -2120,6 +2133,7 @@
6523FAD0032DA06B005EFCFF,
5152FAD7033FC44A00CA2ACD,
5152FAD8033FC44A00CA2ACD,
+ 658CF8C003851FB5008C2A4B,
5152FADD033FC50400CA2ACD,
5152FADE033FC50400CA2ACD,
5152FADF033FC50400CA2ACD,
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
index aa79398..f0b762c 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
@@ -67,6 +67,8 @@ typedef enum {
WebPolicyDecisionListenerPrivate *_private;
}
+-(void)usePolicy:(WebPolicyAction) policy;
+
@end
@@ -82,16 +84,17 @@ typedef enum {
@protocol WebControllerPolicyDelegate <NSObject>
/*!
- @method navigationPolicyForAction:andRequest:inFrame:
+ @method decideNavigationPolicyForAction:andRequest:inFrame:
@discussion Called right after the user clicks on a link.
@param actionInformation Dictionary that describes the action that triggered this navigation.
@param andRequest The request for the proposed navigation
@param frame The frame in which the navigation is taking place
- @result The WebPolicyAction for WebKit to implement
+ @param listener The object to call when the decision is made
*/
-- (WebPolicyAction)navigationPolicyForAction:(NSDictionary *)actionInformation
- andRequest:(WebResourceRequest *)request
- inFrame:(WebFrame *)frame;
+- (void)decideNavigationPolicyForAction:(NSDictionary *)actionInformation
+ andRequest:(WebResourceRequest *)request
+ inFrame:(WebFrame *)frame
+ decisionListener:(WebPolicyDecisionListener *)listener;
/*!
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.m b/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
index d6fbebc..cab4b0d 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
@@ -4,9 +4,80 @@
*/
#import <WebKit/WebControllerPolicyDelegate.h>
+#import <WebKit/WebControllerPolicyDelegatePrivate.h>
NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
NSString *WebActionElementKey = @"WebActionNavigationTypeKey";
NSString *WebActionButtonKey = @"WebActionButtonKey";
NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
+
+
+ at interface WebPolicyDecisionListenerPrivate : NSObject
+{
+ at public
+ id target;
+ SEL action;
+}
+
+-(id)initWithTarget:(id)target action:(SEL)action;
+
+ at end
+
+ at implementation WebPolicyDecisionListenerPrivate
+
+-(id)initWithTarget:(id)t action:(SEL)a
+{
+ self = [super init];
+ if (self != nil) {
+ target = [t retain];
+ action = a;
+ }
+ return self;
+}
+
+-(void)dealloc
+{
+ [target release];
+ [super dealloc];
+}
+
+ at end
+
+ at implementation WebPolicyDecisionListener
+
+-(void)usePolicy:(WebPolicyAction)policy
+{
+ if (_private->target != nil) {
+ [_private->target performSelector:_private->action withObject:(id)policy];
+ }
+}
+
+ at end
+
+ at implementation WebPolicyDecisionListener (WebPrivate)
+
+-(id)_initWithTarget:(id)target action:(SEL)action
+{
+ self = [super init];
+ if (self != nil) {
+ _private = [[WebPolicyDecisionListenerPrivate alloc] initWithTarget:target action:action];
+ }
+ return self;
+}
+
+-(void)dealloc
+{
+ [_private release];
+ [super dealloc];
+}
+
+-(void)_invalidate
+{
+ [self retain];
+ [_private->target release];
+ _private->target = nil;
+ [self release];
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h
new file mode 100644
index 0000000..e1a1fe3
--- /dev/null
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h
@@ -0,0 +1,15 @@
+/*
+ WebControllerPolicyDelegatePrivate.h
+ Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+
+#import <WebKit/WebControllerPolicyDelegate.h>
+
+ at interface WebPolicyDecisionListener (WebPrivate)
+
+-(id)_initWithTarget:(id)target action:(SEL)action;
+
+-(void)_invalidate;
+
+ at end
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
index 19ab04a..069305c 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
@@ -55,14 +55,15 @@
return nil;
}
-- (WebPolicyAction)navigationPolicyForAction:(NSDictionary *)actionInformation
- andRequest:(WebResourceRequest *)request
- inFrame:(WebFrame *)frame
+- (void)decideNavigationPolicyForAction:(NSDictionary *)actionInformation
+ andRequest:(WebResourceRequest *)request
+ inFrame:(WebFrame *)frame
+ decisionListener:(WebPolicyDecisionListener *)listener
{
- if([WebResourceHandle canInitWithRequest:request]){
- return WebPolicyUse;
+ if ([WebResourceHandle canInitWithRequest:request]) {
+ [listener usePolicy:WebPolicyUse];
}else{
- return WebPolicyOpenURL;
+ [listener usePolicy:WebPolicyOpenURL];
}
}
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index f3b8b19..2b81fb0 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -112,6 +112,8 @@
- (void)stopLoading
{
+ [self _invalidatePendingPolicyDecisionCallingDefaultAction:YES];
+
if (_private->state != WebFrameStateComplete) {
[_private->provisionalDataSource stopLoading];
[_private->dataSource stopLoading];
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 44ee540..a346a5e 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -64,6 +64,11 @@ typedef enum {
// (only known when navigating to a pre-existing BF item)
WebHistoryItem *previousItem; // BF item for previous content, see _itemForSavingDocState
BOOL instantRedirectComing;
+
+ WebPolicyDecisionListener *listener;
+ WebResourceRequest *policyRequest;
+ id policyTarget;
+ SEL policySelector;
}
- (void)setName:(NSString *)name;
@@ -109,8 +114,9 @@ typedef enum {
- (void)_checkNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource andCall:(id)target withSelector:(SEL)selector;
+- (void)_invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call;
+
- (NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event;
-- (BOOL)_continueAfterNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource;
- (void)_goToItem: (WebHistoryItem *)item withLoadType: (WebFrameLoadType)type;
- (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType triggeringEvent:(NSEvent *)event isFormSubmission:(BOOL)isFormSubmission;
- (void)_loadURL:(NSURL *)URL intoChild:(WebFrame *)childFrame;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 988a473..1769ffe 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -10,6 +10,7 @@
#import <WebKit/WebBridge.h>
#import <WebKit/WebController.h>
#import <WebKit/WebControllerPolicyDelegate.h>
+#import <WebKit/WebControllerPolicyDelegatePrivate.h>
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebDataSource.h>
#import <WebKit/WebDataSourcePrivate.h>
@@ -74,6 +75,10 @@ static const char * const stateNames[] = {
[provisionalItem release];
[previousItem release];
+ ASSERT(listener == nil);
+ ASSERT(policyRequest == nil);
+ ASSERT(policyTarget == nil);
+
[super dealloc];
}
@@ -915,13 +920,29 @@ static const char * const stateNames[] = {
forKey:WebActionNavigationTypeKey];
}
-- (void)_checkNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource andCall:(id)target withSelector:(SEL)selector
+- (void) _invalidatePendingPolicyDecisionCallingDefaultAction:(BOOL)call
{
- BOOL shouldContinue = [self _continueAfterNavigationPolicyForRequest:request dataSource:dataSource];
- [target performSelector:selector withObject:(id)(unsigned)shouldContinue withObject:request];
+ [_private->listener _invalidate];
+ [_private->listener release];
+ _private->listener = nil;
+
+ WebResourceRequest *request = _private->policyRequest;
+ id target = _private->policyTarget;
+ SEL selector = _private->policySelector;
+
+ _private->policyRequest = nil;
+ _private->policyTarget = nil;
+ _private->policySelector = nil;
+
+ if (call) {
+ [target performSelector:selector withObject:(id)NO withObject:request];
+ }
+
+ [_private->policyRequest release];
+ [_private->policyTarget release];
}
--(BOOL)_continueAfterNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource
+- (void)_checkNavigationPolicyForRequest:(WebResourceRequest *)request dataSource:(WebDataSource *)dataSource andCall:(id)target withSelector:(SEL)selector
{
NSDictionary *action = [dataSource _triggeringAction];
if (action == nil) {
@@ -931,14 +952,31 @@ static const char * const stateNames[] = {
// Don't ask more than once for the same request
if ([request isEqual:[dataSource _lastCheckedRequest]]) {
- return YES;
+ [target performSelector:selector withObject:(id)YES withObject:request];
}
[dataSource _setLastCheckedRequest:request];
- WebPolicyAction policy = [[[self controller] policyDelegate] navigationPolicyForAction:action
- andRequest:request
- inFrame:self];
+ _private->policyRequest = [request retain];
+ _private->policyTarget = [target retain];
+ _private->policySelector = selector;
+ _private->listener = [[WebPolicyDecisionListener alloc] _initWithTarget:self action:@selector(_continueAfterNavigationPolicy:)];
+
+ [[[self controller] policyDelegate] decideNavigationPolicyForAction:action
+ andRequest:request
+ inFrame:self
+ decisionListener:_private->listener];
+}
+
+-(void)_continueAfterNavigationPolicy:(WebPolicyAction)policy
+{
+ WebResourceRequest *request = [[_private->policyRequest retain] autorelease];
+ id target = [[_private->policyTarget retain] autorelease];
+ SEL selector = _private->policySelector;
+
+ [self _invalidatePendingPolicyDecisionCallingDefaultAction:NO];
+
+ BOOL shouldContinue = NO;
switch (policy) {
case WebPolicyIgnore:
@@ -946,11 +984,11 @@ static const char * const stateNames[] = {
case WebPolicyOpenURL:
if ([[request URL] isFileURL]) {
if(![[NSWorkspace sharedWorkspace] openFile:[[request URL] path]]){
- [[dataSource webFrame] _handleUnimplementablePolicy:policy errorCode:WebErrorCannotFindApplicationForFile forURL:[request URL]];
+ [self _handleUnimplementablePolicy:policy errorCode:WebErrorCannotFindApplicationForFile forURL:[request URL]];
}
} else {
if(![[NSWorkspace sharedWorkspace] openURL:[request URL]]){
- [[dataSource webFrame] _handleUnimplementablePolicy:policy errorCode:WebErrorCannotNotFindApplicationForURL forURL:[request URL]];
+ [self _handleUnimplementablePolicy:policy errorCode:WebErrorCannotNotFindApplicationForURL forURL:[request URL]];
}
}
break;
@@ -974,19 +1012,18 @@ static const char * const stateNames[] = {
case WebPolicyUse:
if (![WebResourceHandle canInitWithRequest:request]) {
[self _handleUnimplementablePolicy:policy errorCode:WebErrorCannotShowURL forURL:[request URL]];
+ } else {
+ shouldContinue = YES;
}
- return YES;
-
+ break;
default:
[NSException raise:NSInvalidArgumentException
format:@"clickPolicyForElement:button:modifierFlags: returned an invalid WebClickPolicy"];
}
- return NO;
+ [target performSelector:selector withObject:(id)(unsigned)shouldContinue withObject:request];
}
-
-
-(void)_continueFragmentScrollAfterNavigationPolicy:(BOOL)shouldContinue request:(WebResourceRequest *)request
{
if (!shouldContinue) {
@@ -1043,6 +1080,9 @@ static const char * const stateNames[] = {
WebDataSource *dataSrc = [self dataSource];
[dataSrc _setTriggeringAction:action];
+
+ [self _invalidatePendingPolicyDecisionCallingDefaultAction:YES];
+
[self _checkNavigationPolicyForRequest:request dataSource:dataSrc andCall:self withSelector:@selector(_continueFragmentScrollAfterNavigationPolicy:request:)];
} else {
WebFrameLoadType previousLoadType = [self _loadType];
@@ -1298,9 +1338,7 @@ static const char * const stateNames[] = {
// KDE drop we should fix this dependency.
ASSERT([self webView] != nil);
- if ([self _state] != WebFrameStateComplete) {
- [self stopLoading];
- }
+ [self stopLoading];
[self _setLoadType:loadType];
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.h b/WebKit/WebView.subproj/WebPolicyDelegate.h
index aa79398..f0b762c 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.h
@@ -67,6 +67,8 @@ typedef enum {
WebPolicyDecisionListenerPrivate *_private;
}
+-(void)usePolicy:(WebPolicyAction) policy;
+
@end
@@ -82,16 +84,17 @@ typedef enum {
@protocol WebControllerPolicyDelegate <NSObject>
/*!
- @method navigationPolicyForAction:andRequest:inFrame:
+ @method decideNavigationPolicyForAction:andRequest:inFrame:
@discussion Called right after the user clicks on a link.
@param actionInformation Dictionary that describes the action that triggered this navigation.
@param andRequest The request for the proposed navigation
@param frame The frame in which the navigation is taking place
- @result The WebPolicyAction for WebKit to implement
+ @param listener The object to call when the decision is made
*/
-- (WebPolicyAction)navigationPolicyForAction:(NSDictionary *)actionInformation
- andRequest:(WebResourceRequest *)request
- inFrame:(WebFrame *)frame;
+- (void)decideNavigationPolicyForAction:(NSDictionary *)actionInformation
+ andRequest:(WebResourceRequest *)request
+ inFrame:(WebFrame *)frame
+ decisionListener:(WebPolicyDecisionListener *)listener;
/*!
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.m b/WebKit/WebView.subproj/WebPolicyDelegate.m
index d6fbebc..cab4b0d 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.m
@@ -4,9 +4,80 @@
*/
#import <WebKit/WebControllerPolicyDelegate.h>
+#import <WebKit/WebControllerPolicyDelegatePrivate.h>
NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
NSString *WebActionElementKey = @"WebActionNavigationTypeKey";
NSString *WebActionButtonKey = @"WebActionButtonKey";
NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
+
+
+ at interface WebPolicyDecisionListenerPrivate : NSObject
+{
+ at public
+ id target;
+ SEL action;
+}
+
+-(id)initWithTarget:(id)target action:(SEL)action;
+
+ at end
+
+ at implementation WebPolicyDecisionListenerPrivate
+
+-(id)initWithTarget:(id)t action:(SEL)a
+{
+ self = [super init];
+ if (self != nil) {
+ target = [t retain];
+ action = a;
+ }
+ return self;
+}
+
+-(void)dealloc
+{
+ [target release];
+ [super dealloc];
+}
+
+ at end
+
+ at implementation WebPolicyDecisionListener
+
+-(void)usePolicy:(WebPolicyAction)policy
+{
+ if (_private->target != nil) {
+ [_private->target performSelector:_private->action withObject:(id)policy];
+ }
+}
+
+ at end
+
+ at implementation WebPolicyDecisionListener (WebPrivate)
+
+-(id)_initWithTarget:(id)target action:(SEL)action
+{
+ self = [super init];
+ if (self != nil) {
+ _private = [[WebPolicyDecisionListenerPrivate alloc] initWithTarget:target action:action];
+ }
+ return self;
+}
+
+-(void)dealloc
+{
+ [_private release];
+ [super dealloc];
+}
+
+-(void)_invalidate
+{
+ [self retain];
+ [_private->target release];
+ _private->target = nil;
+ [self release];
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h b/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h
new file mode 100644
index 0000000..e1a1fe3
--- /dev/null
+++ b/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h
@@ -0,0 +1,15 @@
+/*
+ WebControllerPolicyDelegatePrivate.h
+ Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+
+#import <WebKit/WebControllerPolicyDelegate.h>
+
+ at interface WebPolicyDecisionListener (WebPrivate)
+
+-(id)_initWithTarget:(id)target action:(SEL)action;
+
+-(void)_invalidate;
+
+ at end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list