Skip to content
  • kocienda's avatar
    WebFoundation: · b10c9d76
    kocienda authored
    	Big set of changes to move the code closer to the proposed WebFoundation API. Major work includes:
    
    	- Implemented new callbacks for WebResourceHandleDelegate. All delegates of WebResourceHandle
    	  were updated to reflect this change.
    
    	- Modified the way WebProtocolHandler creates protocol-specific responses.
    
    	- Move WebResourceHandle API much closer to the final proposal. The public API on this class
    	  is very thin now. Some private methods are still available to code inside Intrigue (to ease
    	  the transition), and the dependencies on these private methods will be reduced over time.
    
    	- WebResourceRequest and WebResourceResponse classes are now closer to their proposed APIs, but
    	  work remains to be done with them.
    
    	- Synchronous loading code received a large rewrite.
    
    	And an extra:
    
    	- Sped up implementation of file protocol handler. This protocol handler no longer kicks a thread for each file load.
    
            * CacheLoader.subproj/IFHTTPURLHandleC.h:
            * CacheLoader.subproj/IFHTTPURLHandleC.m:
            (IFHTTPURLHandleGetRequestMethod)
            (IFHTTPURLHandleGetRequestHeaders)
            * CacheLoader.subproj/IFURLHandleC.m:
            (IFURLHandleBackgroundLoadFailedWithResultCode)
            (IFURLHandleGetURL)
            (IFURLHandleGetCanonicalURL)
            (IFURLHandleGetStatusCode)
            (IFURLHandleGetResultCode)
            (IFURLHandleGetContentType)
            (IFURLHandleGetError)
            (IFURLHandleGetContentLength)
            (IFURLHandleGetContentLengthReceived)
            (IFURLHandleGetPercentComplete)
            * CacheLoader.subproj/WebMemoryCache.m:
            (-[WebMemoryCache _truncateToSizeLimit])
            * CacheLoader.subproj/WebProtocolHandler.h:
            * CacheLoader.subproj/WebProtocolHandler.m:
            (-[WebProtocolHandler responseClass])
            (-[WebProtocolHandler responseMetadataAvailable])
            (-[WebProtocolHandler setResponseMetadata:])
            * CacheLoader.subproj/WebResourceCallbackClient.m:
            (-[WebResourceCallbackClient handle:willSendRequest:])
            (-[WebResourceCallbackClient handle:didReceiveResponse:])
            * CacheLoader.subproj/WebResourceHandle.h:
            * CacheLoader.subproj/WebResourceHandle.m:
            (+[WebResourceHandle sendSynchronousRequest:])
            (-[WebResourceHandle initWithRequest:delegate:])
            * CacheLoader.subproj/WebResourceHandleDelegate.h:
            * CacheLoader.subproj/WebResourceHandleInternal.h:
            * CacheLoader.subproj/WebResourceHandleInternal.m:
            (-[WebResourceHandleInstanceVariables prepareCallbacks])
            (-[WebResourceHandleInstanceVariables dealloc])
            (-[WebResourceHandle _loadInBackground])
            (-[WebResourceHandle _sendCallbacks])
            (-[WebResourceHandle _notifyClientWillSendRequest])
            (-[WebResourceHandle _notifyClientDidReceiveResponse])
            (-[WebResourceHandle _notifyClientDataDidBecomeAvailable])
            (-[WebResourceHandle _notifyClientDidFailLoading])
            (-[WebResourceHandle _notifyClientDidFinishLoading])
            * CacheLoader.subproj/WebResourceHandlePrivate.h:
            * CacheLoader.subproj/WebResourceHandlePrivate.m:
            (-[WebResourceHandle _didReceiveResponseMetadata:])
            (-[WebResourceHandle _backgroundLoadComplete])
            (-[WebResourceHandle _backgroundLoadFailed])
            (-[WebResourceHandle _didRedirectToURL:])
            (-[WebResourceHandle _request])
            (-[WebResourceHandle _response])
            (-[WebResourceHandle _redirectedURL])
            * CacheLoader.subproj/WebResourceLoad.h:
            * CacheLoader.subproj/WebResourceLoad.m:
            (-[WebResourceLoad initWithRequest:])
            (-[WebResourceLoad didLoadBytes:length:])
            (-[WebResourceLoad succeeded])
            (-[WebResourceLoad failedWithResultCode:inDomain:failingURL:])
            (-[WebResourceLoad addHandle:])
            (-[WebResourceLoad cacheObjectCheckingRedirects:])
            (-[WebResourceLoad didRedirectToURL:permanent:])
            (-[WebResourceLoad originalRequest])
            (-[WebResourceLoad _beginLoad])
            (-[WebResourceLoad _cacheKey])
            (-[WebResourceLoad description])
            (-[WebResourceLoad dealloc])
            * CacheLoader.subproj/WebResourceLoadManager.m:
            (+[WebResourceLoadKey keyWithHandle:])
            (+[WebResourceLoadKey keyWithLoad:])
            (-[WebResourceLoadKey hash])
            (-[WebResourceLoadManager requestWithURLHandle:])
            * CacheLoader.subproj/WebResourceLoadQueue.m:
            (-[WebResourceLoadQueue put:])
            * CacheLoader.subproj/WebResourceRequest.h:
            * CacheLoader.subproj/WebResourceRequest.m:
            (-[WebResourceRequest initWithURL:])
            (-[WebResourceRequest canonicalURL])
            (-[WebResourceRequest protocolHandlerClass])
            (-[WebResourceRequest copyWithZone:])
            (-[WebResourceRequest copyWithURL:])
            * CacheLoader.subproj/WebResourceResponse.m:
            (-[WebResourceResponse contentType])
            * CacheLoader.subproj/WebResourceSynchronousClient.h:
            * CacheLoader.subproj/WebResourceSynchronousClient.m:
            (-[WebResourceHandleSynchronousDelegate initWithRequest:monitor:])
            (-[WebResourceHandleSynchronousDelegate dealloc])
            (-[WebResourceHandleSynchronousDelegate run:])
            (-[WebResourceHandleSynchronousDelegate started])
            (-[WebResourceHandleSynchronousDelegate handle])
            (-[WebResourceHandleSynchronousDelegate response])
            (-[WebResourceHandleSynchronousDelegate result])
            (-[WebResourceHandleSynchronousDelegate handle:willSendRequest:])
            (-[WebResourceHandleSynchronousDelegate handleDidFinishLoading:])
            (-[WebResourceHandleSynchronousDelegate handle:didReceiveResponse:])
            (-[WebResourceHandleSynchronousDelegate handle:didReceiveData:])
            * Misc.subproj/WebFoundation.h:
            * Misc.subproj/WebFoundationLogging.h:
            * Misc.subproj/WebFoundationLogging.m:
            * Misc.subproj/WebNSStringExtras.m:
            (-[NSString _web_isCaseInsensitiveEqualToString:]
            * ProtocolHandlers.subproj/WebAboutProtocolHandler.h:
            * ProtocolHandlers.subproj/WebAboutProtocolHandler.m:
            (-[WebAboutProtocolHandler beginLoad])
            (-[WebAboutProtocolHandler responseClass])
            (-[WebAboutProtocolHandler responseMetadataAvailable])
            (-[WebAboutProtocolHandler setResponseMetadata:])
            * ProtocolHandlers.subproj/WebCFNetworkHTTPProtocolHandler.m:
            (-[WebCFNetworkHTTPProtocolHandler addAuthenticationHeaders:andCall:])
            (-[WebCFNetworkHTTPProtocolHandler continueAfterBytesAvailable])
            (-[WebCFNetworkHTTPProtocolHandler handleReadStreamEvent:event:])
            (-[WebCFNetworkHTTPProtocolHandler performHTTPHeaderRead:andCall:])
            * ProtocolHandlers.subproj/WebFileProtocolHandler.h:
            * ProtocolHandlers.subproj/WebFileProtocolHandler.m:
            (-[WebFileProtocolHandler initWithResourceLoad:])
            (-[WebFileProtocolHandler dealloc])
            (-[WebFileProtocolHandler didLoadData:])
            (-[WebFileProtocolHandler beginLoad])
            (-[WebFileProtocolHandler endLoad])
            (-[WebFileProtocolHandler responseClass])
            (-[WebFileProtocolHandler responseMetadataAvailable])
            (-[WebFileProtocolHandler setResponseMetadata:])
            * ProtocolHandlers.subproj/WebHTTPProtocolHandler.m:
            (-[WebHTTPProtocolHandler responseClass])
            (-[WebHTTPProtocolHandler responseMetadataAvailable])
            (-[WebHTTPProtocolHandler setResponseMetadata:])
            (-[WebHTTPProtocolHandler shouldCacheResponse:])
            (-[WebHTTPProtocolHandler URL])
            (-[WebHTTPProtocolHandler retryWithRedirectedURLAndResultCode:])
            * ProtocolHandlers.subproj/WebSimpleHTTPProtocolHandler.m:
            (-[WebSimpleHTTPProtocolHandler createHTTPRequest])
            (-[WebSimpleHTTPProtocolHandler _examineHeaders])
            * WebFoundation.exp
            * WebFoundation.pbproj/project.pbxproj
    
    WebKit:
    
    	Many changes to coincide with API work in WebFoundation. Most of the modifications
    	here have to do with changes for the new callback scheme.
    
            * Misc.subproj/WebIconLoader.m:
            (-[WebIconLoader handleDidFinishLoading:])
            (-[WebIconLoader handle:willSendRequest:]): New method. A no-op here.
            (-[WebIconLoader handle:didReceiveResponse:]): Ditto.
            * Plugins.subproj/WebBaseNetscapePluginView.m:
            (-[WebBaseNetscapePluginView stop]): Fix for Deployment build breakage.
            * Plugins.subproj/WebPluginStream.h: Add response ivar.
            * Plugins.subproj/WebPluginStream.m:
            (-[WebNetscapePluginStream startLoad]): Tweak method name for new API.
            (-[WebNetscapePluginStream receivedData:withHandle:]):
            (-[WebNetscapePluginStream handle:willSendRequest:]): New method. Replaces old redirect callback.
            (-[WebNetscapePluginStream handle:didReceiveResponse:]): New method. Set the response ivar.
            * WebCoreSupport.subproj/WebSubresourceClient.h: Add response ivar.
            * WebCoreSupport.subproj/WebSubresourceClient.m:
            (-[WebSubresourceClient dealloc]): Release response ivar.
            (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Set the request user agent here.
            (-[WebSubresourceClient handle:willSendRequest:]): New method. Handle like a redirect.
            (-[WebSubresourceClient handle:didReceiveResponse:]): New method. Set the response ivar.
            (-[WebSubresourceClient handle:didReceiveData:]): Tweaks for new WebFoundation API and method names.
            (-[WebSubresourceClient handleDidFinishLoading:]): Ditto.
            (-[WebSubresourceClient handle:didFailLoadingWithError:]): Ditto.
            * WebView.subproj/WebControllerPrivate.m:
            (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): Ditto.
            * WebView.subproj/WebDataSourcePrivate.h: Add _setRequest method.
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _startLoading]): Call didStartLoadingWithURL with request URL instead of handle URL.
            (-[WebDataSource _setRequest:]): Add implementation.
            * WebView.subproj/WebLoadProgress.m:
            (-[WebLoadProgress initWithResourceHandle:]): Tweaks for new WebFoundation API and method names.
            * WebView.subproj/WebMainResourceClient.h: Add response ivar.
            * WebView.subproj/WebMainResourceClient.m:
            (-[WebMainResourceClient initWithDataSource:]): Set user agent on request here.
            (-[WebMainResourceClient dealloc]): Release response ivar.
            (-[WebMainResourceClient didCancelWithHandle:]): Tweaks for new WebFoundation API and method names.
            (-[WebMainResourceClient handleDidFinishLoading:]): Tweaks for new WebFoundation API and method names.
            (-[WebMainResourceClient handle:willSendRequest:]): New method. Handle like a redirect.
            (-[WebMainResourceClient handle:didReceiveResponse:]): New method. Set the response ivar.
            (-[WebMainResourceClient handle:didReceiveData:]): Tweaks for new WebFoundation API and method names.
            (-[WebMainResourceClient handle:didFailLoadingWithError:]): Ditto.
    
    WebBrowser:
    
    	Updated a couple methods to reflect changes in WebFoundation API names.
    
            * BrowserWebController.m:
            (-[BrowserWebController receivedProgress:forResourceHandle:fromDataSource:complete:]): Call for the URL on the handles response
    	instead of the URL of the handle itself.
            (-[BrowserWebController receivedError:forResourceHandle:partialProgress:fromDataSource:]): Ditto.
            * DownloadMonitor.m:
            (-[DownloadMonitor receivedError:forResourceHandle:partialProgress:fromDataSource:]): Request accessor for handle
    	is now private; reflect that in method name (i.e. add an underscore).
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b10c9d76