From baaab31631dcff6075418c95f0220e8fb207dd50 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 15 Jul 2016 13:16:24 +0200 Subject: Adaptations to Chromium 52 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idf8a511ba26d263fd9d014d87d5e1101d706da71 Reviewed-by: Michael BrĂ¼ning --- src/core/url_request_context_getter_qt.cpp | 39 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'src/core/url_request_context_getter_qt.cpp') diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index 42c8db280..4ca2c4b60 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -226,7 +226,7 @@ void URLRequestContextGetterQt::generateStorage() m_storage->set_cert_verifier(net::CertVerifier::CreateDefault()); - scoped_ptr host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); + std::unique_ptr host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); // The System Proxy Resolver has issues on Windows with unconfigured network cards, // which is why we want to use the v8 one @@ -234,7 +234,7 @@ void URLRequestContextGetterQt::generateStorage() m_dhcpProxyScriptFetcherFactory.reset(new net::DhcpProxyScriptFetcherFactory); m_storage->set_proxy_service(net::CreateProxyServiceUsingV8ProxyResolver( - scoped_ptr(proxyConfigService), + std::unique_ptr(proxyConfigService), new net::ProxyScriptFetcherImpl(m_urlRequestContext.get()), m_dhcpProxyScriptFetcherFactory->Create(m_urlRequestContext.get()), host_resolver.get(), @@ -242,10 +242,10 @@ void URLRequestContextGetterQt::generateStorage() m_networkDelegate.get())); m_storage->set_ssl_config_service(new net::SSLConfigServiceDefaults); - m_storage->set_transport_security_state(scoped_ptr(new net::TransportSecurityState())); + m_storage->set_transport_security_state(std::unique_ptr(new net::TransportSecurityState())); m_storage->set_http_auth_handler_factory(net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get())); - m_storage->set_http_server_properties(scoped_ptr(new net::HttpServerPropertiesImpl)); + m_storage->set_http_server_properties(std::unique_ptr(new net::HttpServerPropertiesImpl)); // Give |m_storage| ownership at the end in case it's |mapped_host_resolver|. m_storage->set_host_resolver(std::move(host_resolver)); @@ -284,7 +284,7 @@ void URLRequestContextGetterQt::generateCookieStore() } m_storage->set_channel_id_service( - scoped_ptr(new net::ChannelIDService( + base::WrapUnique(new net::ChannelIDService( new net::DefaultChannelIDStore(channel_id_db.get()), base::WorkerPool::GetTaskRunner(true)))); @@ -292,7 +292,7 @@ void URLRequestContextGetterQt::generateCookieStore() m_storage->set_cookie_store(0); m_cookieDelegate->setCookieMonster(0); - scoped_ptr cookieStore; + std::unique_ptr cookieStore; switch (m_persistentCookiesPolicy) { case BrowserContextAdapter::NoPersistentCookies: cookieStore = @@ -324,6 +324,7 @@ void URLRequestContextGetterQt::generateCookieStore() } net::CookieMonster * const cookieMonster = static_cast(cookieStore.get()); + cookieStore->SetChannelIDServiceID(m_urlRequestContext->channel_id_service()->GetUniqueID()); m_storage->set_cookie_store(std::move(cookieStore)); const std::vector cookieableSchemes(kCookieableSchemes, kCookieableSchemes + arraysize(kCookieableSchemes)); @@ -354,7 +355,7 @@ void URLRequestContextGetterQt::generateUserAgent() QMutexLocker lock(&m_mutex); m_updateUserAgent = true; - m_storage->set_http_user_agent_settings(scoped_ptr( + m_storage->set_http_user_agent_settings(std::unique_ptr( new net::StaticHttpUserAgentSettings(m_httpAcceptLanguage.toStdString(), m_httpUserAgent.toStdString()))); } @@ -482,9 +483,9 @@ void URLRequestContextGetterQt::generateHttpCache() m_httpNetworkSession.reset(new net::HttpNetworkSession(network_session_params)); } - cache = new net::HttpCache(m_httpNetworkSession.get(), scoped_ptr(main_backend), false); + cache = new net::HttpCache(m_httpNetworkSession.get(), std::unique_ptr(main_backend), false); - m_storage->set_http_transaction_factory(scoped_ptr(cache)); + m_storage->set_http_transaction_factory(std::unique_ptr(cache)); } void URLRequestContextGetterQt::clearHttpCache() @@ -513,36 +514,36 @@ void URLRequestContextGetterQt::generateJobFactory() QMutexLocker lock(&m_mutex); m_updateJobFactory = false; - scoped_ptr jobFactory(new net::URLRequestJobFactoryImpl()); + std::unique_ptr jobFactory(new net::URLRequestJobFactoryImpl()); { // Chromium has a few protocol handlers ready for us, only pick blob: and throw away the rest. content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(url::kBlobScheme); Q_ASSERT(it != m_protocolHandlers.end()); - jobFactory->SetProtocolHandler(it->first, scoped_ptr(it->second.release())); + jobFactory->SetProtocolHandler(it->first, std::unique_ptr(it->second.release())); m_protocolHandlers.clear(); } - jobFactory->SetProtocolHandler(url::kDataScheme, scoped_ptr(new net::DataProtocolHandler())); - jobFactory->SetProtocolHandler(url::kFileScheme, scoped_ptr(new net::FileProtocolHandler( + jobFactory->SetProtocolHandler(url::kDataScheme, std::unique_ptr(new net::DataProtocolHandler())); + jobFactory->SetProtocolHandler(url::kFileScheme, std::unique_ptr(new net::FileProtocolHandler( content::BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); - jobFactory->SetProtocolHandler(kQrcSchemeQt, scoped_ptr(new QrcProtocolHandlerQt())); + jobFactory->SetProtocolHandler(kQrcSchemeQt, std::unique_ptr(new QrcProtocolHandlerQt())); jobFactory->SetProtocolHandler(url::kFtpScheme, - scoped_ptr(new net::FtpProtocolHandler(new net::FtpNetworkLayer(m_urlRequestContext->host_resolver())))); + std::unique_ptr(new net::FtpProtocolHandler(new net::FtpNetworkLayer(m_urlRequestContext->host_resolver())))); m_installedCustomSchemes = m_customUrlSchemes; Q_FOREACH (const QByteArray &scheme, m_installedCustomSchemes) { - jobFactory->SetProtocolHandler(scheme.toStdString(), scoped_ptr(new CustomProtocolHandler(m_browserContext))); + jobFactory->SetProtocolHandler(scheme.toStdString(), std::unique_ptr(new CustomProtocolHandler(m_browserContext))); } m_baseJobFactory = jobFactory.get(); // Set up interceptors in the reverse order. - scoped_ptr topJobFactory = std::move(jobFactory); + std::unique_ptr topJobFactory = std::move(jobFactory); for (content::URLRequestInterceptorScopedVector::reverse_iterator i = m_requestInterceptors.rbegin(); i != m_requestInterceptors.rend(); ++i) - topJobFactory.reset(new net::URLRequestInterceptingJobFactory(std::move(topJobFactory), make_scoped_ptr(*i))); + topJobFactory.reset(new net::URLRequestInterceptingJobFactory(std::move(topJobFactory), std::unique_ptr(*i))); m_requestInterceptors.weak_clear(); @@ -570,7 +571,7 @@ void URLRequestContextGetterQt::regenerateJobFactory() m_installedCustomSchemes = m_customUrlSchemes; Q_FOREACH (const QByteArray &scheme, m_installedCustomSchemes) { - m_baseJobFactory->SetProtocolHandler(scheme.toStdString(), scoped_ptr(new CustomProtocolHandler(m_browserContext))); + m_baseJobFactory->SetProtocolHandler(scheme.toStdString(), std::unique_ptr(new CustomProtocolHandler(m_browserContext))); } } -- cgit v1.2.3