[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:03:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 322dc458ef00382953a403749ff1eee3fb6c2e6a
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Oct 20 20:35:49 2003 +0000
Fixed: <rdar://problem/3457627>: empty Flash plugin at tvguide.com
Fixed issues with plug-in stream error handling.
Improved plug-in logging.
Reviewed by kocienda.
* Misc.subproj/WebKitLogging.h: added WebKitLogPluginEvents
* Misc.subproj/WebKitLogging.m:
* Plugins.subproj/WebBaseNetscapePluginStream.h:
* Plugins.subproj/WebBaseNetscapePluginStream.m:
(-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): improved logging
(-[WebBaseNetscapePluginStream destroyStream]): improved logging
(-[WebBaseNetscapePluginStream destroyStreamWithFailingReason:]): renamed from cancelWithReason to avoid confusion
(-[WebBaseNetscapePluginStream receivedError:]): calls destroyStreamWithFailingReason after determining a reason from the NSError
(-[WebBaseNetscapePluginStream cancelWithReason:]): calls destroyStreamWithFailingReason, this method is overriden by subclasses to cancel the actual load
(-[WebBaseNetscapePluginStream finishedLoadingWithData:]): call destroyStreamWithFailingReason, not cancelWithReason because the loaded has already ended here
(-[WebBaseNetscapePluginStream deliverData]): improved logging
* Plugins.subproj/WebBaseNetscapePluginView.m:
(-[WebBaseNetscapePluginView sendActivateEvent:]): use even logging
(-[WebBaseNetscapePluginView sendUpdateEvent]): ditto
(-[WebBaseNetscapePluginView becomeFirstResponder]): ditto
(-[WebBaseNetscapePluginView resignFirstResponder]): ditto
(-[WebBaseNetscapePluginView mouseDown:]): ditto
(-[WebBaseNetscapePluginView mouseUp:]): ditto
(-[WebBaseNetscapePluginView mouseEntered:]): ditto
(-[WebBaseNetscapePluginView mouseExited:]): ditto
(TSMEventHandler): ditto
(-[WebBaseNetscapePluginView destroyStream:reason:]): call cancelWithReason so the reason is passed back to the plug-in
* Plugins.subproj/WebNetscapePluginDocumentView.m:
(-[WebNetscapePluginDocumentView setDataSource:]): tweak
* Plugins.subproj/WebNetscapePluginRepresentation.m:
(-[WebNetscapePluginRepresentation receivedError:withDataSource:]): call receivedError
(-[WebNetscapePluginRepresentation cancelWithReason:]): override, cancel the load, call super
* Plugins.subproj/WebNetscapePluginStream.m:
(-[WebNetscapePluginStream cancelWithReason:]): override, cancel the load, call super
(-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): be sure to call the stream before calling super because the stream can be cleared out when calling super
(-[WebNetscapePluginConnectionDelegate connection:didReceiveData:lengthReceived:]): ditto
(-[WebNetscapePluginConnectionDelegate connectionDidFinishLoading:]): ditto
(-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): ditto
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f181c69..504a991 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,45 @@
+2003-10-20 Chris Blumenberg <cblu at apple.com>
+
+ Fixed: <rdar://problem/3457627>: empty Flash plugin at tvguide.com
+ Fixed issues with plug-in stream error handling.
+ Improved plug-in logging.
+
+ Reviewed by kocienda.
+
+ * Misc.subproj/WebKitLogging.h: added WebKitLogPluginEvents
+ * Misc.subproj/WebKitLogging.m:
+ * Plugins.subproj/WebBaseNetscapePluginStream.h:
+ * Plugins.subproj/WebBaseNetscapePluginStream.m:
+ (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): improved logging
+ (-[WebBaseNetscapePluginStream destroyStream]): improved logging
+ (-[WebBaseNetscapePluginStream destroyStreamWithFailingReason:]): renamed from cancelWithReason to avoid confusion
+ (-[WebBaseNetscapePluginStream receivedError:]): calls destroyStreamWithFailingReason after determining a reason from the NSError
+ (-[WebBaseNetscapePluginStream cancelWithReason:]): calls destroyStreamWithFailingReason, this method is overriden by subclasses to cancel the actual load
+ (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): call destroyStreamWithFailingReason, not cancelWithReason because the loaded has already ended here
+ (-[WebBaseNetscapePluginStream deliverData]): improved logging
+ * Plugins.subproj/WebBaseNetscapePluginView.m:
+ (-[WebBaseNetscapePluginView sendActivateEvent:]): use even logging
+ (-[WebBaseNetscapePluginView sendUpdateEvent]): ditto
+ (-[WebBaseNetscapePluginView becomeFirstResponder]): ditto
+ (-[WebBaseNetscapePluginView resignFirstResponder]): ditto
+ (-[WebBaseNetscapePluginView mouseDown:]): ditto
+ (-[WebBaseNetscapePluginView mouseUp:]): ditto
+ (-[WebBaseNetscapePluginView mouseEntered:]): ditto
+ (-[WebBaseNetscapePluginView mouseExited:]): ditto
+ (TSMEventHandler): ditto
+ (-[WebBaseNetscapePluginView destroyStream:reason:]): call cancelWithReason so the reason is passed back to the plug-in
+ * Plugins.subproj/WebNetscapePluginDocumentView.m:
+ (-[WebNetscapePluginDocumentView setDataSource:]): tweak
+ * Plugins.subproj/WebNetscapePluginRepresentation.m:
+ (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): call receivedError
+ (-[WebNetscapePluginRepresentation cancelWithReason:]): override, cancel the load, call super
+ * Plugins.subproj/WebNetscapePluginStream.m:
+ (-[WebNetscapePluginStream cancelWithReason:]): override, cancel the load, call super
+ (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): be sure to call the stream before calling super because the stream can be cleared out when calling super
+ (-[WebNetscapePluginConnectionDelegate connection:didReceiveData:lengthReceived:]): ditto
+ (-[WebNetscapePluginConnectionDelegate connectionDidFinishLoading:]): ditto
+ (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): ditto
+
2003-10-20 Richard Williamson <rjw at apple.com>
Conditionally excluded fix for 3446192. We'll enable the fix once 3446669
diff --git a/WebKit/Misc.subproj/WebKitLogging.h b/WebKit/Misc.subproj/WebKitLogging.h
index 752b0fe..c7ebe25 100644
--- a/WebKit/Misc.subproj/WebKitLogging.h
+++ b/WebKit/Misc.subproj/WebKitLogging.h
@@ -33,3 +33,4 @@ extern WebLogChannel WebKitLogEncoding;
extern WebLogChannel WebKitLogLiveConnect;
extern WebLogChannel WebKitLogBackForward;
extern WebLogChannel WebKitLogProgress;
+extern WebLogChannel WebKitLogPluginEvents;
diff --git a/WebKit/Misc.subproj/WebKitLogging.m b/WebKit/Misc.subproj/WebKitLogging.m
index 2a8bc59..148526b 100644
--- a/WebKit/Misc.subproj/WebKitLogging.m
+++ b/WebKit/Misc.subproj/WebKitLogging.m
@@ -29,4 +29,5 @@ WebLogChannel WebKitLogEncoding = { 0x04000000, "WebKitLogLevel",
WebLogChannel WebKitLogLiveConnect = { 0x08000000, "WebKitLogLevel", WebLogChannelUninitialized };
WebLogChannel WebKitLogBackForward = { 0x10000000, "WebKitLogLevel", WebLogChannelUninitialized };
WebLogChannel WebKitLogProgress = { 0x20000000, "WebKitLogLevel", WebLogChannelUninitialized };
+WebLogChannel WebKitLogPluginEvents = { 0x40000000, "WebKitLogLevel", WebLogChannelUninitialized };
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
index eff20b6..853fbca 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.h
@@ -41,8 +41,9 @@
MIMEType:(NSString *)MIMEType;
- (void)startStreamWithResponse:(NSURLResponse *)r;
- (void)receivedData:(NSData *)data;
-- (void)cancelWithReason:(NPReason)theReason;
- (void)finishedLoadingWithData:(NSData *)data;
+- (void)receivedError:(NSError *)error;
+- (void)cancelWithReason:(NPReason)theReason;
- (uint16)transferMode;
@end
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
index ff3e59d..5bddc73 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
@@ -90,7 +90,7 @@
// FIXME: Need a way to check if stream is seekable
NPError npErr = NPP_NewStream(instance, (char *)[MIMEType cString], &stream, NO, &transferMode);
- LOG(Plugins, "NPP_NewStream: %d %@", npErr, URL);
+ LOG(Plugins, "NPP_NewStream URL=%@ MIME=%@ error=%d", URL, MIMEType, npErr);
if (npErr != NPERR_NO_ERROR) {
ERROR("NPP_NewStream failed with error: %d URLString: %s", npErr, [URL _web_URLCString]);
@@ -136,18 +136,18 @@
ASSERT(path != NULL);
NSString *carbonPath = [[NSFileManager defaultManager] _web_carbonPathForPath:[NSString stringWithCString:path]];
NPP_StreamAsFile(instance, &stream, [carbonPath cString]);
- LOG(Plugins, "NPP_StreamAsFile: %@", carbonPath);
+ LOG(Plugins, "NPP_StreamAsFile URL=%@ path=%@", URL, carbonPath);
}
NPError npErr;
npErr = NPP_DestroyStream(instance, &stream, reason);
- LOG(Plugins, "NPP_DestroyStream: %d", npErr);
+ LOG(Plugins, "NPP_DestroyStream URL=%@ error=%d", URL, npErr);
stream.ndata = nil;
if (notifyData) {
NPP_URLNotify(instance, [URL _web_URLCString], reason, notifyData);
- LOG(Plugins, "NPP_URLNotify");
+ LOG(Plugins, "NPP_URLNotify URL=%@ reason=%d", URL, reason);
}
}
@@ -157,14 +157,29 @@
[self destroyStream];
}
-- (void)cancelWithReason:(NPReason)theReason
+- (void)destroyStreamWithFailingReason:(NPReason)theReason
{
+ ASSERT(theReason != NPRES_DONE);
// Stop any pending data from being streamed.
[deliveryData setLength:0];
[self destroyStreamWithReason:theReason];
stream.ndata = nil;
}
+- (void)receivedError:(NSError *)error
+{
+ if ([[error domain] isEqualToString:NSURLErrorDomain] && [error code] == NSURLErrorCancelled) {
+ [self destroyStreamWithFailingReason:NPRES_USER_BREAK];
+ } else {
+ [self destroyStreamWithFailingReason:NPRES_NETWORK_ERR];
+ }
+}
+
+- (void)cancelWithReason:(NPReason)theReason
+{
+ [self destroyStreamWithFailingReason:theReason];
+}
+
- (void)finishedLoadingWithData:(NSData *)data
{
if (![plugin isLoaded] || !stream.ndata) {
@@ -178,7 +193,7 @@
// This should almost never happen.
ERROR("can't make temporary file, almost certainly a problem with /tmp");
// This is not a network error, but the only error codes are "network error" and "user break".
- [self cancelWithReason:NPRES_NETWORK_ERR];
+ [self destroyStreamWithFailingReason:NPRES_NETWORK_ERR];
free(path);
path = NULL;
return;
@@ -191,7 +206,7 @@
ERROR("error writing to temporary file, errno %d", errno);
close(fd);
// This is not a network error, but the only error codes are "network error" and "user break".
- [self cancelWithReason:NPRES_NETWORK_ERR];
+ [self destroyStreamWithFailingReason:NPRES_NETWORK_ERR];
free(path);
path = NULL;
return;
@@ -214,7 +229,7 @@
while (totalBytesDelivered < totalBytes) {
int32 deliveryBytes = NPP_WriteReady(instance, &stream);
- LOG(Plugins, "NPP_WriteReady bytes=%d", deliveryBytes);
+ LOG(Plugins, "NPP_WriteReady URL=%@ bytes=%d", URL, deliveryBytes);
if (deliveryBytes <= 0) {
// Plug-in can't receive anymore data right now. Send it later.
@@ -225,9 +240,9 @@
NSData *subdata = [deliveryData subdataWithRange:NSMakeRange(totalBytesDelivered, deliveryBytes)];
deliveryBytes = NPP_Write(instance, &stream, offset, [subdata length], (void *)[subdata bytes]);
deliveryBytes = MIN((unsigned)deliveryBytes, [subdata length]);
- LOG(Plugins, "NPP_Write bytes=%d", deliveryBytes);
offset += deliveryBytes;
totalBytesDelivered += deliveryBytes;
+ LOG(Plugins, "NPP_Write URL=%@ bytes=%d total-delivered=%d/%d", URL, deliveryBytes, offset, stream.end);
}
}
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index bb99efd..e986cfc 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -359,7 +359,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent;
acceptedEvent = [self sendEvent:&event];
- LOG(Plugins, "NPP_HandleEvent(activateEvent): %d isActive: %d", acceptedEvent, activate);
+ LOG(PluginEvents, "NPP_HandleEvent(activateEvent): %d isActive: %d", acceptedEvent, activate);
}
- (BOOL)sendUpdateEvent
@@ -373,7 +373,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent = [self sendEvent:&event];
- LOG(Plugins, "NPP_HandleEvent(updateEvt): %d", acceptedEvent);
+ LOG(PluginEvents, "NPP_HandleEvent(updateEvt): %d", acceptedEvent);
return acceptedEvent;
}
@@ -467,7 +467,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent;
acceptedEvent = [self sendEvent:&event];
- LOG(Plugins, "NPP_HandleEvent(getFocusEvent): %d", acceptedEvent);
+ LOG(PluginEvents, "NPP_HandleEvent(getFocusEvent): %d", acceptedEvent);
[self installKeyEventHandler];
@@ -484,7 +484,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent;
acceptedEvent = [self sendEvent:&event];
- LOG(Plugins, "NPP_HandleEvent(loseFocusEvent): %d", acceptedEvent);
+ LOG(PluginEvents, "NPP_HandleEvent(loseFocusEvent): %d", acceptedEvent);
[self removeKeyEventHandler];
@@ -513,7 +513,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent;
acceptedEvent = [self sendEvent:&event];
- LOG(Plugins, "NPP_HandleEvent(mouseDown): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h);
+ LOG(PluginEvents, "NPP_HandleEvent(mouseDown): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h);
}
- (void)mouseUp:(NSEvent *)theEvent
@@ -526,7 +526,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent;
acceptedEvent = [self sendEvent:&event];
- LOG(Plugins, "NPP_HandleEvent(mouseUp): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h);
+ LOG(PluginEvents, "NPP_HandleEvent(mouseUp): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h);
}
- (void)mouseEntered:(NSEvent *)theEvent
@@ -539,7 +539,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent;
acceptedEvent = [self sendEvent:&event];
- LOG(Plugins, "NPP_HandleEvent(mouseEntered): %d", acceptedEvent);
+ LOG(PluginEvents, "NPP_HandleEvent(mouseEntered): %d", acceptedEvent);
}
- (void)mouseExited:(NSEvent *)theEvent
@@ -552,7 +552,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent;
acceptedEvent = [self sendEvent:&event];
- LOG(Plugins, "NPP_HandleEvent(mouseExited): %d", acceptedEvent);
+ LOG(PluginEvents, "NPP_HandleEvent(mouseExited): %d", acceptedEvent);
// Set cursor back to arrow cursor.
[[NSCursor arrowCursor] set];
@@ -612,7 +612,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
BOOL acceptedEvent;
acceptedEvent = [(WebBaseNetscapePluginView *)pluginView sendEvent:&eventRec];
- LOG(Plugins, "NPP_HandleEvent(keyDown): %d charCode:%c keyCode:%lu",
+ LOG(PluginEvents, "NPP_HandleEvent(keyDown): %d charCode:%c keyCode:%lu",
acceptedEvent, (char) (eventRec.message & charCodeMask), (eventRec.message & keyCodeMask));
// We originally thought that if the plug-in didn't accept this event,
@@ -1480,7 +1480,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
if (!stream->ndata) {
return NPERR_INVALID_INSTANCE_ERROR;
}
- [(WebNetscapePluginStream *)stream->ndata stop];
+ [(WebBaseNetscapePluginStream *)stream->ndata cancelWithReason:reason];
return NPERR_NO_ERROR;
}
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginDocumentView.m b/WebKit/Plugins.subproj/WebNetscapePluginDocumentView.m
index 5e60c33..1467263 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginDocumentView.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginDocumentView.m
@@ -78,8 +78,7 @@
WebNetscapePluginPackage *thePlugin;
thePlugin = (WebNetscapePluginPackage *)[[WebPluginDatabase installedPlugins] pluginForMIMEType:MIME];
- if (![thePlugin load]){
- // FIXME: It would be nice to stop the load here.
+ if (![thePlugin load]) {
NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorCannotLoadPlugin
contentURL:[[theDataSource request] URL]
pluginPageURL:nil
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginRepresentation.m b/WebKit/Plugins.subproj/WebNetscapePluginRepresentation.m
index 9f2a14f..97b9a95 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginRepresentation.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginRepresentation.m
@@ -63,17 +63,13 @@
return;
}
- if ([error code] == NSURLErrorCancelled) {
- [self cancelWithReason:NPRES_USER_BREAK];
- } else {
- [self cancelWithReason:NPRES_NETWORK_ERR];
- }
+ [self receivedError:error];
}
-- (void)cancelWithReason:(NPReason)theReason;
+- (void)cancelWithReason:(NPReason)theReason
{
[[_dataSource webFrame] stopLoading];
- [super cancelWithReason:NPRES_USER_BREAK];
+ [super cancelWithReason:theReason];
}
- (void)finishedLoadingWithDataSource:(WebDataSource *)ds
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginStream.m b/WebKit/Plugins.subproj/WebNetscapePluginStream.m
index 51a5e37..ad0d1b9 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginStream.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginStream.m
@@ -65,10 +65,10 @@
_startingRequest = nil;
}
-- (void)cancelWithReason:(NPReason)cancelWithReason
+- (void)cancelWithReason:(NPReason)theReason
{
[_loader cancel];
- [super cancelWithReason:cancelWithReason];
+ [super cancelWithReason:theReason];
}
- (void)stop
@@ -104,7 +104,7 @@
{
// retain/release self in this delegate method since the additional processing can do
// anything including possibly releasing self; one example of this is 3266216
- [self retain];
+ [self retain];
[stream startStreamWithResponse:theResponse];
[super connection:con didReceiveResponse:theResponse];
if ([theResponse isKindOfClass:[NSHTTPURLResponse class]] &&
@@ -112,8 +112,8 @@
NSError *error = [NSError _webKitErrorWithDomain:NSURLErrorDomain
code:NSURLErrorFileDoesNotExist
URL:[theResponse URL]];
+ [stream receivedError:error];
[self cancelWithError:error];
- [stream cancelWithReason:NPRES_NETWORK_ERR];
}
[self release];
}
@@ -127,26 +127,26 @@
[resourceData appendData:data];
}
- [super connection:con didReceiveData:data lengthReceived:lengthReceived];
[stream receivedData:data];
+ [super connection:con didReceiveData:data lengthReceived:lengthReceived];
[self release];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)con
{
[[view webView] _finishedLoadingResourceFromDataSource:[view dataSource]];
- [super connectionDidFinishLoading:con];
[stream finishedLoadingWithData:resourceData];
+ [super connectionDidFinishLoading:con];
}
-- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)result
+- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)error
{
// retain/release self in this delegate method since the additional processing can do
// anything including possibly releasing self; one example of this is 3266216
[self retain];
- [[view webView] _receivedError:result fromDataSource:[view dataSource]];
- [super connection:con didFailWithError:result];
- [stream cancelWithReason:NPRES_NETWORK_ERR];
+ [[view webView] _receivedError:error fromDataSource:[view dataSource]];
+ [stream receivedError:error];
+ [super connection:con didFailWithError:error];
[self release];
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list