Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
MRJURLConnection Class Reference
Collaboration diagram for MRJURLConnection:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MRJURLConnection (JMTextRef url, JMTextRef requestMethod, JMURLConnectionOptions options, JMAppletViewerRef appletViewer)
 ~MRJURLConnection ()
MRJPluginInstancegetInstance ()
const char * getURL ()
const char * getRequestMethod ()
Boolean getUsingProxy ()

Private Attributes

MRJPluginInstancemInstance
char * mURL
char * mRequestMethod
JMURLConnectionOptions mOptions
Boolean mUsingProxy

Detailed Description

Definition at line 165 of file MRJNetworking.cpp.


Constructor & Destructor Documentation

MRJURLConnection::MRJURLConnection ( JMTextRef  url,
JMTextRef  requestMethod,
JMURLConnectionOptions  options,
JMAppletViewerRef  appletViewer 
)

Definition at line 186 of file MRJNetworking.cpp.

    :   mInstance(0), mURL(0), mRequestMethod(0), mOptions(options), mUsingProxy(false)
{
    MRJPluginInstance* instance = MRJPluginInstance::getInstances();
    if (appletViewer != NULL) {
        while (instance != NULL) {
            MRJContext* context = instance->getContext();
            if (context->getViewerRef() == appletViewer) {
                mInstance = instance;
                break;
            }
            instance = instance->getNextInstance();
        }
    } else {
        // any instance will do?
        mInstance = instance;
        NS_IF_ADDREF(instance);
    }
    
    TextEncoding utf8 = ::CreateTextEncoding(kTextEncodingUnicodeDefault,
                                             kTextEncodingDefaultVariant,
                                             kUnicodeUTF8Format);
    
    // pull the text out of the url and requestMethod.
    mURL = ::JMTextToEncoding(url, utf8);
    mRequestMethod = ::JMTextToEncoding(requestMethod, utf8);
    
    // see if a proxy will be used for this URL.
    if (thePluginManager2 != NULL) {
        char* proxyForURL = NULL;
        if (thePluginManager2->FindProxyForURL(mURL, &proxyForURL) == NS_OK) {
            mUsingProxy = (::strcmp("DIRECT", proxyForURL) != 0);
            delete[] proxyForURL;
        }
    }
}

Here is the call graph for this function:

Definition at line 225 of file MRJNetworking.cpp.

{
    delete[] mURL;
    delete[] mRequestMethod;
}

Member Function Documentation

Definition at line 231 of file MRJNetworking.cpp.

{
    return mInstance;
}

Here is the caller graph for this function:

Definition at line 241 of file MRJNetworking.cpp.

{
    return mRequestMethod;
}
const char * MRJURLConnection::getURL ( ) [inline]

Definition at line 236 of file MRJNetworking.cpp.

{
    return mURL;
}

Here is the caller graph for this function:

Definition at line 246 of file MRJNetworking.cpp.

{
    return mUsingProxy;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 179 of file MRJNetworking.cpp.

Definition at line 182 of file MRJNetworking.cpp.

Definition at line 181 of file MRJNetworking.cpp.

char* MRJURLConnection::mURL [private]

Definition at line 180 of file MRJNetworking.cpp.

Definition at line 183 of file MRJNetworking.cpp.


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