Add BrowserContext::GetRequestContext
This commit is contained in:
parent
c1b07b3da9
commit
4afa3f7206
2 changed files with 14 additions and 6 deletions
|
@ -115,6 +115,12 @@ BrowserContext::BrowserContext(const std::string& partition, bool in_memory)
|
||||||
content::BrowserContext::Initialize(this, path_);
|
content::BrowserContext::Initialize(this, path_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BrowserContext::~BrowserContext() {
|
||||||
|
BrowserThread::DeleteSoon(BrowserThread::IO,
|
||||||
|
FROM_HERE,
|
||||||
|
resource_context_.release());
|
||||||
|
}
|
||||||
|
|
||||||
void BrowserContext::InitPrefs() {
|
void BrowserContext::InitPrefs() {
|
||||||
auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences"));
|
auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences"));
|
||||||
PrefServiceFactory prefs_factory;
|
PrefServiceFactory prefs_factory;
|
||||||
|
@ -129,16 +135,15 @@ void BrowserContext::InitPrefs() {
|
||||||
prefs_ = prefs_factory.Create(registry.get());
|
prefs_ = prefs_factory.Create(registry.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserContext::~BrowserContext() {
|
|
||||||
BrowserThread::DeleteSoon(BrowserThread::IO,
|
|
||||||
FROM_HERE,
|
|
||||||
resource_context_.release());
|
|
||||||
}
|
|
||||||
|
|
||||||
void BrowserContext::RegisterInternalPrefs(PrefRegistrySimple* registry) {
|
void BrowserContext::RegisterInternalPrefs(PrefRegistrySimple* registry) {
|
||||||
InspectableWebContentsImpl::RegisterPrefs(registry);
|
InspectableWebContentsImpl::RegisterPrefs(registry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
URLRequestContextGetter* BrowserContext::GetRequestContext() {
|
||||||
|
return static_cast<URLRequestContextGetter*>(
|
||||||
|
GetDefaultStoragePartition(this)->GetURLRequestContext());
|
||||||
|
}
|
||||||
|
|
||||||
net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
|
net::URLRequestContextGetter* BrowserContext::CreateRequestContext(
|
||||||
content::ProtocolHandlerMap* protocol_handlers,
|
content::ProtocolHandlerMap* protocol_handlers,
|
||||||
content::URLRequestInterceptorScopedVector protocol_interceptors) {
|
content::URLRequestInterceptorScopedVector protocol_interceptors) {
|
||||||
|
|
|
@ -38,6 +38,9 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
|
||||||
static scoped_refptr<BrowserContext> Create(
|
static scoped_refptr<BrowserContext> Create(
|
||||||
const std::string& partition, bool in_memory);
|
const std::string& partition, bool in_memory);
|
||||||
|
|
||||||
|
// Get the request context, if there is no one, create it.
|
||||||
|
URLRequestContextGetter* GetRequestContext();
|
||||||
|
|
||||||
// content::BrowserContext:
|
// content::BrowserContext:
|
||||||
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
|
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
|
||||||
const base::FilePath& partition_path) override;
|
const base::FilePath& partition_path) override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue