Commit 6d927229 authored by cblu's avatar cblu

Fixed: 3104183 - Assert loading www.louisvuitton.com

	We need to treat plug-in streams like subresources except they don't change the loading state of the data source.

        * Plugins.subproj/WebNetscapePluginStream.m:
        (-[WebNetscapePluginStream start]): call _addPluginStream
        (-[WebNetscapePluginStream cancel]): call _removePluginStream
        (-[WebNetscapePluginStream handleDidFinishLoading:]): call _removePluginStream
        (-[WebNetscapePluginStream handle:didFailLoadingWithError:]): call _removePluginStream
        * WebView.subproj/WebDataSourcePrivate.h:
        * WebView.subproj/WebDataSourcePrivate.m:
        (-[WebDataSourcePrivate dealloc]): release pluginStreams
        (-[WebDataSource _addPluginStream:]): just like addSubresourceClient except don't change the loading state.
        (-[WebDataSource _removePluginStream:]): just like removeSubresourceClient except don't change the loading state.
        (-[WebDataSource _stopLoading]): stop plug-ins streams
        (-[WebDataSource _makeHandleDelegates:deferCallbacks:]):
        (-[WebDataSource _defersCallbacksChanged]): call _makeHandleDelegates:deferCallbacks: for subresources and plug-in streams.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 401641ee
2002-11-18 Chris Blumenberg <cblu@apple.com>
Fixed: 3104183 - Assert loading www.louisvuitton.com
We need to treat plug-in streams like subresources except they don't change the loading state of the data source.
* Plugins.subproj/WebNetscapePluginStream.m:
(-[WebNetscapePluginStream start]): call _addPluginStream
(-[WebNetscapePluginStream cancel]): call _removePluginStream
(-[WebNetscapePluginStream handleDidFinishLoading:]): call _removePluginStream
(-[WebNetscapePluginStream handle:didFailLoadingWithError:]): call _removePluginStream
* WebView.subproj/WebDataSourcePrivate.h:
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSourcePrivate dealloc]): release pluginStreams
(-[WebDataSource _addPluginStream:]): just like addSubresourceClient except don't change the loading state.
(-[WebDataSource _removePluginStream:]): just like removeSubresourceClient except don't change the loading state.
(-[WebDataSource _stopLoading]): stop plug-ins streams
(-[WebDataSource _makeHandleDelegates:deferCallbacks:]):
(-[WebDataSource _defersCallbacksChanged]): call _makeHandleDelegates:deferCallbacks: for subresources and plug-in streams.
2002-11-18 Richard Williamson <rjw@apple.com>
Check for usesBackForwardList was excluding all load types.
......
2002-11-18 Chris Blumenberg <cblu@apple.com>
Fixed: 3104183 - Assert loading www.louisvuitton.com
We need to treat plug-in streams like subresources except they don't change the loading state of the data source.
* Plugins.subproj/WebNetscapePluginStream.m:
(-[WebNetscapePluginStream start]): call _addPluginStream
(-[WebNetscapePluginStream cancel]): call _removePluginStream
(-[WebNetscapePluginStream handleDidFinishLoading:]): call _removePluginStream
(-[WebNetscapePluginStream handle:didFailLoadingWithError:]): call _removePluginStream
* WebView.subproj/WebDataSourcePrivate.h:
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSourcePrivate dealloc]): release pluginStreams
(-[WebDataSource _addPluginStream:]): just like addSubresourceClient except don't change the loading state.
(-[WebDataSource _removePluginStream:]): just like removeSubresourceClient except don't change the loading state.
(-[WebDataSource _stopLoading]): stop plug-ins streams
(-[WebDataSource _makeHandleDelegates:deferCallbacks:]):
(-[WebDataSource _defersCallbacksChanged]): call _makeHandleDelegates:deferCallbacks: for subresources and plug-in streams.
2002-11-18 Richard Williamson <rjw@apple.com>
Check for usesBackForwardList was excluding all load types.
......
......@@ -4,6 +4,7 @@
*/
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebKitLogging.h>
#import <WebKit/WebNetscapePluginEmbeddedView.h>
#import <WebKit/WebNetscapePluginStream.h>
......@@ -46,7 +47,9 @@ - (void)dealloc
- (void)start
{
ASSERT(_startingRequest);
[self loadWithRequest:_startingRequest];
if([self loadWithRequest:_startingRequest]){
[[view dataSource] _addPluginStream:self];
}
[_startingRequest release];
_startingRequest = nil;
}
......@@ -60,6 +63,7 @@ - (void)stop
- (void)cancel
{
[[view dataSource] _removePluginStream:self];
[view release];
view = nil;
......@@ -95,6 +99,7 @@ - (void)handleDidFinishLoading:(WebResourceHandle *)h
[controller _finishedLoadingResourceFromDataSource:[view dataSource]];
[self finishedLoadingWithData:resourceData];
[[view dataSource] _removePluginStream:self];
[view release];
view = nil;
......@@ -109,6 +114,7 @@ - (void)handle:(WebResourceHandle *)h didFailLoadingWithError:(WebError *)result
[self receivedError:NPRES_NETWORK_ERR];
[[view dataSource] _removePluginStream:self];
[view release];
view = nil;
......
......@@ -11,6 +11,7 @@
@class WebIconLoader;
@class WebMainResourceClient;
@class WebNetscapePluginStream;
@class WebResourceHandle;
@class WebResourceRequest;
@class WebResourceResponse;
......@@ -37,6 +38,9 @@
// Clients for other resources.
NSMutableArray *subresourceClients;
// Plugin streams are like subresources except that they don't affect the loading state of the datasource.
NSMutableArray *pluginStreams;
// The time when the data source was told to start loading.
double loadingStartedTime;
......@@ -100,6 +104,8 @@
- (void)_recursiveStopLoading;
- (void)_addSubresourceClient:(WebSubresourceClient *)client;
- (void)_removeSubresourceClient:(WebSubresourceClient *)client;
- (void)_addPluginStream:(WebNetscapePluginStream *)stream;
- (void)_removePluginStream:(WebNetscapePluginStream *)stream;
- (void)_setPrimaryLoadComplete:(BOOL)flag;
- (double)_loadingStartedTime;
- (void)_setTitle:(NSString *)title;
......
......@@ -23,6 +23,7 @@
#import <WebKit/WebKitLogging.h>
#import <WebKit/WebLocationChangeDelegate.h>
#import <WebKit/WebMainResourceClient.h>
#import <WebKit/WebNetscapePluginStream.h>
#import <WebKit/WebSubresourceClient.h>
#import <WebKit/WebTextRepresentation.h>
#import <WebKit/WebViewPrivate.h>
......@@ -51,6 +52,7 @@ - (void)dealloc
[originalRequest release];
[mainClient release];
[subresourceClients release];
[pluginStreams release];
[pageTitle release];
[response release];
[mainDocumentError release];
......@@ -189,6 +191,24 @@ - (void)_removeSubresourceClient:(WebSubresourceClient *)client
[self _updateLoading];
}
// Plugin streams are like subresources except that they don't affect the loading state of the datasource.
- (void)_addPluginStream:(WebNetscapePluginStream *)stream
{
if (_private->pluginStreams == nil) {
_private->pluginStreams = [[NSMutableArray alloc] init];
}
if ([_private->controller _defersCallbacks]) {
[stream setDefersCallbacks:YES];
}
[_private->pluginStreams addObject:stream];
}
- (void)_removePluginStream:(WebNetscapePluginStream *)stream
{
[_private->pluginStreams removeObject:stream];
}
- (BOOL)_isStopping
{
return _private->stopping;
......@@ -208,6 +228,10 @@ - (void)_stopLoading
[clients makeObjectsPerformSelector:@selector(cancel)];
[clients release];
NSArray *streams = [_private->pluginStreams copy];
[streams makeObjectsPerformSelector:@selector(cancel)];
[streams release];
if (_private->committed) {
[[self _bridge] closeURL];
}
......@@ -519,6 +543,16 @@ - (void)_setIconURL:(NSURL *)URL withType:(NSString *)iconType
_private->iconURL = [URL retain];
}
- (void)_makeHandleDelegates:(NSArray *)handleDelegates deferCallbacks:(BOOL)deferCallbacks
{
NSEnumerator *e = [handleDelegates objectEnumerator];
WebBaseResourceHandleDelegate *delegate;
while ((delegate = [e nextObject])) {
[delegate setDefersCallbacks:deferCallbacks];
}
}
- (void)_defersCallbacksChanged
{
BOOL defers = [_private->controller _defersCallbacks];
......@@ -529,11 +563,9 @@ - (void)_defersCallbacksChanged
_private->defersCallbacks = defers;
[_private->mainClient setDefersCallbacks:defers];
NSEnumerator *e = [_private->subresourceClients objectEnumerator];
WebSubresourceClient *client;
while ((client = [e nextObject])) {
[client setDefersCallbacks:defers];
}
[self _makeHandleDelegates:_private->subresourceClients deferCallbacks:defers];
[self _makeHandleDelegates:_private->pluginStreams deferCallbacks:defers];
[[[self webFrame] children] makeObjectsPerformSelector:@selector(_defersCallbacksChanged)];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment