Allow embedders to provide their own BrowserContext implementation
This commit is contained in:
parent
080d9f59e9
commit
3cef0dd98c
2 changed files with 9 additions and 1 deletions
|
@ -21,7 +21,7 @@ BrowserMainParts::~BrowserMainParts() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserMainParts::PreMainMessageLoopRun() {
|
void BrowserMainParts::PreMainMessageLoopRun() {
|
||||||
browser_context_.reset(new BrowserContext);
|
browser_context_.reset(CreateBrowserContext());
|
||||||
|
|
||||||
// These two objects are owned by devtools_http_handler_.
|
// These two objects are owned by devtools_http_handler_.
|
||||||
auto delegate = new DevToolsDelegate;
|
auto delegate = new DevToolsDelegate;
|
||||||
|
@ -30,4 +30,8 @@ void BrowserMainParts::PreMainMessageLoopRun() {
|
||||||
devtools_http_handler_ = content::DevToolsHttpHandler::Start(factory, std::string(), delegate);
|
devtools_http_handler_ = content::DevToolsHttpHandler::Start(factory, std::string(), delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BrowserContext* BrowserMainParts::CreateBrowserContext() {
|
||||||
|
return new BrowserContext;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,10 @@ public:
|
||||||
content::DevToolsHttpHandler* devtools_http_handler() { return devtools_http_handler_; }
|
content::DevToolsHttpHandler* devtools_http_handler() { return devtools_http_handler_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// Subclasses should override this to provide their own BrowserContxt implementation. The caller
|
||||||
|
// takes ownership of the returned object.
|
||||||
|
virtual BrowserContext* CreateBrowserContext();
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
virtual void PreMainMessageLoopStart() OVERRIDE;
|
virtual void PreMainMessageLoopStart() OVERRIDE;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue