webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Instance Methods | Class Methods | Protected Member Functions | Protected Attributes | Properties | List of all members
WebDataSource Class Reference

#import <WebDataSource.h>

Inheritance diagram for WebDataSource:
IWebDataSource IWebDataSourcePrivate NSObject

Instance Methods

(instancetype) - initWithRequest:
 
(WebResource *) - subresourceForURL:
 
(void- addSubresource:
 
(virtual HRESULT STDMETHODCALLTYPE) - QueryInterface
 
(virtual ULONG STDMETHODCALLTYPE) - AddRef
 
(virtual ULONG STDMETHODCALLTYPE) - Release
 
(virtual HRESULT STDMETHODCALLTYPE) - initWithRequest
 
(virtual HRESULT STDMETHODCALLTYPE) - data
 
(virtual HRESULT STDMETHODCALLTYPE) - representation
 
(virtual HRESULT STDMETHODCALLTYPE) - webFrame
 
(virtual HRESULT STDMETHODCALLTYPE) - initialRequest
 
(virtual HRESULT STDMETHODCALLTYPE) - request
 
(virtual HRESULT STDMETHODCALLTYPE) - response
 
(virtual HRESULT STDMETHODCALLTYPE) - textEncodingName
 
(virtual HRESULT STDMETHODCALLTYPE) - isLoading
 
(virtual HRESULT STDMETHODCALLTYPE) - pageTitle
 
(virtual HRESULT STDMETHODCALLTYPE) - unreachableURL
 
(virtual HRESULT STDMETHODCALLTYPE) - webArchive
 
(virtual HRESULT STDMETHODCALLTYPE) - mainResource
 
(virtual HRESULT STDMETHODCALLTYPE) - subresources
 
(virtual HRESULT STDMETHODCALLTYPE) - subresourceForURL
 
(virtual HRESULT STDMETHODCALLTYPE) - addSubresource
 
(virtual HRESULT STDMETHODCALLTYPE) - overrideEncoding
 
(virtual HRESULT STDMETHODCALLTYPE) - setOverrideEncoding
 
(virtual HRESULT STDMETHODCALLTYPE) - mainDocumentError
 
(virtual HRESULT STDMETHODCALLTYPE) - setDeferMainResourceDataLoad
 
(WebDocumentLoader *) - documentLoader
 
- Instance Methods inherited from IWebDataSource
HRESULT initWithRequest ([in] IWebURLRequest *request)
 
HRESULT data ([out, retval] IStream **stream)
 
HRESULT representation ([out, retval] IWebDocumentRepresentation **rep)
 
HRESULT webFrame ([out, retval] IWebFrame **frame)
 
HRESULT initialRequest ([out, retval] IWebURLRequest **request)
 
HRESULT request ([out, retval] IWebMutableURLRequest **request)
 
HRESULT response ([out, retval] IWebURLResponse **response)
 
HRESULT textEncodingName ([out, retval] BSTR *name)
 
HRESULT isLoading ([out, retval] BOOL *loading)
 
HRESULT pageTitle ([out, retval] BSTR *title)
 
HRESULT unreachableURL ([out, retval] BSTR *url)
 
HRESULT webArchive ([out, retval] IWebArchive **archive)
 
HRESULT mainResource ([out, retval] IWebResource **resource)
 
HRESULT subresources ([out, retval] IEnumVARIANT **enumResources)
 
HRESULT subresourceForURL ([in] BSTR url, [out, retval] IWebResource **resource)
 
HRESULT addSubresource ([in] IWebResource *subresource)
 
- Instance Methods inherited from IWebDataSourcePrivate
HRESULT overrideEncoding ([out, retval] BSTR *encoding)
 
HRESULT setOverrideEncoding ([in] BSTR encoding)
 
HRESULT mainDocumentError ([out, retval] IWebError **error)
 

Class Methods

(static WebDataSource *) + createInstance
 

Protected Member Functions

() - WebDataSource
 
() - ~WebDataSource
 

Protected Attributes

package void_private
 
ULONG m_refCount { 0 }
 
RefPtr< WebDocumentLoaderm_loader
 
COMPtr< IWebDocumentRepresentationm_representation
 

Properties

NSDatadata
 
id< WebDocumentRepresentationrepresentation
 
WebFramewebFrame
 
NSURLRequestinitialRequest
 
NSMutableURLRequestrequest
 
NSURLResponseresponse
 
NSStringtextEncodingName
 
BOOL loading
 
NSStringpageTitle
 
NSURLunreachableURL
 
WebArchivewebArchive
 
WebResourcemainResource
 
NSArraysubresources
 

Detailed Description

A WebDataSource represents the data associated with a web page. A datasource has a WebDocumentRepresentation which holds an appropriate representation of the data. WebDataSources manage a hierarchy of WebFrames. WebDataSources are typically related to a view by their containing WebFrame.

Constructor & Destructor Documentation

◆ WebDataSource()

◆ ~WebDataSource()

Method Documentation

◆ AddRef()

- (ULONG) AddRef (void

◆ addSubresource()

- (HRESULT) addSubresource (_In_opt_ IWebResource *) 

◆ addSubresource:()

- (void) addSubresource: (WebResource *)  subresource

addSubresource: Adds a subresource to the data source.

Parameters
subresourceThe subresource to be added. addSubresource: adds a subresource to the data source's list of subresources. Later, if something causes the data source to load the URL of the subresource, the data source will load the data from the subresource instead of from the network. For example, if one wants to add an image that is already downloaded to a web page, addSubresource: can be called so that the data source uses the downloaded image rather than accessing the network. NOTE: If the data source already has a subresource with the same URL, addSubresource: will replace it.

◆ createInstance()

+ (WebDataSource *) createInstance (WebDocumentLoader *)  loader

◆ data()

- (HRESULT) data (_COM_Outptr_opt_ IStream **)  stream

◆ documentLoader()

- (WebDocumentLoader *) documentLoader const

◆ initialRequest()

- (HRESULT) initialRequest (_COM_Outptr_opt_ IWebURLRequest **)  request

◆ initWithRequest()

- (HRESULT) initWithRequest (_In_opt_ IWebURLRequest *) 

◆ initWithRequest:()

- (instancetype) initWithRequest: (NSURLRequest *)  request

initWithRequest: The designated initializer for WebDataSource.

Parameters
requestThe request to use in creating a datasource.
Returns
Returns an initialized WebDataSource.

◆ isLoading()

- (HRESULT) isLoading (_Out_ BOOL *)  loading

Returns YES if there are any pending loads.

◆ mainDocumentError()

- (HRESULT) mainDocumentError (_COM_Outptr_opt_ IWebError **)  error

◆ mainResource()

- (HRESULT) mainResource (_COM_Outptr_opt_ IWebResource **)  resource

◆ overrideEncoding()

- (HRESULT) overrideEncoding (_Deref_opt_out_ BSTR *) 

◆ pageTitle()

- (HRESULT) pageTitle (_Deref_opt_out_ BSTR *)  title

◆ QueryInterface()

- (HRESULT) QueryInterface (_In_ REFIID)  riid
(_COM_Outptr_ void **)  ppvObject 

◆ Release()

- (ULONG) Release (void

◆ representation()

- (HRESULT) representation (_COM_Outptr_opt_ IWebDocumentRepresentation **)  rep

◆ request()

- (HRESULT) request (_COM_Outptr_opt_ IWebMutableURLRequest **)  request

◆ response()

- (HRESULT) response (_COM_Outptr_opt_ IWebURLResponse **)  response

◆ setDeferMainResourceDataLoad()

- (HRESULT) setDeferMainResourceDataLoad (BOOL flag

Implements IWebDataSourcePrivate.

◆ setOverrideEncoding()

- (HRESULT) setOverrideEncoding (_In_)  BSTR

◆ subresourceForURL()

- (HRESULT) subresourceForURL (_In_ BSTR url
(_COM_Outptr_opt_ IWebResource **)  resource 

◆ subresourceForURL:()

- (WebResource *) subresourceForURL: (NSURL *)  URL

method subresourceForURL: Returns a subresource for a given URL.

Parameters
URLThe URL of the subresource. Returns non-nil if the data source has fully downloaded a subresource with the given URL.

◆ subresources()

- (HRESULT) subresources (_COM_Outptr_opt_ IEnumVARIANT **)  enumResources

◆ textEncodingName()

- (HRESULT) textEncodingName (_Deref_opt_out_ BSTR *)  name

◆ unreachableURL()

- (HRESULT) unreachableURL (_Deref_opt_out_ BSTR *)  url

◆ webArchive()

- (HRESULT) webArchive (_COM_Outptr_opt_ IWebArchive **)  archive

◆ webFrame()

- (HRESULT) webFrame (_COM_Outptr_opt_ IWebFrame **)  frame

Member Data Documentation

◆ _private

- (package void*) _private
protected

◆ m_loader

- (RefPtr<WebDocumentLoader>) m_loader
protected

◆ m_refCount

- (ULONG) m_refCount { 0 }
protected

◆ m_representation

- (COMPtr<IWebDocumentRepresentation>) m_representation
protected

Property Documentation

◆ data

- (NSData *) data
readnonatomiccopy

Returns the raw data associated with the datasource. Returns nil if the datasource hasn't loaded any data. The data will be incomplete until the datasource has completely loaded.

◆ initialRequest

- (NSURLRequest *) initialRequest
readnonatomicstrong

A reference to the original request that created the datasource. This request will be unmodified by WebKit.

◆ loading

- (BOOL) loading
readnonatomicassign

◆ mainResource

- (WebResource *) mainResource
readnonatomicstrong

A WebResource representing the data source. This method constructs a WebResource using the original downloaded data. This method can be used to construct a WebArchive in case the archive returned by WebDataSource's webArchive isn't sufficient.

◆ pageTitle

- (NSString *) pageTitle
readnonatomiccopy

The page title or nil.

◆ representation

- (id< WebDocumentRepresentation >) representation
readnonatomicstrong

The representation associated with this datasource. Returns nil if the datasource hasn't created its representation. A representation holds a type specific representation of the datasource's data. The representation class is determined by mapping a MIME type to a class. The representation is created once the MIME type of the datasource content has been determined.

◆ request

- (NSMutableURLRequest *) request
readnonatomicstrong

The request that was used to create this datasource.

◆ response

- (NSURLResponse *) response
readnonatomicstrong

The NSURLResponse for the data source.

◆ subresources

- (NSArray *) subresources
readnonatomiccopy

All the subresources associated with the data source. The returned array only contains subresources that have fully downloaded.

◆ textEncodingName

- (NSString *) textEncodingName
readnonatomiccopy

Returns either the override encoding, as set on the WebView for this dataSource or the encoding from the response.

◆ unreachableURL

- (NSURL *) unreachableURL
readnonatomicstrong

The unreachableURL for which this dataSource is showing alternate content, or nil. This will be non-nil only for dataSources created by calls to the WebFrame method loadAlternateHTMLString:baseURL:forUnreachableURL:.

◆ webArchive

- (WebArchive *) webArchive
readnonatomicstrong

A WebArchive representing the data source, its subresources and child frames. This method constructs a WebArchive using the original downloaded data. In the case of HTML, if the current state of the document is preferred, webArchive should be called on the DOM document instead.

◆ webFrame

- (WebFrame *) webFrame
readnonatomicstrong

The frame that represents this data source.


The documentation for this class was generated from the following files: