Beispiel #1
0
WebRequest::WebRequest(WebUrlLoaderClient* loader, const WebResourceRequest& webResourceRequest)
    : m_urlLoader(loader)
    , m_url(webResourceRequest.url())
    , m_userAgent(webResourceRequest.userAgent())
    , m_loadState(Created)
    , m_authRequestCount(0)
    , m_cacheMode(0)
    , m_runnableFactory(this)
    , m_wantToPause(false)
    , m_isPaused(false)
    //SAMSUNG_CHANGES >>
    , m_ShouldSniffFeed(false)
    , m_isMainResource(false)
    , m_isMainFrame(false)
    //SAMSUNG_CHANGES <<
    , m_isSync(false)
{
    GURL gurl(m_url);

    m_request = new net::URLRequest(gurl, this);

    m_request->SetExtraRequestHeaders(webResourceRequest.requestHeaders());
    m_request->SetExtraRequestHeaderByName(kXRequestedWithHeader, s_packageName.Get().value, false);
    m_request->set_referrer(webResourceRequest.referrer());
    m_request->set_method(webResourceRequest.method());
    m_request->set_load_flags(webResourceRequest.loadFlags());
    //SAMSUNG_CHANGES >>
    WebCore::Settings* settings = m_urlLoader->frame()->page()?m_urlLoader->frame()->page()->settings():NULL;
    if(settings){
    	m_rssSniffingEnabled = settings->rssSniffingEnabled();
    } else {
        m_rssSniffingEnabled = false;
    }
    //SAMSUNG_CHANGES <<
}
Beispiel #2
0
WebRequest::WebRequest(WebUrlLoaderClient* loader, const WebResourceRequest& webResourceRequest)
    : m_urlLoader(loader)
    , m_url(webResourceRequest.url())
    , m_userAgent(webResourceRequest.userAgent())
    , m_loadState(Created)
    , m_authRequestCount(0)
    , m_cacheMode(0)
    , m_runnableFactory(this)
    , m_wantToPause(false)
    , m_isPaused(false)
    , m_isSync(false)
{
    GURL gurl(m_url);

    m_request = new net::URLRequest(gurl, this);

    m_request->SetExtraRequestHeaders(webResourceRequest.requestHeaders());
    m_request->SetExtraRequestHeaderByName(kXRequestedWithHeader, s_packageName.Get().value, false);
    m_request->set_referrer(webResourceRequest.referrer());
    m_request->set_method(webResourceRequest.method());
    m_request->set_load_flags(webResourceRequest.loadFlags());

    if (ShouldSetRequestPriority())
    {
        ResourceType::Type chromiumTargetType = convertWebkitTargetTypeToChromiumTargetType(webResourceRequest.target_type());
        m_request->set_priority(net::DetermineRequestPriority(chromiumTargetType));
    }
}
static jstring getCookie(JNIEnv* env, jobject, jstring url, jboolean privateBrowsing)
{
    GURL gurl(jstringToStdString(env, url));
    CookieOptions options;
    options.set_include_httponly();
    std::string cookies = WebCookieJar::get(privateBrowsing)->cookieStore()->GetCookieMonster()->GetCookiesWithOptions(gurl, options);
    return stdStringToJstring(env, cookies);
}
static void setCookie(JNIEnv* env, jobject, jstring url, jstring value, jboolean privateBrowsing)
{
    GURL gurl(jstringToStdString(env, url));
    std::string line(jstringToStdString(env, value));
    CookieOptions options;
    options.set_include_httponly();
    WebCookieJar::get(privateBrowsing)->cookieStore()->GetCookieMonster()->SetCookieWithOptions(gurl, line, options);
}
void SocketStreamHandlePrivate::connect()
{
	GURL gurl(m_url);

	base::Thread* thread = WebUrlLoaderClient::ioThread();
	if (thread)
		thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_sockhost.get(), &SocketStreamHost::Connect, gurl));
}
Beispiel #6
0
void WebRequest::sslClientCert(EVP_PKEY* pkey, scoped_refptr<net::X509Certificate> chain)
{
    base::ScopedOpenSSL<EVP_PKEY, EVP_PKEY_free> privateKey(pkey);
    if (privateKey.get() == NULL || chain.get() == NULL) {
        m_request->ContinueWithCertificate(NULL);
        return;
    }
    GURL gurl(m_url);
    net::OpenSSLPrivateKeyStore::GetInstance()->StorePrivateKey(gurl, privateKey.release());
    m_request->ContinueWithCertificate(chain.release());
}
void WebContentsAdapter::load(const QUrl &url)
{
    QString urlString = url.toString();
    GURL gurl(urlString.toStdString());
    if (!gurl.has_scheme())
        gurl = GURL(std::string("http://") + urlString.toStdString());

    content::NavigationController::LoadURLParams params(gurl);
    params.transition_type = content::PageTransitionFromInt(content::PAGE_TRANSITION_TYPED | content::PAGE_TRANSITION_FROM_ADDRESS_BAR);
    webContents()->GetController().LoadURLWithParams(params);
    webContents()->GetView()->Focus();
}