Fix assertions when building against Debug libchromiumcontent.
Imported from https://github.com/brightray/brightray/pull/50.
This commit is contained in:
parent
dc69c7b694
commit
283aa79c17
4 changed files with 14 additions and 5 deletions
|
@ -61,7 +61,8 @@ AtomURLRequestContextGetter* AtomBrowserContext::CreateRequestContext(
|
|||
GetPath(),
|
||||
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
|
||||
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE),
|
||||
CreateNetworkDelegate().Pass(),
|
||||
base::Bind(&AtomBrowserContext::CreateNetworkDelegate,
|
||||
base::Unretained(this)),
|
||||
protocol_handlers);
|
||||
|
||||
resource_context_->set_url_request_context_getter(url_request_getter_.get());
|
||||
|
|
|
@ -39,13 +39,13 @@ AtomURLRequestContextGetter::AtomURLRequestContextGetter(
|
|||
const base::FilePath& base_path,
|
||||
base::MessageLoop* io_loop,
|
||||
base::MessageLoop* file_loop,
|
||||
scoped_ptr<brightray::NetworkDelegate> network_delegate,
|
||||
base::Callback<scoped_ptr<brightray::NetworkDelegate>(void)> factory,
|
||||
content::ProtocolHandlerMap* protocol_handlers)
|
||||
: base_path_(base_path),
|
||||
io_loop_(io_loop),
|
||||
file_loop_(file_loop),
|
||||
job_factory_(NULL),
|
||||
network_delegate_(network_delegate.Pass()) {
|
||||
network_delegate_factory_(factory) {
|
||||
// Must first be created on the UI thread.
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
|
||||
|
@ -68,6 +68,7 @@ net::URLRequestContext* AtomURLRequestContextGetter::GetURLRequestContext() {
|
|||
|
||||
if (!url_request_context_.get()) {
|
||||
url_request_context_.reset(new net::URLRequestContext());
|
||||
network_delegate_ = network_delegate_factory_.Run().Pass();
|
||||
url_request_context_->set_network_delegate(network_delegate_.get());
|
||||
storage_.reset(
|
||||
new net::URLRequestContextStorage(url_request_context_.get()));
|
||||
|
@ -89,6 +90,7 @@ net::URLRequestContext* AtomURLRequestContextGetter::GetURLRequestContext() {
|
|||
net::DhcpProxyScriptFetcherFactory dhcp_factory;
|
||||
|
||||
storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
|
||||
storage_->set_transport_security_state(new net::TransportSecurityState);
|
||||
storage_->set_proxy_service(
|
||||
net::CreateProxyServiceUsingV8ProxyResolver(
|
||||
proxy_config_service_.release(),
|
||||
|
@ -116,6 +118,8 @@ net::URLRequestContext* AtomURLRequestContextGetter::GetURLRequestContext() {
|
|||
net::HttpNetworkSession::Params network_session_params;
|
||||
network_session_params.cert_verifier =
|
||||
url_request_context_->cert_verifier();
|
||||
network_session_params.transport_security_state =
|
||||
url_request_context_->transport_security_state();
|
||||
network_session_params.server_bound_cert_service =
|
||||
url_request_context_->server_bound_cert_service();
|
||||
network_session_params.proxy_service =
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#ifndef ATOM_BROWSER_NET_ATOM_URL_REQUEST_CONTEXT_GETTER_H_
|
||||
#define ATOM_BROWSER_NET_ATOM_URL_REQUEST_CONTEXT_GETTER_H_
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
|
@ -34,7 +35,7 @@ class AtomURLRequestContextGetter : public net::URLRequestContextGetter {
|
|||
const base::FilePath& base_path,
|
||||
base::MessageLoop* io_loop,
|
||||
base::MessageLoop* file_loop,
|
||||
scoped_ptr<brightray::NetworkDelegate> network_delegate,
|
||||
base::Callback<scoped_ptr<brightray::NetworkDelegate>(void)>,
|
||||
content::ProtocolHandlerMap* protocol_handlers);
|
||||
|
||||
// net::URLRequestContextGetter implementations:
|
||||
|
@ -53,7 +54,10 @@ class AtomURLRequestContextGetter : public net::URLRequestContextGetter {
|
|||
base::FilePath base_path_;
|
||||
base::MessageLoop* io_loop_;
|
||||
base::MessageLoop* file_loop_;
|
||||
|
||||
AtomURLRequestJobFactory* job_factory_;
|
||||
base::Callback<scoped_ptr<brightray::NetworkDelegate>(void)>
|
||||
network_delegate_factory_;
|
||||
|
||||
scoped_ptr<net::ProxyConfigService> proxy_config_service_;
|
||||
scoped_ptr<brightray::NetworkDelegate> network_delegate_;
|
||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 785e744bd4a433bad91a3f71d294f85401606eb5
|
||||
Subproject commit 569ea3f1e14b9214528be09dfc2117e387c0a03f
|
Loading…
Reference in a new issue