diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index fcfb82af6d..cb58d93be3 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -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; +} + } diff --git a/brightray/browser/browser_main_parts.h b/brightray/browser/browser_main_parts.h index 0268dc0402..7120c619b0 100644 --- a/brightray/browser/browser_main_parts.h +++ b/brightray/browser/browser_main_parts.h @@ -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