コード例 #1
0
WebRequestContext::WebRequestContext(bool isPrivateBrowsing)
    : m_isPrivateBrowsing(isPrivateBrowsing)
{
    // Initialize chromium logging, needs to be done before any chromium code is called.
    initChromium();

    if (m_isPrivateBrowsing) {
        // Delete the old files if this is the first private browsing instance
        // They are probably leftovers from a power cycle
        // We do not need to clear the cache as it is in memory only for private browsing
        if (!numPrivateBrowsingInstances)
            WebCookieJar::cleanup(true);
        numPrivateBrowsingInstances++;
    }

    WebCache* cache = WebCache::get(m_isPrivateBrowsing);
    set_host_resolver(cache->hostResolver());
    set_http_transaction_factory(cache->cache());

    WebCookieJar* cookieJar = WebCookieJar::get(m_isPrivateBrowsing);
    set_cookie_store(cookieJar->cookieStore());
    set_cookie_policy(cookieJar);

    // Also hardcoded in FrameLoader.java
    set_accept_charset("utf-8, iso-8859-1, utf-16, *;q=0.7");
}
コード例 #2
0
WebRequestContext::WebRequestContext(bool isPrivateBrowsing)
    : m_isPrivateBrowsing(isPrivateBrowsing)
{
    // Initialize chromium logging, needs to be done before any chromium code is called.
    initChromium();

    if (m_isPrivateBrowsing) {
        // Delete the old files if this is the first private browsing instance
        // They are probably leftovers from a power cycle
        // We do not need to clear the cache as it is in memory only for private browsing
        if (!numPrivateBrowsingInstances)
            WebCookieJar::cleanup(true);
        numPrivateBrowsingInstances++;
    }

    WebCache* cache = WebCache::get(m_isPrivateBrowsing);
    set_host_resolver(cache->hostResolver());
    set_http_transaction_factory(cache->cache());

    WebCookieJar* cookieJar = WebCookieJar::get(m_isPrivateBrowsing);
    set_cookie_store(cookieJar->cookieStore());
    set_cookie_policy(cookieJar);

    // Also hardcoded in FrameLoader.java
    // SAMSUNG CHANGE >>    
    set_accept_charset("utf-8, iso-8859-1, utf-16, *;q=0.7");
    // Add additional accept charset  to Accept Header (CTC Requirement)
    if(strcmp(SecNativeFeature::getInstance()->getString(CscFeature_Web_AddCharSetToHttpHeader), "") != 0){
        const char *sCscValue = SecNativeFeature::getInstance()->getString(CscFeature_Web_AddCharSetToHttpHeader);
        set_accept_charset(sCscValue);
    }
    // SAMSUNG CHANGE <<
}
コード例 #3
0
WebCache* WebCache::createInstance()
{
    WebCache* instance = new WebCache();
    instance->AddRef();
    return instance;
}