Update cookie store code for Chrome 35

See https://codereview.chromium.org/110883017
This commit is contained in:
Adam Roben 2014-06-26 16:33:39 -04:00
parent afc889b883
commit 51ac56e4c4

View file

@ -34,6 +34,7 @@
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_storage.h" #include "net/url_request/url_request_context_storage.h"
#include "net/url_request/url_request_job_factory_impl.h" #include "net/url_request/url_request_job_factory_impl.h"
#include "webkit/browser/quota/special_storage_policy.h"
namespace brightray { namespace brightray {
@ -74,12 +75,12 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
url_request_context_->set_network_delegate(network_delegate_.get()); url_request_context_->set_network_delegate(network_delegate_.get());
storage_.reset( storage_.reset(
new net::URLRequestContextStorage(url_request_context_.get())); new net::URLRequestContextStorage(url_request_context_.get()));
storage_->set_cookie_store(content::CreatePersistentCookieStore( auto cookie_config = content::CookieStoreConfig(
base_path_.Append(FILE_PATH_LITERAL("Cookies")), base_path_.Append(FILE_PATH_LITERAL("Cookies")),
false, content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
nullptr, nullptr,
nullptr, nullptr);
nullptr)); storage_->set_cookie_store(content::CreateCookieStore(cookie_config));
storage_->set_server_bound_cert_service(new net::ServerBoundCertService( storage_->set_server_bound_cert_service(new net::ServerBoundCertService(
new net::DefaultServerBoundCertStore(NULL), new net::DefaultServerBoundCertStore(NULL),
base::WorkerPool::GetTaskRunner(true))); base::WorkerPool::GetTaskRunner(true)));
@ -157,9 +158,9 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
} }
protocol_handlers_.clear(); protocol_handlers_.clear();
job_factory->SetProtocolHandler( job_factory->SetProtocolHandler(
chrome::kDataScheme, new net::DataProtocolHandler); content::kDataScheme, new net::DataProtocolHandler);
job_factory->SetProtocolHandler( job_factory->SetProtocolHandler(
chrome::kFileScheme, content::kFileScheme,
new net::FileProtocolHandler( new net::FileProtocolHandler(
content::BrowserThread::GetBlockingPool()-> content::BrowserThread::GetBlockingPool()->
GetTaskRunnerWithShutdownBehavior( GetTaskRunnerWithShutdownBehavior(