diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 31c00b8d6aa0..3ade3b1c51a8 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -48,6 +48,9 @@ private: }; BrowserContext::BrowserContext() : resource_context_(new ResourceContext) { +} + +void BrowserContext::Initialize() { auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences")); PrefServiceBuilder builder; builder.WithUserFilePrefs(prefs_path, diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index 85f00148c9c0..ec3f1f6e5a2f 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -22,6 +22,8 @@ public: BrowserContext(); ~BrowserContext(); + void Initialize(); + net::URLRequestContextGetter* CreateRequestContext(content::ProtocolHandlerMap*); PrefService* prefs() { return prefs_.get(); } diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index 04e67f24fb18..bb435057c056 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -22,6 +22,7 @@ BrowserMainParts::~BrowserMainParts() { void BrowserMainParts::PreMainMessageLoopRun() { browser_context_.reset(CreateBrowserContext()); + browser_context_->Initialize(); // These two objects are owned by devtools_http_handler_. auto delegate = new DevToolsDelegate;