Give user a chance to create custom URLRequestJobFactory.

This commit is contained in:
Cheng Zhao 2014-08-13 15:48:16 +08:00
parent d01aa51686
commit 2d03c983e4
4 changed files with 34 additions and 0 deletions

View file

@ -20,6 +20,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/storage_partition.h"
#include "net/url_request/url_request_job_factory_impl.h"
#if defined(OS_LINUX)
#include "base/nix/xdg_util.h"
@ -109,6 +110,7 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE),
base::Bind(&BrowserContext::CreateNetworkDelegate, base::Unretained(this)),
base::Bind(&BrowserContext::CreateURLRequestJobFactory, base::Unretained(this)),
protocol_handlers,
protocol_interceptors.Pass());
resource_context_->set_url_request_context_getter(url_request_getter_.get());
@ -119,6 +121,12 @@ scoped_ptr<NetworkDelegate> BrowserContext::CreateNetworkDelegate() {
return make_scoped_ptr(new NetworkDelegate).Pass();
}
scoped_ptr<net::URLRequestJobFactory> BrowserContext::CreateURLRequestJobFactory(
const content::ProtocolHandlerMap& protocol_handlers,
const content::ProtocolHandlerScopedVector& protocol_interceptors) {
return scoped_ptr<net::URLRequestJobFactory>();
}
base::FilePath BrowserContext::GetPath() const {
return path_;
}