Allow clients to supply their own NetworkDelegate implementation
This commit is contained in:
parent
09efd19d2f
commit
33b574b434
5 changed files with 20 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "browser_context.h"
|
||||
|
||||
#include "browser/inspectable_web_contents_impl.h"
|
||||
#include "browser/network_delegate.h"
|
||||
#include "common/application_info.h"
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
|
@ -66,11 +67,16 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext(content::Prot
|
|||
GetPath(),
|
||||
content::BrowserThread::UnsafeGetMessageLoopForThread(content::BrowserThread::IO),
|
||||
content::BrowserThread::UnsafeGetMessageLoopForThread(content::BrowserThread::FILE),
|
||||
CreateNetworkDelegate().Pass(),
|
||||
protocol_handlers);
|
||||
resource_context_->set_url_request_context_getter(url_request_getter_.get());
|
||||
return url_request_getter_.get();
|
||||
}
|
||||
|
||||
scoped_ptr<NetworkDelegate> BrowserContext::CreateNetworkDelegate() {
|
||||
return make_scoped_ptr(new NetworkDelegate).Pass();
|
||||
}
|
||||
|
||||
base::FilePath BrowserContext::GetPath() {
|
||||
if (!path_.empty())
|
||||
return path_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue