зеркало из https://github.com/electron/electron.git
Allow embedders to provide their own BrowserContext implementation
This commit is contained in:
Родитель
080d9f59e9
Коммит
3cef0dd98c
|
@ -21,7 +21,7 @@ BrowserMainParts::~BrowserMainParts() {
|
|||
}
|
||||
|
||||
void BrowserMainParts::PreMainMessageLoopRun() {
|
||||
browser_context_.reset(new BrowserContext);
|
||||
browser_context_.reset(CreateBrowserContext());
|
||||
|
||||
// These two objects are owned by devtools_http_handler_.
|
||||
auto delegate = new DevToolsDelegate;
|
||||
|
@ -30,4 +30,8 @@ void BrowserMainParts::PreMainMessageLoopRun() {
|
|||
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_; }
|
||||
|
||||
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)
|
||||
virtual void PreMainMessageLoopStart() OVERRIDE;
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче